beegee-tokyo / SX126x-Arduino

Arduino library to use Semtech SX126x LoRa chips and modules to communicate
MIT License
228 stars 64 forks source link

Notify confirmed TX failure if datarate becomes insufficient for payl… #87

Closed avillacis closed 1 year ago

avillacis commented 1 year ago

…oad size

When application code requests a confirmed transmission, and the current datarate allows the payload length, the current code will wait a total of 2 groups of 2 RX windows for the confirmation packet. If not received, the code will decrease the TX datarate by one and retry the transmission. However, if the degraded datarate becomes insufficient to transmit the payload length, the attempt to retransmit will fail, and prior to this commit, the current code fails to fire the confirmation callback with the failure status, leaving the application code with no indication that the library will not retry the retransmission. Fixed in this commit by adding the payload-size-error condition check in order to fire the callback with failure indication.

Intended to fix https://github.com/beegee-tokyo/SX126x-Arduino/issues/86