mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-24 05:53:49 +01:00
Merge pull request #21796 from Morigawa/pr/netdev_ieee802154_submac_fix_bytestx
drivers/netdev_ieee802154_submac: fix bytes_tx
This commit is contained in:
commit
12b719a0bc
@ -2,4 +2,5 @@ USEMODULE += netdev_ieee802154
|
||||
USEMODULE += netdev_new_api
|
||||
USEMODULE += ieee802154
|
||||
USEMODULE += ieee802154_submac
|
||||
USEMODULE += iolist
|
||||
USEMODULE += ztimer_usec
|
||||
|
||||
@ -196,7 +196,14 @@ static int _send(netdev_t *netdev, const iolist_t *pkt)
|
||||
* inside the TX Done callback */
|
||||
netdev_submac->ev = NETDEV_EVENT_TX_STARTED;
|
||||
}
|
||||
netdev_submac->bytes_tx = res;
|
||||
if (res == 0) {
|
||||
uint8_t len = iolist_size(pkt);
|
||||
if (len > 0) {
|
||||
len += IEEE802154_FCS_LEN;
|
||||
}
|
||||
netdev_submac->bytes_tx = len;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@ -189,7 +189,7 @@ void send_pkt(otInstance *aInstance, netdev_t *dev, netdev_event_t event)
|
||||
} else if (res == -EHOSTUNREACH) {
|
||||
otPlatRadioTxDone(aInstance, &sTransmitFrame, NULL, OT_ERROR_NO_ACK);
|
||||
} else {
|
||||
otPlatRadioTxDone(aInstance, &sTransmitFrame, NULL, OT_ERROR_FAILED);
|
||||
otPlatRadioTxDone(aInstance, &sTransmitFrame, NULL, OT_ERROR_ABORT);
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user