Skip to content

Conversation

hasnainvirk
Copy link
Contributor

@hasnainvirk hasnainvirk commented Feb 4, 2019

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

[X] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@AnttiKauppila
@kjbracey-arm
@cmonr

@hasnainvirk hasnainvirk changed the title Fixing initialization of link_adr_params_t in link_adr_request() API & correct include path in Unittests framework [LoRaWAN] Fixing initialization of link_adr_params_t in link_adr_request() API & correct include path in Unittests framework Feb 4, 2019
@ciarmcom ciarmcom requested review from a team, AnttiKauppila, cmonr and kjbracey February 4, 2019 14:00
@ciarmcom
Copy link
Member

ciarmcom commented Feb 4, 2019

@hasnainvirk, thank you for your changes.
@AnttiKauppila @cmonr @kjbracey-arm @ARMmbed/mbed-os-wan @ARMmbed/mbed-os-maintainers please review.

@hasnainvirk hasnainvirk changed the title [LoRaWAN] Fixing initialization of link_adr_params_t in link_adr_request() API & correct include path in Unittests framework [LoRaWAN] Proper size checks for link ADR cmds & correct include path in Unittests framework Feb 4, 2019
@hasnainvirk
Copy link
Contributor Author

@cmonr We may need to trigger build again. The failure seems to be unrelated to PR.

@NirSonnenschein
Copy link
Contributor

NirSonnenschein commented Feb 5, 2019

Hi @hasnainvirk ,
@cmonr is not available right now: restarting CI

@mbed-ci
Copy link

mbed-ci commented Feb 5, 2019

Test run: SUCCESS

Summary: 12 of 12 test jobs passed
Build number : 1
Build artifacts

@hasnainvirk
Copy link
Contributor Author

@kjbracey-arm Please review again.

@hasnainvirk
Copy link
Contributor Author

@0xc0170 @NirSonnenschein This can go in too.

@0xc0170 0xc0170 changed the title [LoRaWAN] Proper size checks for link ADR cmds & correct include path in Unittests framework LoRaWAN: Proper size checks for link ADR cmds & correct include path in Unittests framework Feb 7, 2019
@0xc0170
Copy link
Contributor

0xc0170 commented Feb 7, 2019

No reviews from @mbed-os-wan ? At least one here!

@hasnainvirk
Copy link
Contributor Author

@0xc0170 Antti is OOO. The other LoRaWAN option in mbed-os-wan is me and I opened this PR :)

Copy link
Contributor

@cmonr cmonr left a 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

Hasnain Virk added 3 commits February 14, 2019 17:15
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.
@hasnainvirk
Copy link
Contributor Author

@cmonr Updated as suggested. Thanks for a having splendid pair of eyes :)

@cmonr
Copy link
Contributor

cmonr commented Feb 15, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Feb 15, 2019

Test run: SUCCESS

Summary: 12 of 12 test jobs passed
Build number : 2
Build artifacts

@0xc0170 0xc0170 merged commit dc15744 into ARMmbed:master Feb 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants