STM32CubeWL icon indicating copy to clipboard operation
STM32CubeWL copied to clipboard

app data not sent notification in LmHandlerSend function (LmHandler lib)

Open krkoc opened this issue 3 years ago • 4 comments

I’ve run into a possible issue with the LmHandler library. STM32Cube_FW_WL_V1.0.0\Middlewares\Third_Party\LoRaWAN\LmHandler

In particular the LmHandlerSend function.

As I follow the code I see that before sending a frame a function calculates if the number of bytes to be sent will fit in a frame. It takes also in account the FOPTS field.

In case FOPTS field is empty the app data buffer of valid lenght gets sent and life is great.

In case the app data (valid lenght by itself) + FOPTS are greater than the total number of bytes allowed for the given region and spreading factor it will send an empty frame to “to flush MAC commands ”, as commented in the code.

What strikes me as problematic is not only that the app data buffer will be discarted but also that the user will not be informed that his/her buffer wasn’t sent. LmHandlerSend will in this case return LORAMAC_HANDLER_SUCCESS

krkoc avatar Jul 08 '21 09:07 krkoc

Hi @krkoc,

Please allow me to introduce @YoannBo who will look deeper into your report.

With regards,

ASELSTM avatar Jul 12 '21 14:07 ASELSTM

Thanks.

I could of course modify the library to get the information. I'm also curious to know if this is a real issue or is this somehow wanted behaviour.

krkoc avatar Jul 13 '21 10:07 krkoc

Hi @krkoc ,

You are rigth, the flush is indeed not considered as an error while the LmHandler is garbaging the app data in order to guaranty the MAc commands are always sent. I agree with you that, at least the LmHandler should signal the data loss to the app layer,

We will investigate more and let you know

thank you

YoannBo avatar Jul 13 '21 12:07 YoannBo

ST Internal Reference: 112594

ASELSTM avatar Sep 01 '21 09:09 ASELSTM