Skip to content
Alex edited this page Dec 11, 2019 · 7 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

crc_ok shows whether the packet passed the CRC filter or not. Only for packets received.

Example

void rfPacketReceived(CCPACKET *packet){
  if (packet->length > 1)
  {   
    Serial.print("Is CRC ok?(1/0): ");Serial.println(packet->crc_ok);
  }

rssi

signed char rssi

Description

Received Strength Signal Indication level. The RSSI value is an estimate of the signal power level in the chosen channel. This value is based on the current gain setting in the RX chain and the measured signal level in the channel. 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

The Link Quality Indicator estimates how easily a received signal can be demodulated. Calculated over the 64 symbols following the sync word. Only for packets received.

Example

void rfPacketReceived(CCPACKET *packet){
  if (packet->length > 1)
  {   
    Serial.print("LQI/Link Quality: ");Serial.println(packet->lqi);
  }

Anti Swap

API for Anti Swap

Clone this wiki locally