-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question about IsSticky handling in LoRaMacCommands.c #752
Comments
Hi ConnyBusy, yes, that explains why this change was made, removing all rather than only the first sticky mac element. However, the way this was implemented is IMHO unnecessarily complicated, and could be simplified as shown above. Regards, |
Hi Marc, I think you are right the for loop is unnecessary. Your proposed code is better Best regards |
Hi all, thanks for the report. I agree that this can be simplified. We will provide a fix for it. |
This change breaks V1.1:
Because there is no check on the return value of LoRaMacCommandsGetCmd, the remove proceeds and results in an invalid deletion on the underlying linked list, It causes a hardfault on my LPC 54628. See trace below which gives an idea of th flow: [lorawan] initialisation |
Hi msmits-definium, i will double check it and will come back to you soon. Could you please open up a new issue for it? EDIT: Could you also provide a short description about the fail state? What is the consequence ? |
Hi djaeckle thanks for your quick response. I've created issue #772 Regarding your question as to the fail state and the consequence: as mentioned in my original comment: |
Hello,
I am a little confused about the purpose of the
CIDsStickyAnsCmds[]
array. It appears to be used to doublecheck that a command is really sticky before removing it from the linked list:Why not use IsSticky() instead ?
Better yet, why bother at all, since curElement->IsSticky already shows whether the command is sticky ?
IMV, the above could be reduced to
and
CIDsStickyAnsCmds[]
could be removed from the code.Did I miss something ?
The text was updated successfully, but these errors were encountered: