Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarification needed for RADIOLIB_CC1101_MAX_PACKET_LENGTH and RADIOLIB_CC1101_PACKET_LENGTH. #1347

Closed
jofab-hub opened this issue Dec 12, 2024 · 1 comment
Labels
documentation Issue related to documentation only resolved Issue was resolved (e.g. bug fixed, or feature implemented)

Comments

@jofab-hub
Copy link

Hi,

I would like some clarification. In modules/CC1101/CC1101.h there is a constant (line 11):
#define RADIOLIB_CC1101_MAX_PACKET_LENGTH 63

(I suspect that it is the maximum size of a packet, I suspect also that this value includes the preamble). However, later in the file, (line 95), there is another definition:

#define RADIOLIB_CC1101_PACKET_LENGTH 0xFF // 7 0 packet length in bytes

So I do not know how to interpret these values: RADIOLIB_CC1101_PACKET_LENGTH>RADIOLIB_CC1101_MAX_PACKET_LENGTH (I do not know also, if it is a RadioLib limitation or a physical limit of the c1101 module).

In the example (https://github.com/jgromes/RadioLib/blob/master/examples/CC1101/CC1101_Transmit_Interrupt/CC1101_Transmit_Interrupt.ino), it is also confusing. Line 75, it is written:

// you can transmit C-string or Arduino string up to
// 64 characters long
  transmissionState = radio.startTransmit("Hello World!");

// you can also transmit byte array up to 64 bytes long

But later, line 118:

// send another one
    Serial.print(F("[CC1101] Sending another packet ... "));

// you can transmit C-string or Arduino string up to
// 256 characters long
    String str = "Hello World! #" + String(count++);
    transmissionState = radio.startTransmit(str);

// you can also transmit byte array up to 256 bytes long

who should I believe? Can I send more than 63 or 64 bytes in a packet?

Thank you

@jgromes
Copy link
Owner

jgromes commented Dec 14, 2024

This is indeed a bit confusing - likely some copy-paste erros that have crept in from other radios. CC1101 only has 64-byte FIFO buffers (unlike e.g. SX127x which has 256-byte FIFO). So you can transmit and receive at most 64 bytes in a single packet using CC1101.

I cleaned up the examples and the header file to prevent this confusion in the future - thanks for reporting!

@jgromes jgromes closed this as completed Dec 14, 2024
@jgromes jgromes added resolved Issue was resolved (e.g. bug fixed, or feature implemented) documentation Issue related to documentation only labels Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Issue related to documentation only resolved Issue was resolved (e.g. bug fixed, or feature implemented)
Projects
None yet
Development

No branches or pull requests

2 participants