I was able to get the source code to Shortwave Log's Lowe HF-150 integration, looks like we only have SetMode and SetFrequency and can not read the radio, but i'm posting the source here for future reference when i get to actually trying to write a hamlib driver for this radio....
using System;
using System.Text;
using RLScommon;
using RLScommon.Serial;
namespace RadioInterface
{
/// <summary>
/// Summary description for LoweHF150.
/// </summary>
public class LoweHF150
{
public LoweHF150()
{
}
public static string SetMode(CommPort com, string sMode)
{
string sCommand = "Mod";
switch (sMode.ToUpper())
{
case "AM":
sCommand += "AM ";
break;
case "AMN":
sCommand += "AMn";
break;
case "ASD":
sCommand += "ASd";
break;
case "ASF":
sCommand += "ASf";
break;
case "ASL":
sCommand += "ASl";
break;
case "ASU":
sCommand += "ASu";
break;
case "LSB":
sCommand += "Lsb";
break;
case "USB":
sCommand += "Usb";
break;
default:
break;
}
sCommand += "\r";
// The factory software sends 4 bytes, then 3.
string sCommand1 = sCommand.Substring(0,4);
string sCommand2 = sCommand.Substring(4);
byte[] bCommand1 = ASCIIEncoding.ASCII.GetBytes(sCommand1);
com.Write(bCommand1);
byte[] bCommand2 = ASCIIEncoding.ASCII.GetBytes(sCommand2);
com.Write(bCommand2);
return sMode;
}
public static double SetFrequency(CommPort com, double kHz, bool detune, double offset1, double offset2, double offset3,
int split1, int split2)
{
if (detune)
{
kHz = Common.GetFrequencyOffset(kHz, offset1, offset2, offset3, split1, split2);
}
try
{
// We need the nearest 8 Hz tuning step.
int iWholeFrequency = Convert.ToInt32(kHz * 1000.0);
int iQuotient = iWholeFrequency / 8;
int iRemainder = iWholeFrequency % 8;
if (iRemainder >= 4)
{
iQuotient++;
}
kHz = (Convert.ToDouble(iQuotient) * 8.0) / 1000.0;
string sFrequency = String.Format("{0:F3}", kHz);
// If we're using European settings, replace the comma with a period.
sFrequency = sFrequency.Replace(',','.');
int iLen = sFrequency.Length;
while (iLen < 9)
{
// Pad the front of the string with spaces
sFrequency = " " + sFrequency;
iLen = sFrequency.Length;
}
// According to the factory software, we have to send
// three sets of 4 bytes, then terminate with 0x0D
string sCommand = "Frq" + sFrequency + "\r";
string sCommand1 = sCommand.Substring(0,4);
string sCommand2 = sCommand.Substring(4,4);
string sCommand3 = sCommand.Substring(8,4);
string sCommand4 = sCommand.Substring(12);
Byte[] bCommand1 = ASCIIEncoding.ASCII.GetBytes(sCommand1);
com.Write(bCommand1);
Byte[] bCommand2 = ASCIIEncoding.ASCII.GetBytes(sCommand2);
com.Write(bCommand2);
Byte[] bCommand3 = ASCIIEncoding.ASCII.GetBytes(sCommand3);
com.Write(bCommand3);
Byte[] bCommand4 = ASCIIEncoding.ASCII.GetBytes(sCommand4);
com.Write(bCommand4);
}
catch
{
com.Flush();
}
// Return kHz since it's rounded to the nearest 8 Hz.
return kHz;
}
}
}
This is in C# .NET wich needs to be converted to "cross-compilable" C++ and then into a hamlib driver....wish me luck!