Replies: 1 comment 1 reply
-
In most cases, you don't need to know the length of the packet before receiving it, that will be handled automatically by the radio. In special cases, like fixed packet length mode in FSK, or implicit header mode in LoRa, you do need to know the payload length in advance, but that's not really a typical case. Length of the last received packet can be retrieved by calling
None that I'm aware of; this process is hidden from the user. Though I'm not sure what exactly would be the use case here, I don't think it's realistic to assume the CRC calculation in the SX126x chip could fail, hence no need for the independent check. |
Beta Was this translation helpful? Give feedback.
-
Dear Jan,
First of all thanks for this great work in the radio library.
My questions are related with the CRC calculation and the insertion/extraction of this CRC by the chip SX1268 in/from the data stream.
Let us say that I want to transmit a fixed packet of 10 bytes, I understand that, the chip, if configured properly, will create a preamble, send the synchword, send the payload, and finally, will calculate the CRC for the payload and append it to the data stream.
In the reception side, the preamble and the synchword will be configured to match those of the transmission. As soon as the receiver is triggered properly after the reception of the preamble bits and synchword, the chip begins the payload reception. And here comes the questions:
For the packet length in reception should I configure 10 bytes as it is the size of the payload, or should I configure 12 bytes, to accomodate the reception of the 2 extra bytes for the CRC?
Is there a way of extracting the CRC calculation values (residue), at the end of the chip reception process, to later check whether the SX1268 calculated CRC over the payload received matches or not with an independent calculation performed by other means (e.g. using a dedicated software to process the payload and re-calculate the crc to compare it with that one produced by the SX1268)?
Thanks again and Best Regards.
Esteban.
Beta Was this translation helpful? Give feedback.
All reactions