gnrc_lorawan: add header definitions and helpers#6165
gnrc_lorawan: add header definitions and helpers#6165jia200x wants to merge 3 commits intoRIOT-OS:masterfrom Inria-Chile:lorawan_headers
Conversation
|
Please prefix the commits properly. |
| le_uint16_t fcnt; /**< frame counter */ | ||
| } lw_hdr_t; | ||
|
|
||
| #include <stdio.h> |
There was a problem hiding this comment.
Includes should all be located at the same place before any code.
| * </a> | ||
| */ | ||
| typedef struct __attribute__((packed)) { | ||
| /** |
| /** | ||
| * @brief Data type to represent a LoRaWAN packet header | ||
| * | ||
| * @details This definition includes MHDR and FHDR in the same structure. The structure of the header is as follows: |
| * | ||
| * @details This definition includes MHDR and FHDR in the same structure. The structure of the header is as follows: | ||
| * | ||
| * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.unparsed} |
There was a problem hiding this comment.
What is this .unparsed supposed to mean?
| * | ||
| * @details the message type are the 3 most significant bytes and the | ||
| * major version are the 2 less significant bytes. There are 3 bytes | ||
| * in the middle reserved for future usage. |
| } lw_hdr_t; | ||
|
|
||
| #include <stdio.h> | ||
| static inline void lw_hdr_set_mtype(lw_hdr_t *hdr, uint8_t mtype) |
There was a problem hiding this comment.
Doxygen is missing for the inline functions.
|
@jia200x ping? Is this still needed for your LoRaWAN integration? |
|
@miri64 yes it is :) |
|
Then please address @OlegHahm's comments. |
|
please fix PR title |
| * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
| * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| * | ||
| * @see <a href="https://www.lora-alliance.org/portals/0/specs/LoRaWAN%20Specification%201R0.pdf"> |
| * @author José Ignacio Alamos <[email protected]> | ||
| */ | ||
|
|
||
| #ifndef LW_HDR_H_ |
| */ | ||
|
|
||
| /** | ||
| * @defgroup net_lw_hdr LoRaWAN header |
There was a problem hiding this comment.
group should be called net_lorawan_hdr to avoid confusion (we now have a lwmac protocol ;) )
|
|
||
| /** | ||
| * @defgroup net_lw_hdr LoRaWAN header | ||
| * @ingroup net_lw |
| le_uint32_t addr; /**< 32 bit LoRaWAN address */ | ||
| uint8_t fctrl; /**< frame control */ | ||
| le_uint16_t fcnt; /**< frame counter */ | ||
| } lw_hdr_t; |
There was a problem hiding this comment.
I would call this lorawan_hdr_t. You see the story, please apply the same in other needed places.
| */ | ||
|
|
||
| /** | ||
| * @{ |
| { | ||
| TESTS_RUN(tests_lw_hdr_tests()); | ||
| } | ||
| /** @} */ |
There was a problem hiding this comment.
Not needed in implementation file.
| * @{ | ||
| * | ||
| * @file | ||
| * @brief Unittests for the ``lw_hdr`` module |
There was a problem hiding this comment.
(minor) use @ref lorawan_hdr
| * | ||
| * @author José Ignacio Alamos <[email protected]> | ||
| */ | ||
| #ifndef TESTS_LW_HDR_H_ |
|
I read it so. So let's do that. |
Hi.
I'm sending this PR with LoRaWAN header definition and implementations (required for LoRaMAC).
Cheers!