pkg/semtech-loramac: add link check support#8639
Conversation
| _semtech_loramac_link_check_received = false; | ||
| MlmeReq_t mlmeReq; | ||
| mlmeReq.Type = MLME_LINK_CHECK; | ||
| LoRaMacMlmeRequest(&mlmeReq); |
There was a problem hiding this comment.
I would try to use here something similar to the mlme_confirm function. That is, sending a message to the LoRaMAC thread to process this MLME request. Otherwise, this won't be thread safe.
There was a problem hiding this comment.
(Since in this case, this function is called from main thread)
There was a problem hiding this comment.
I know that problem, it's the same story with the get/set functions. But for the moment, it's fine I think, until I finalize the refactoring I'm working on (as described in the initial comment).
There was a problem hiding this comment.
maybe this branch is helpful for you. It's an abandoned branch though
There was a problem hiding this comment.
Thanks, it helps certainly! That's indeed in the spirit of what I have in mind.
That would be awesome |
Here it is: #8798. I still need to adapt this one. |
a820de0 to
41da691
Compare
Done and tested. |
a3676ee to
135d321
Compare
30fcba4 to
b09d092
Compare
b09d092 to
04831e8
Compare
|
@jia200x, next one is here ;) and it is now rebased on latest master. |
|
@aabadie tested and works good. The only issue I see is the fact the link_check command is not being show in the But works as expected! |
04831e8 to
aa0acd6
Compare
Ah yes, good catch! It should be fixed now |
|
@jia200x, do you still see blocking issues with this one ? |
|
ping @jia200x |
|
Looks good! It's fine to me |
|
ACK & GO |
Contribution description
This PR adds support for the LoRaWAN "LinkCheckReq" MAC command.
The feature adds the possibility to validate the connectivity with the network by retrieving 2 informations:
"A value of 0 means that the frame was received at the demodulation floor (0 dB or no
margin) while a value of 20, for example, means that the frame reached the gateway 20 dB
above the demodulation floor"
The link check request will be sent with the next TX packet and the reply will be received by the nodes in the following RX window. This means that one has to schedule the request and check for the result after a TX.
This PR also adds the
link_checksubcommand to theloramaccommand of thepkg_semtech-loramactest application shell. Use it as follows:As a side note, I'm planning to refactor the API of the semtech loramac package by introducing a structure that will handle a loramac instance. This structure will also contain usefull attributes (radio device descriptor, keys, rx_data, etc) and will simplify the netdev adaption (I think) and help fixing thread safety issues.see #8798Issues/PRs references
Now based on
#8798