Closed panosss closed 4 years ago
Why you want that? Normally, we need packetLength so that receiver knows exact length of the packet. Without exact packetLength, the receiver doesn't know where the packet ends.
(I apologise for the delayed answer, I just now saw it) I need it because in the code it 's used, so I have to use it too.
int SX1278_LoRaEntryRx(SX1278_t * module, uint8_t length, uint32_t timeout) {
uint8_t addr;
module->packetLength = length;
SX1278_defaultConfig(module); //Setting base parameter
If I understand your question correctly, you want to get the packetLength.
You can use callback. In callback method, you will have packetLength. https://github.com/sandeepmistry/arduino-LoRa/blob/master/examples/LoRaReceiverCallback/LoRaReceiverCallback.ino#L30
If I understand your question correctly, you want to get the packetLength.
Also an option to use my fork at https://github.com/szotsaki/arduino-LoRa. I have that API public under the name of getPayloadLength()
.
I 've built a receiver with Arduino which uses the Lora library. With these settings:
I 'm trying to make a sender based on STM32 that will send to the above mentioned receiver. One of the parameters for begin() is packetLength; So I want to set the packet length of the receiver the same as in sender (10). To be sure that there won't be any problem.
How do I set the packetLength in Lora library?
(maybe it has a different name like 'payload length' or something)