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:
commit
ab5771bbf8
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user