-
Notifications
You must be signed in to change notification settings - Fork 3k
LoRaWAN: Proper size checks for link ADR cmds & correct include path in Unittests framework #9601
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
Conversation
@hasnainvirk, thank you for your changes. |
3600df1
to
9d2cb35
Compare
9d2cb35
to
07fcdcd
Compare
@cmonr We may need to trigger build again. The failure seems to be unrelated to PR. |
Hi @hasnainvirk , |
Test run: SUCCESSSummary: 12 of 12 test jobs passed |
07fcdcd
to
7354268
Compare
@kjbracey-arm Please review again. |
@0xc0170 @NirSonnenschein This can go in too. |
No reviews from @mbed-os-wan ? At least one here! |
@0xc0170 Antti is OOO. The other LoRaWAN option in mbed-os-wan is me and I opened this PR :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will OK once the typo is fixed
enable_test() seems to include CTest framework in the CMakeLists.txt but that would result in inconsistencies and CTest framework will not be able to find DartConfiguration file or MemCheck tool. Including CTest framework explicitely in the CMakeLists.txt seems to solve the issue.
In a specific branch path 'adr_settings' in link_adr_request() API, the structure adr_settings of type link_adr_params_t will be rendered uninitialized. To prevent this we initialize the construct as zero. In addition to that, to handle the case properly we should check for the command identifier and the command payload length anticipating contiguous blocks of adr commands. If we find a discrepency in size, we should abort.
Updating unit test in response to the change in the link ADR related APIs.
7354268
to
a14acfa
Compare
@cmonr Updated as suggested. Thanks for a having splendid pair of eyes :) |
CI started |
Test run: SUCCESSSummary: 12 of 12 test jobs passed |
Description
This PR addresses two issues:
i) adr_settings construct of type link_adr_params_t in link_adr_request() API in the LoRaPHYUS915 class would be render uninitialized if the program takes a specific branch path. We have fixed that by zero initializing the construct. In addition to that we are now checking for the proper payload size anticipating contiguous link ADR command blocks.
ii) Currently, mbed Unittests will fail to run memcheck tool or other tools as the DartConfiguration.Tcl file would not be found. The problem is the inclusion of Ctest framework at the wrong place. We need explicit inclusion in the CmakeLists.txt which fixes the issue,
Pull request type
Reviewers
@AnttiKauppila
@kjbracey-arm
@cmonr