With the exception of transparent mode, the radio communicates with the user hardware via a set of formatted commands and responses.
All commands and responses take the following form:
Field | Bytes | Description |
Prefix | 1 | Constant $AA |
PcktType | 1 | Type of packet to follow. |
PayLdLen | 2 | The length of the following payload in bytes (n) |
PayLdData | n | The packet payload itself. See the command appendix. |
Checksum | 1 | A verification checksum |
Suffix | 1 | Constant $55 |
Valid PcktTypes are as follows:
PcktType | Class | Description | |
$00 – $0F | AckData | Guaranteed-delivery packets | |
$10 – $1F | NoAckData | No acknowledgement packets | |
$20 – $2F | Ack | Acknowledgement packets | |
$30 | QuerySigStr | Test signal strength command | |
$31 | SigStr | Signal strength response | |
$80 | ReadMem | Read data from radio's RAM or EEPROM memory | |
$81 | WriteMem | Write data to radio's RAM or EEPROM memory | |
$82 | SweepFreq | Read signal strengths from a range of frequencies | |
$83 | ReadModel | Read radio's model string | |
$84 | ReadFirm | Read radio's firmware version | |
$85 | ReadSerial | Read radio's serial number | |
$86 | Success | Successful command execution reply | |
$87 | Failure | Failed command execution reply | |
$88 | SetMode | Set the radio's current mode | |
$89 | WriteFlash | Write data to radio's Flash memory | |
$8A | ListenSigStr | Listen to communications and report signal strengths | |
$8B | RestartRadio | Reset the radio and reload settings from EEPROM | |
$8C | SetDebug | Enable one of the debugging modes | |
$8D | ReadRSSI | Read a raw RSSI value | |
$8E | FlushQueue | Report when all packets have been processed |
The Checksum is calculated by totaling the byte codes in the PcktType, PayLdLen, and the PayLdData fields. Only the low eight bits of the total are kept.
As you can see in the command definition, the SetMode command has a PcktType of $88 and a payload of a single byte (Mode). A Mode of $01 indicates a switch to mixed-on mode. So to switch to the mixed-on mode you would send the following byte codes to the serial port:
$AA, $88, $01, $00, $01, $8A, $55
Note that the Checksum of $8A = $88 + $01 + $00 + $01.
The radio should respond with:
$AA, $86, $03, $00, $88, $00, $00, $11, $55
This indicates Successful processing (PcktType $86) of a SetMode command (PcktType $88) with zero bytes of additional data.
The Checksum ($11) is the low eight bits of $86 + $03 + $00 + $88 + $00 + $00 = $111.