XaiJu
nicsure
nicsure

patreon


nicFW Serial Protocol : VFO Info Request

Since Patreon's posting system is woefully bad for posting code, I've included this info as a downloadable txt document as well.

The RT-900 uses a baud rate of 57600, No Parity, 8 data bits, 1 stop bit. Version 4.00.22 or later

The TD-H3 uses a baud rate of 38400, No Parity, 8 data bits, 1 stop bit. Version 2.52.17 or later

To request the status of the currently active VFO, send the following two bytes to the radio:

0xAA 0x60

The radio will respond with the following 37 byte packet, the format of this packet is slightly different for the RT-900 and the TD-H3, notably, the TD-H3 endianness is BIG while the RT-900 is LITTLE.

RT-900 VFO Status Packet

------------------------

u8 signature; // (always 0xAA)

u8 packetType; // 0x60 (squelch closed) or 0x61 (squelch open)

U32 rxFreq; // (32 bit little endian 10 Hz units)

U32 txFreq; // (as above)

U16 rxSubTone; // little endian (<0x8000=CTCSS <0xC000=DCS >=0xC000=InvertedDCS

// essentially bit 15 is the flag for DCS, bit 14 is the flag for code inversion)

// the actual code is bits 13 to 0

U16 txSubTone; // (as above)

u8 txPower; // (0-6) 0=no transmit allowed, 1=ZERO output (no PA engaged), 2=Very Low, 3=Low, 4=Mid, 5=High, 6=Very High

u8 unused;

union __attribute__((packed))

{

u16 value; // (group nibbles: 0=No Group, 1=Group A, 2=Group B, 3=Group C, etc..) will be all 0 in VFO mode

struct __attribute__((packed))

{

u16 g0 : 4;

u16 g1 : 4;

u16 g2 : 4;

u16 g3 : 4;

} single;

} groups;

struct __attribute__((packed))

{

u8 bandwidth : 1; // 0=wide 1=narrow

u8 modulation : 2; // 0=auto, 1=fm, 2=am, 3=usb

u8 position : 1; // 0=VFO-A, 1=VFO-B

u8 pttID : 2; // 0 = off, 1=BoT, 2=EoT, 3=Both

u8 reversed : 1;

u8 busyLock : 1; // 0=off, 1=on

} bits;

s8 clarifier; // 100 Hz Units (signed) Frequency adjustment

char reserved[2];

char channelName[12]; // empty if in VFO mode (ASCII)

u16 rssi; // signal level (0x0000 to 0x01FF) (little endian)

u8 exNoise; // noise level (0x00 to 0x7F)

TD-H3 VFO Status Packet (Differences from the RT-900 shown as comments)

-----------------------------------------------------------------------

u8 signature;

u8 packetType;

U32 rxFreq; // (32 bit big endian 10 Hz units)

U32 txFreq; // as above

U16 rxSubTone; // big endian (<0x8000=CTCSS <0xC000=DCS >=0xC000=InvertedDCS

U16 txSubTone; // as above

u8 txPower; // 0 - 255

union

{

u16 value;

struct

{

u16 g0 : 4;

u16 g1 : 4;

u16 g2 : 4;

u16 g3 : 4;

} single;

} groups;

struct

{

u8 bandwidth : 1;

u8 modulation : 2;

u8 position : 1;

u8 pttID : 2;

u8 reversed : 1;

u8 busyLock : 1;

} bits;

char reserved[4];

char name[12];

u16 rssi; // signal level (0x0000 to 0x01FF) (big endian)

u8 exNoise;


More Creators