netopt: Clarify documentation#8655
Conversation
miri64
left a comment
There was a problem hiding this comment.
Initial (and superficial) review
sys/include/net/netopt.h
Outdated
| */ | ||
| NETOPT_IS_CHANNEL_CLR, | ||
| /** | ||
| * @brief (various, see below) link layer address |
There was a problem hiding this comment.
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 */ |
There was a problem hiding this comment.
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.
sys/include/net/netopt.h
Outdated
| * | ||
| * Device type | Type | Meaning | ||
| * ------------- | -------- | ----- | ||
| * IEEE 802.15.4 | uint16_t | device short address |
There was a problem hiding this comment.
This table could provide the minimum required length of the array by NETDEV_DEVICE_TYPE_….
sys/include/net/netopt.h
Outdated
|
|
||
| /** | ||
| * @brief get/set long address in host byte order | ||
| * @brief (various, see below) long link layer address |
sys/include/net/netopt.h
Outdated
| * Device type | Type | Meaning | ||
| * ------------- | ------------ | ----- | ||
| * IEEE 802.15.4 | @ref eui64_t | device long address (EUI-64) | ||
| * Ethernet | FIXME | device MAC address?? |
sys/include/net/netopt.h
Outdated
| NETOPT_ENCRYPTION, | ||
|
|
||
| /** | ||
| * @brief (various, see below) set encryption key |
There was a problem hiding this comment.
Also array? Also it doesn't really specify a type below.
|
@gebart ping? |
|
Will address comments tonight. |
bcddb9c to
0cd75a4
Compare
|
Comments addressed |
|
ping @miri64 |
sys/include/net/netopt.h
Outdated
| * Device type | Length | Meaning | ||
| * ------------- | -------- | ----- | ||
| * IEEE 802.15.4 | 8 | device long address (EUI-64), @ref eui64_t | ||
| * Ethernet | -ENOTSUP | not used |
There was a problem hiding this comment.
Just leave it out. Otherwise you would have to add cc110x, BLE etc. here as well ;-).
sys/include/net/netopt.h
Outdated
| /** | ||
| * @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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Maybe add the other types of NETDEV_DEVICE_TYPE here as well?
sys/include/net/netopt.h
Outdated
| * @brief (uint32_t) reception timeout of a frame | ||
| * | ||
| * Values are retrieved/passed as uint32_t in host byte order. | ||
| * TODO in what time unit? |
sys/include/net/netopt.h
Outdated
| * @brief (uint32_t) transmission timeout of a frame | ||
| * | ||
| * Values are retrieved/passed as uint32_t in host byte order. | ||
| * TODO in what time unit? |
sys/include/net/netopt.h
Outdated
| */ | ||
| NETOPT_IS_CHANNEL_CLR, | ||
| /** | ||
| * @brief (byte array, see below) link layer address |
There was a problem hiding this comment.
somewhere here you should mention that the address is to be in network byte order (see your comment above).
sys/include/net/netopt.h
Outdated
|
|
||
| /** | ||
| * @brief get/set long address in host byte order | ||
| * @brief (byte array, see below) long link layer address |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
I'm not sure if this is in host or network byte order, but network byte order makes more sense for me here.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
I honestly don't know, so I guess it is best to keep it unspecified for now.
0cd75a4 to
af37d86
Compare
|
@miri64 ping |
af37d86 to
0fb1c5f
Compare
sys/include/net/netopt.h
Outdated
|
|
||
| /** | ||
| * @brief (@ref netopt_enable_t) Phy link status. | ||
| * @brief (uint8_t) device type |
There was a problem hiding this comment.
This is supposed to be uint16_t, at least GNRC expects it to be ;-).
|
@miri64 comments addressed |
|
(please squash) |
9bd73f4 to
cf8b370
Compare
|
@miri64 Thanks for the review! |
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.
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.
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.
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.
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.
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.