sys/net: add some definitions for loramac#7592
Conversation
miri64
left a comment
There was a problem hiding this comment.
Minor thing. Will give it a proper review tomorrow.
sys/include/net/loramac.h
Outdated
| #endif | ||
|
|
||
| #endif /* NET_LORAMAC_H */ | ||
| /** @} */ No newline at end of file |
There was a problem hiding this comment.
fixed (missing newline)
6fa3716 to
a397db3
Compare
|
Looks good to me (at least for class A devices ;) |
423b0c2 to
08cc456
Compare
|
@miri64, any chance for you to look into this one ? |
41eb188 to
ebdba7c
Compare
|
With |
|
Sorry, I thought this PR introduces |
ebdba7c to
f833e29
Compare
Well, they were supposed to be added in #7505, but I just realized that the function definitions are missing or use a wrong name ( |
8b6072e to
de19479
Compare
390c31c to
1dc9bf3
Compare
|
Just a question here completely unrelated : |
The idea will be at some point to call LMIC API (or another one) via |
|
Removing Hack'n'ACK label since this contains gnrc(_netdev) related stuff. |
1dc9bf3 to
3617499
Compare
3617499 to
bdc25f4
Compare
miri64
left a comment
There was a problem hiding this comment.
Apart from this (purely opinion-based) value and naming comments, I'm fine with this PR. After a short discussion, I think we can merged.
| */ | ||
| #ifndef LORAMAC_DEV_EUI_DEFAULT | ||
| #define LORAMAC_DEV_EUI_DEFAULT { 0x00, 0x00, 0x00, 0x00, \ | ||
| 0x00, 0x00, 0x00, 0x00 } |
There was a problem hiding this comment.
Not sure if this is also true for LoRA, but from experience with IEEE 802.15.4 a random EUI might be better than an all 0 one. Of course, this should be in accordance with the standard, so if certain bits have semantics, they should be set accordingly.
There was a problem hiding this comment.
Leaving 0 values will prevent the node from the joining a LoRaWAN network in any case. That's why by default they use those arrays. For example, the RN2483 module (with the stack already in it) has those values by default.
The arrays are provided by the LoRaWAN provider when one register a new node and they depend on the type of join procedure (either ABP or OTAA).
I can verify what the LoRaWAN specs mention about that to be sure.
There was a problem hiding this comment.
Sounds convincing enough to me :-)
| #define LORAMAC_APP_KEY_DEFAULT { 0x00, 0x00, 0x00, 0x00, \ | ||
| 0x00, 0x00, 0x00, 0x00, \ | ||
| 0x00, 0x00, 0x00, 0x00, \ | ||
| 0x00, 0x00, 0x00, 0x00 } |
There was a problem hiding this comment.
Those keys should definitely not be 0....
There was a problem hiding this comment.
Since this is something that is set by the user retrieved from the LoRaWAN backend, I think these list can be kept like this by default.
The other problem is that some keys are not needed depending on the activation mode (ABP: requires all keys, OTAA only requires dev eui, app eui and app key).
Are you convinced ?
| * @brief Default device address | ||
| */ | ||
| #ifndef LORAMAC_DEV_ADDR_DEFAULT | ||
| #define LORAMAC_DEV_ADDR_DEFAULT { 0x00, 0x00, 0x00, 0x00 } |
There was a problem hiding this comment.
Same applies here as for the EUI-64.
sys/include/net/loramac.h
Outdated
| * @brief Default NetID (only valid with ABP join procedure) | ||
| */ | ||
| #ifndef LORAMAC_DEFAULT_NETWORK_ID | ||
| #define LORAMAC_DEFAULT_NETWORK_ID (1U) |
There was a problem hiding this comment.
In the doc you name it NetID. Why not in the name (would have the benefit of being much shorter)
bdc25f4 to
0512ac5
Compare
This PR adds required definitions and constants used for using LoRaMAC. It's mainly based on what is required for #7505 but I tried to keep them as generic as possible by checking the specs of the MAC layer of LoRaWAN.
There are probably missing definitions but those can be added later if needed.