forked from panStamp/arduino_nrg
-
Notifications
You must be signed in to change notification settings - Fork 0
CCPACKET
Alex edited this page Nov 14, 2019
·
5 revisions
CCPACKET is the basic container structure for panStamp's raw RF packets and the panStamp API. CCPACKET consists of the following attributes:
unsigned char length
Description
Size of the data field.
Example
void rfPacketReceived(CCPACKET *packet){
if (packet->length > 1)
{
Serial.print("Length: ");Serial.println(packet->length);
}
unsigned char data[CCPACKET_DATA_LEN]
Description
Data buffer. Up to 61 bytes per packet.
Example
void rfPacketReceived(CCPACKET *packet){
if (packet->length > 1)
{
Serial.print("Data0/destination: ");Serial.println(packet->data[0]);
Serial.print("Data1: ");Serial.println(packet->data[1]);
}
bool crc_ok
Description
Only for CCPACKETs received, crc_ok shows whether the packet passed the CRC filter or not.
Example
void rfPacketReceived(CCPACKET *packet){
if (packet->length > 1)
{
Serial.print("Is CRC ok?(1/0): ");Serial.println(packet->crc_ok);
}
unsigned char rssi
Description
Received Strength Signal Indication level. Only for packets received.
Example
void rfPacketReceived(CCPACKET *packet){
if (packet->length > 1)
{
Serial.print("RSSI/Signal Strength: ");Serial.println(packet->rssi);
}
unsigned char lqi
Description
Link Quality Index. Only for packets received.
Example
void rfPacketReceived(CCPACKET *packet){
if (packet->length > 1)
{
Serial.print("LQI/Link Quality: ");Serial.println(packet->lqi);
}