-
Notifications
You must be signed in to change notification settings - Fork 2k
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
sys/net: add some definitions for loramac #7592
Conversation
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.
Minor thing. Will give it a proper review tomorrow.
#endif | ||
|
||
#endif /* NET_LORAMAC_H */ | ||
/** @} */ |
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.
Missing newline or something.
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.
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
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those keys should definitely not be 0....
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.
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 ?
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.
Dito
* @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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the doc you name it NetID. Why not in the name (would have the benefit of being much shorter)
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.
I'll change that
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.
done
bdc25f4
to
0512ac5
Compare
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.
ACK
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.