Skip to content
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:

length

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);
  }

data

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]);
  }

crc_ok

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);
  }

rssi

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);
  }

lqi

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);
  }
Clone this wiki locally