[riot-notifications] [RIOT-OS/RIOT] pkg/semtech-loramac: rework TX/RX interaction with the MAC (#11541)

Alexandre Abadie notifications at github.com
Fri May 17 12:08:53 CEST 2019

The RIOT community cares a lot about code quality.
Therefore, before describing what your contribution is about, we would like
you to make sure that your modifications are compliant with the RIOT
coding conventions, see https://github.com/RIOT-OS/RIOT/wiki/Coding-conventions.

### Contribution description

This is another attempt to fix #11530.
It follows the suggestion of @ParksProjets in https://github.com/RIOT-OS/RIOT/pull/11535#issuecomment-493151047:
- TX status is now only reported after an mcps confirm event
- RX data are notified from mcps indication events
- one needs an external thread to receive data from the MAC. This is much simpler but it consume a little more RAM if one wants to manage downlinks message outside of the MAC. The bonus point with this approach is the ability to correctly support class C devices.

I have tested this PR using OTAA, ABP activations and with CONFIRMED and UNCONFIRMED messages.

Everything is working as expected.

The only small thing is the link check which is not working correctly but it's already the case in master I think.

Finally, I also had to update the `examples/lorawan` application and doxygen documentation to avoid potential lock of autonomous application. Maybe `examples/lorawan` could be later refactored with downling messages better handled or adapted for class C devices.

Put here the description of your contribution:
- describe which part(s) of RIOT is (are) involved
- if it's a bug fix, describe the bug that it solves and how it is solved
- you can also give more information to reviewers about how to test your changes

### Testing procedure

Run `tests/pkg_semtech-loramac`, send messages from the device, send messages from the network using CONFIRMED/UNCONFIRMED (`cnf/uncnf` option of `loramac tx`: everything should work, with this PR, the application doesn't block.

Details steps to test your contribution:
- which test/example to compile for which board and is there a 'test' command
- how to know that it was not working/available in master
- the expected success test output

### Issues/PRs references

fixes #11530, cleaner alternative to #11535 

Examples: Fixes #1234. See also #5678. Depends on PR #9876.

Please use keywords (e.g., fixes, resolve) with the links to the issues you
resolved, this way they will be automatically closed when your pull request
is merged. See https://help.github.com/articles/closing-issues-using-keywords/.

You can view, comment on, or merge this pull request online at:


-- Commit Summary --

  * pkg/semtech-loramac: reduce MAC thread message queue
  * pkg/semtech-loramac: refactor send and recv interactions with the MAC
  * tests/pkg_semtech-loramac: add RX thread for downlink messages
  * pkg-semtech-loramac: update/simplify doxygen documentation
  * examples/lorawan: remove recv call to avoid endless lock

-- File Changes --

    M examples/lorawan/main.c (3)
    M pkg/semtech-loramac/contrib/semtech_loramac.c (116)
    M pkg/semtech-loramac/doc.txt (6)
    M pkg/semtech-loramac/include/semtech_loramac.h (4)
    M tests/pkg_semtech-loramac/main.c (67)

-- Patch Links --


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190517/116dd385/attachment.html>

More information about the notifications mailing list