diff --git a/features/lorawan/LoRaWANInterface.h b/features/lorawan/LoRaWANInterface.h index 87d533da72..7b6068798d 100644 --- a/features/lorawan/LoRaWANInterface.h +++ b/features/lorawan/LoRaWANInterface.h @@ -310,7 +310,7 @@ public: * * @return It could be one of these: * i) 0 if there is nothing else to read. - * ii) Number of bytes still pending to read. + * ii) Number of bytes written to user buffer. * iii) LORA_MAC_STATUS_WOULD_BLOCK if there is * nothing available to read at the moment. * iv) A negative error code on failure. diff --git a/features/lorawan/LoRaWANStack.cpp b/features/lorawan/LoRaWANStack.cpp index c017eba21f..4ddc152001 100644 --- a/features/lorawan/LoRaWANStack.cpp +++ b/features/lorawan/LoRaWANStack.cpp @@ -991,7 +991,7 @@ int16_t LoRaWANStack::handle_rx(const uint8_t port, uint8_t* data, _rx_msg.receive_ready = false; } - return _rx_msg.pending_size; + return base_size; } lora_mac_status_t LoRaWANStack::mlme_request_handler(lora_mac_mlme_req_t *mlme_request) diff --git a/features/lorawan/LoRaWANStack.h b/features/lorawan/LoRaWANStack.h index 0e1aa7f675..24d430feb3 100644 --- a/features/lorawan/LoRaWANStack.h +++ b/features/lorawan/LoRaWANStack.h @@ -259,7 +259,7 @@ public: * * @return It could be one of these: * i) 0 if there is nothing else to read. - * ii) Number of bytes still pending to read. + * ii) Number of bytes written to user buffer. * iii) LORA_MAC_STATUS_WOULD_BLOCK if there is * nothing available to read at the moment. * iv) A negative error code on failure. diff --git a/features/netsocket/LoRaWANBase.h b/features/netsocket/LoRaWANBase.h index f8826e09a2..9b26610718 100644 --- a/features/netsocket/LoRaWANBase.h +++ b/features/netsocket/LoRaWANBase.h @@ -222,7 +222,7 @@ public: * * @return It could be one of these: * i) 0 if there is nothing else to read. - * ii) Number of bytes still pending to read. + * ii) Number of bytes written to user buffer. * iii) LORA_MAC_STATUS_WOULD_BLOCK if there is * nothing available to read at the moment. * iv) A negative error code on failure.