Skip to content

netopt: Clarify documentation#8655

Merged
jnohlgard merged 1 commit intoRIOT-OS:masterfrom
jnohlgard:pr/netopt-docs
Mar 29, 2018
Merged

netopt: Clarify documentation#8655
jnohlgard merged 1 commit intoRIOT-OS:masterfrom
jnohlgard:pr/netopt-docs

Conversation

@jnohlgard
Copy link
Copy Markdown
Member

Contribution description

Improve the documentation for netopt_t to always specify data type, and some minor language/editorial changes to match the new format.

Added the word "Netopt" to the page title to make the page easier to find in the Doxygen sidebar modules table of contents.

Issues/PRs references

See #8631 for a related discussion.

@jnohlgard jnohlgard added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Area: network Area: Networking Area: doc Area: Documentation labels Feb 28, 2018
@jnohlgard jnohlgard added this to the Release 2018.04 milestone Feb 28, 2018
@jnohlgard jnohlgard requested a review from miri64 February 28, 2018 07:28
Copy link
Copy Markdown
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

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

Initial (and superficial) review

*/
NETOPT_IS_CHANNEL_CLR,
/**
* @brief (various, see below) link layer address
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.

This can be any byte array. It just has to be long enough for the address type

NETOPT_CHANNEL, /**< get/set channel as uint16_t in host
* byte order */
NETOPT_IS_CHANNEL_CLR, /**< check if channel is clear */
NETOPT_ADDRESS, /**< get/set address in host byte order */
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.

I actually don't think the address is ever returned in host byte order, but always in network byte order, which also would make more sense.

*
* Device type | Type | Meaning
* ------------- | -------- | -----
* IEEE 802.15.4 | uint16_t | device short address
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.

This table could provide the minimum required length of the array by NETDEV_DEVICE_TYPE_….


/**
* @brief get/set long address in host byte order
* @brief (various, see below) long link layer address
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.

Can also be an array.

* Device type | Type | Meaning
* ------------- | ------------ | -----
* IEEE 802.15.4 | @ref eui64_t | device long address (EUI-64)
* Ethernet | FIXME | device MAC address??
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.

Ethernet returns -ENOTSUP ;-)

NETOPT_ENCRYPTION,

/**
* @brief (various, see below) set encryption key
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.

Also array? Also it doesn't really specify a type below.

@miri64
Copy link
Copy Markdown
Member

miri64 commented Mar 7, 2018

@gebart ping?

@jnohlgard
Copy link
Copy Markdown
Member Author

Will address comments tonight.

@jnohlgard
Copy link
Copy Markdown
Member Author

Comments addressed

@jnohlgard jnohlgard added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Mar 8, 2018
@jnohlgard
Copy link
Copy Markdown
Member Author

ping @miri64

* Device type | Length | Meaning
* ------------- | -------- | -----
* IEEE 802.15.4 | 8 | device long address (EUI-64), @ref eui64_t
* Ethernet | -ENOTSUP | not used
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.

Just leave it out. Otherwise you would have to add cc110x, BLE etc. here as well ;-).

/**
* @brief get IPv6 addresses of an interface as array of @ref ipv6_addr_t
* or add an IPv6 address as @ref ipv6_addr_t to an interface
* @brief (@ref ipv6_addr_t) get IPv6 addresses of an interface as array
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.

For get it can be an array of ipv6_addr_t.

* Device type | Length | Meaning
* ------------- | ------ | -----
* IEEE 802.15.4 | 2 | device short address
* Ethernet | 6 | device MAC address
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.

Maybe add the other types of NETDEV_DEVICE_TYPE here as well?

* @brief (uint32_t) reception timeout of a frame
*
* Values are retrieved/passed as uint32_t in host byte order.
* TODO in what time unit?
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.

Use @todo tag?

* @brief (uint32_t) transmission timeout of a frame
*
* Values are retrieved/passed as uint32_t in host byte order.
* TODO in what time unit?
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.

Use @todo tag?

*/
NETOPT_IS_CHANNEL_CLR,
/**
* @brief (byte array, see below) link layer address
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.

somewhere here you should mention that the address is to be in network byte order (see your comment above).


/**
* @brief get/set long address in host byte order
* @brief (byte array, see below) long link layer address
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.

somewhere here you should mention that the address is to be in network byte order (see your comment above).


/**
* @brief Test mode for the radio, e.g. for CE or FCC certification
* @brief (byte array) set encryption key
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.

I'm not sure if this is in host or network byte order, but network byte order makes more sense for me here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Does an encryption key have a byte order, or is it simply regarded as an array of bytes?
e.g. do implementations actually reverse 128 bit AES keys when distributing them or are the algorithm specifications written to treat the keys as byte blobs when implementing?

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.

I honestly don't know, so I guess it is best to keep it unspecified for now.

@jnohlgard
Copy link
Copy Markdown
Member Author

@miri64 ping


/**
* @brief (@ref netopt_enable_t) Phy link status.
* @brief (uint8_t) device type
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.

This is supposed to be uint16_t, at least GNRC expects it to be ;-).

@jnohlgard
Copy link
Copy Markdown
Member Author

@miri64 comments addressed

Copy link
Copy Markdown
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

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

ACK

@miri64
Copy link
Copy Markdown
Member

miri64 commented Mar 27, 2018

(please squash)

@jnohlgard jnohlgard merged commit 59d6f10 into RIOT-OS:master Mar 29, 2018
@jnohlgard jnohlgard deleted the pr/netopt-docs branch March 29, 2018 18:28
@jnohlgard
Copy link
Copy Markdown
Member Author

@miri64 Thanks for the review!

miri64 added a commit to miri64/RIOT that referenced this pull request Apr 6, 2018
Documentation of the option types was clarified in RIOT-OS#8655. I only noticed
after merging RIOT-OS#8884, that `NETOPT_BLE_CTX` was not documented using
that new style. So I deliver the change myself to make it quicker.
jcarrano pushed a commit to jcarrano/RIOT that referenced this pull request May 7, 2018
Documentation of the option types was clarified in RIOT-OS#8655. I only noticed
after merging RIOT-OS#8884, that `NETOPT_BLE_CTX` was not documented using
that new style. So I deliver the change myself to make it quicker.
jcarrano pushed a commit to jcarrano/RIOT that referenced this pull request May 9, 2018
Documentation of the option types was clarified in RIOT-OS#8655. I only noticed
after merging RIOT-OS#8884, that `NETOPT_BLE_CTX` was not documented using
that new style. So I deliver the change myself to make it quicker.
jia200x pushed a commit to jia200x/RIOT that referenced this pull request Jun 11, 2018
Documentation of the option types was clarified in RIOT-OS#8655. I only noticed
after merging RIOT-OS#8884, that `NETOPT_BLE_CTX` was not documented using
that new style. So I deliver the change myself to make it quicker.
panail pushed a commit to panail/RIOT that referenced this pull request Oct 29, 2018
Documentation of the option types was clarified in RIOT-OS#8655. I only noticed
after merging RIOT-OS#8884, that `NETOPT_BLE_CTX` was not documented using
that new style. So I deliver the change myself to make it quicker.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: doc Area: Documentation Area: network Area: Networking CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants