1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #9587 from bergzand/pr/kw2xrf/fix_ack_req

kw2xrf: Fix ack flag handling
This commit is contained in:
Peter Kietzmann 2018-07-17 18:43:26 +02:00 committed by GitHub
commit ab5771bbf8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -103,7 +103,7 @@ static size_t kw2xrf_tx_load(uint8_t *pkt_buf, uint8_t *buf, size_t len, size_t
static void kw2xrf_tx_exec(kw2xrf_t *dev)
{
if ((dev->netdev.flags & KW2XRF_OPT_AUTOACK) &&
if ((dev->netdev.flags & KW2XRF_OPT_ACK_REQ) &&
(_send_last_fcf & IEEE802154_FCF_ACK_REQ)) {
kw2xrf_set_sequence(dev, XCVSEQ_TX_RX);
}
@ -275,6 +275,16 @@ int _get(netdev_t *netdev, netopt_t opt, void *value, size_t len)
*((netopt_state_t *)value) = _get_state(dev);
return sizeof(netopt_state_t);
case NETOPT_AUTOACK:
if (dev->netdev.flags & KW2XRF_OPT_AUTOACK) {
*((netopt_enable_t *)value) = NETOPT_ENABLE;
}
else {
*((netopt_enable_t *)value) = NETOPT_DISABLE;
}
return sizeof(netopt_enable_t);
case NETOPT_PRELOADING:
if (dev->netdev.flags & KW2XRF_OPT_PRELOADING) {
*((netopt_enable_t *)value) = NETOPT_ENABLE;
@ -452,6 +462,7 @@ static int _set(netdev_t *netdev, netopt_t opt, const void *value, size_t len)
/* Set up HW generated automatic ACK after Receive */
kw2xrf_set_option(dev, KW2XRF_OPT_AUTOACK,
((bool *)value)[0]);
res = sizeof(netopt_enable_t);
break;
case NETOPT_ACK_REQ: