
API frame format
XLR PRO Radio Frequency (RF) Modem User Guide
54
Supporting API
Applications that support API should make provisions to accommodate new API frames that may be introduced in
future releases. For example, a section of code on a host microprocessor that handles received serial API frames (sent
out the XLR PRO active serial interface) might look like this:
XLR PRO frame descriptions
The following sections illustrate the types of frames encountered while using the API.
AT command—apply changes
Frame type: 0x08
Used to query or set XLR PRO parameters on the local device and apply the changes after executing the command.
(Changes made to XLR PRO parameters take effect once changes are applied.)
The example below shows an API frame that queries the ID parameter value of the XLR PRO.
AT command—queue new parameter value
Frame type: 0x09
Used to query or set XLR PRO parameters. In contrast to the 0x08, “AT Command” API type, new parameter values are
Frame fields
Offset
Example
Description
Start delimiter
0
0x7E
Length
MSB 1
0x00
Number of bytes between the length and the checksum.
LSB 2
0x04
Frame-specific
data
Frame type
3
0x08
Frame ID
4
0x52
Identifies this command for correlation to a later
response frame (0x88) to this command. If set to 0, no
response frame will be sent.
AT command
5
0x49
Command name —Two ASCII characters that identify the
AT command
ID
.
6
0x44
Parameter value
(optional)
If present, indicates the requested parameter value to set
the given register. If no characters present, register is
queried.
Checksum
8
0x18
0xFF—The 8-bit sum of bytes from offset 3 to this byte.
void XLRPRO_HandleRxAPIFrame(_apiFrameUnion*papiFrame){
switch(papiFrame->api_id){
case RX_RF_DATA_FRAME:
//process received RF data frame
break;
case NODE_IDENTIFICATION_FRAME:
//process node identification frame
break;
default:
//Discard any other API frame types that are not being used
break;
}
}