[SX128x] Fixed packet length in implicit mode (#716)

This commit is contained in:
jgromes 2023-03-31 22:02:58 +02:00
parent ece2621a6f
commit 45c5859338

View file

@ -1182,6 +1182,12 @@ float SX128x::getFrequencyError() {
size_t SX128x::getPacketLength(bool update) {
(void)update;
// in implicit mode, return the cached value
if((getPacketType() == RADIOLIB_SX128X_PACKET_TYPE_LORA) && (_headerType == RADIOLIB_SX128X_LORA_HEADER_IMPLICIT)) {
return(_payloadLen);
}
uint8_t rxBufStatus[2] = {0, 0};
_mod->SPIreadStream(RADIOLIB_SX128X_CMD_GET_RX_BUFFER_STATUS, rxBufStatus, 2);
return((size_t)rxBufStatus[0]);