Skip to content

gnrc_lorawan: add header definitions and helpers#6165

Closed
jia200x wants to merge 3 commits intoRIOT-OS:masterfrom
Inria-Chile:lorawan_headers
Closed

gnrc_lorawan: add header definitions and helpers#6165
jia200x wants to merge 3 commits intoRIOT-OS:masterfrom
Inria-Chile:lorawan_headers

Conversation

@jia200x
Copy link
Copy Markdown
Member

@jia200x jia200x commented Nov 29, 2016

Hi.

I'm sending this PR with LoRaWAN header definition and implementations (required for LoRaMAC).

Cheers!

@OlegHahm OlegHahm added Area: drivers Area: Device drivers Area: network Area: Networking labels Dec 8, 2016
@OlegHahm
Copy link
Copy Markdown
Member

OlegHahm commented Dec 8, 2016

Please prefix the commits properly.

@OlegHahm OlegHahm self-assigned this Dec 8, 2016
le_uint16_t fcnt; /**< frame counter */
} lw_hdr_t;

#include <stdio.h>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Includes should all be located at the same place before any code.

* </a>
*/
typedef struct __attribute__((packed)) {
/**
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New line missing

/**
* @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:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long.

*
* @details This definition includes MHDR and FHDR in the same structure. The structure of the header is as follows:
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.unparsed}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/bytes/bits I assume

} lw_hdr_t;

#include <stdio.h>
static inline void lw_hdr_set_mtype(lw_hdr_t *hdr, uint8_t mtype)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doxygen is missing for the inline functions.

@miri64
Copy link
Copy Markdown
Member

miri64 commented Jun 20, 2017

@jia200x ping? Is this still needed for your LoRaWAN integration?

@jia200x
Copy link
Copy Markdown
Member Author

jia200x commented Jul 3, 2017

@miri64 yes it is :)

@jia200x jia200x mentioned this pull request Jul 3, 2017
5 tasks
@miri64
Copy link
Copy Markdown
Member

miri64 commented Jul 3, 2017

Then please address @OlegHahm's comments.

@kaspar030
Copy link
Copy Markdown
Contributor

please fix PR title

@jia200x jia200x changed the title LoRaWAN header definitions and helpers gnrc_lorawan: add header definitions and helpers Jul 3, 2017
Copy link
Copy Markdown
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a pass of review here but I'm wondering if it's worth keeping this one since it's already in #6645 and is not very useful like this on its own.

* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* @see <a href="https://www.lora-alliance.org/portals/0/specs/LoRaWAN%20Specification%201R0.pdf">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

link broken

* @author José Ignacio Alamos <[email protected]>
*/

#ifndef LW_HDR_H_
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LORAWAN_HDR_H

*/

/**
* @defgroup net_lw_hdr LoRaWAN header
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same, rename parent group

le_uint32_t addr; /**< 32 bit LoRaWAN address */
uint8_t fctrl; /**< frame control */
le_uint16_t fcnt; /**< frame counter */
} lw_hdr_t;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would call this lorawan_hdr_t. You see the story, please apply the same in other needed places.

*/

/**
* @{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing doxygen commands ?

{
TESTS_RUN(tests_lw_hdr_tests());
}
/** @} */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed in implementation file.

* @{
*
* @file
* @brief Unittests for the ``lw_hdr`` module
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(minor) use @ref lorawan_hdr

*
* @author José Ignacio Alamos <[email protected]>
*/
#ifndef TESTS_LW_HDR_H_
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TESTS_LORAWAN_HDR ?

@jia200x
Copy link
Copy Markdown
Member Author

jia200x commented Aug 10, 2017

Hi @aabadie,

I tend to agree with what you said and drop this one to continue with #6645. Let's do it if you think it's better.

@kYc0o kYc0o mentioned this pull request Nov 6, 2017
23 tasks
@PeterKietzmann
Copy link
Copy Markdown
Member

I tend to agree with what you said and drop this one to continue with #6645

@jia200x does this mean we can close this PR? If so, please do!

@miri64
Copy link
Copy Markdown
Member

miri64 commented Nov 16, 2017

I read it so. So let's do that.

@miri64 miri64 closed this Nov 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: drivers Area: Device drivers Area: network Area: Networking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants