STM32CubeWL icon indicating copy to clipboard operation
STM32CubeWL copied to clipboard

[LoRaMac] The use of the adrBlockFound variable in ProcessMacCommands is unknown

Open wdfk-prog opened this issue 1 year ago • 1 comments

Additional context

  • I don't understand what adrBlockFound does here, because every time it comes in it's a false assignment; A value of true below does nothing.

  • I think this variable needs to be set to static to make sense.

https://github.com/STMicroelectronics/STM32CubeWL/blob/eec7ff9694007fda9aae32bdb2304c67c0ac013f/Middlewares/Third_Party/LoRaWAN/Mac/LoRaMac.c#L2676-L2774

wdfk-prog avatar May 09 '24 06:05 wdfk-prog

ST Internal Reference: 181246

RJMSTM avatar May 13 '24 14:05 RJMSTM

Hello,

We verified the use of this variable, and it is correctly defined. It must be set to false at the beginning of the function to process only the first block of LinkAdrRequests and ignore the subsequent blocks as the comment specified:

// The end node is allowed to process one block of LinkAdrRequests. // It must ignore subsequent blocks

This part is within a While loop to process the all MAC command, so it has effect on the MAC command.

If it were defined static, it will be always true after the first function call, breaking the right functionality.

Regards, Rania

RJMSTM avatar Jan 30 '25 10:01 RJMSTM

Thanks for explaining. I have no more questions.

wdfk-prog avatar Feb 09 '25 04:02 wdfk-prog