From ff133577d0326c8283fcc0d8f3159cbfc8fcf23f Mon Sep 17 00:00:00 2001 From: Philip Levis Date: Tue, 27 Feb 2018 16:51:06 -0800 Subject: [PATCH] Fix bug in which ENOACK was not correctly being returned. --- userland/libtock/ieee802154.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/userland/libtock/ieee802154.c b/userland/libtock/ieee802154.c index c1844526c0..042a083109 100644 --- a/userland/libtock/ieee802154.c +++ b/userland/libtock/ieee802154.c @@ -327,7 +327,14 @@ int ieee802154_send(unsigned short addr, err = command(RADIO_DRIVER, COMMAND_SEND, (unsigned int) addr, 0); if (err < 0) return err; yield_for(&tx_done); - return tx_result; + if (tx_result != TOCK_SUCCESS) { + return tx_result; + } else if (tx_acked == 0) { + return TOCK_ENOACK; + } else { + return TOCK_SUCCESS; + } + } // Internal callback for receive