Skip to content

Commit

Permalink
Merge pull request #5297 from aeneby/netopt_ack_req
Browse files Browse the repository at this point in the history
Implement NETOPT_ACK_REQ configuration option.
  • Loading branch information
PeterKietzmann committed May 31, 2016
2 parents 8cf11d3 + 63a87fb commit e12830c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions drivers/netdev2_ieee802154/netdev2_ieee802154.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ int netdev2_ieee802154_get(netdev2_ieee802154_t *dev, netopt_t opt, void *value,
*((uint16_t *)value) = (uint16_t)dev->chan;
res = sizeof(dev->chan);
break;
case NETOPT_AUTOACK:
case NETOPT_ACK_REQ:
assert(max_len == sizeof(netopt_enable_t));
if (dev->flags & NETDEV2_IEEE802154_ACK_REQ) {
*((netopt_enable_t *)value) = NETOPT_ENABLE;
Expand Down Expand Up @@ -183,7 +183,7 @@ int netdev2_ieee802154_set(netdev2_ieee802154_t *dev, netopt_t opt, void *value,
dev->pan = *((uint16_t *)value);
res = sizeof(dev->pan);
break;
case NETOPT_AUTOACK:
case NETOPT_ACK_REQ:
if ((*(bool *)value)) {
dev->flags |= NETDEV2_IEEE802154_ACK_REQ;
}
Expand Down
2 changes: 2 additions & 0 deletions sys/include/net/netopt.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ typedef enum {
* the current state */
NETOPT_AUTOACK, /**< en/disable link layer auto ACKs or read
* the current state */
NETOPT_ACK_REQ, /**< en/disable acknowledgement requests or
* read the current state */
NETOPT_RETRANS, /**< get/set the maximum number of
* retransmissions. */
NETOPT_PROTO, /**< get/set the protocol for the layer
Expand Down
1 change: 1 addition & 0 deletions sys/net/crosslayer/netopt/netopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ static const char *_netopt_strmap[] = {
[NETOPT_PRELOADING] = "NETOPT_PRELOADING",
[NETOPT_PROMISCUOUSMODE] = "NETOPT_PROMISCUOUSMODE",
[NETOPT_AUTOACK] = "NETOPT_AUTOACK",
[NETOPT_ACK_REQ] = "NETOPT_ACK_REQ",
[NETOPT_RETRANS] = "NETOPT_RETRANS",
[NETOPT_PROTO] = "NETOPT_PROTO",
[NETOPT_STATE] = "NETOPT_STATE",
Expand Down
2 changes: 1 addition & 1 deletion sys/net/link_layer/ieee802154/ieee802154.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ size_t ieee802154_set_frame_hdr(uint8_t *buf, const uint8_t *src, size_t src_len

/* fill in destination address */
if (bcast) {
/* no AUTOACK for broadcast */
/* no ACK_REQ for broadcast */
buf[0] &= ~IEEE802154_FCF_ACK_REQ;
buf[1] &= ~IEEE802154_FCF_DST_ADDR_MASK;
buf[1] |= IEEE802154_FCF_DST_ADDR_SHORT;
Expand Down

0 comments on commit e12830c

Please sign in to comment.