From 0f4531b22fbc2dc45921d775a09ba52592c62b91 Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Fri, 20 May 2022 13:02:37 -0700 Subject: [PATCH] [data-poll-sender] return `kErrorNone` when Data Request is already enqueued (#7725) There are no use cases where `kErrorAlready` is useful. --- include/openthread/instance.h | 2 +- include/openthread/link.h | 1 - src/core/mac/data_poll_sender.cpp | 5 ----- src/core/mac/mac.cpp | 2 +- src/core/mac/mac.hpp | 1 - 5 files changed, 2 insertions(+), 9 deletions(-) diff --git a/include/openthread/instance.h b/include/openthread/instance.h index 5bf972369..d11583e36 100644 --- a/include/openthread/instance.h +++ b/include/openthread/instance.h @@ -53,7 +53,7 @@ extern "C" { * @note This number versions both OpenThread platform and user APIs. * */ -#define OPENTHREAD_API_VERSION (209) +#define OPENTHREAD_API_VERSION (210) /** * @addtogroup api-instance diff --git a/include/openthread/link.h b/include/openthread/link.h index 4be9a79a7..7c77e964d 100644 --- a/include/openthread/link.h +++ b/include/openthread/link.h @@ -486,7 +486,6 @@ bool otLinkIsEnergyScanInProgress(otInstance *aInstance); * @param[in] aInstance A pointer to an OpenThread instance. * * @retval OT_ERROR_NONE Successfully enqueued an IEEE 802.15.4 Data Request message. - * @retval OT_ERROR_ALREADY An IEEE 802.15.4 Data Request message is already enqueued. * @retval OT_ERROR_INVALID_STATE Device is not in rx-off-when-idle mode. * @retval OT_ERROR_NO_BUFS Insufficient message buffers available. * diff --git a/src/core/mac/data_poll_sender.cpp b/src/core/mac/data_poll_sender.cpp index ab1ad0db6..2c5b0899f 100644 --- a/src/core/mac/data_poll_sender.cpp +++ b/src/core/mac/data_poll_sender.cpp @@ -123,11 +123,6 @@ exit: StopPolling(); break; - case kErrorAlready: - LogDebg("Data poll tx requested when a previous data request still in send queue."); - ScheduleNextPoll(kUsePreviousPollPeriod); - break; - default: LogWarn("Unexpected error %s requesting data poll", ErrorToString(error)); ScheduleNextPoll(kRecalculatePollPeriod); diff --git a/src/core/mac/mac.cpp b/src/core/mac/mac.cpp index 7e2f6503c..faaea8094 100644 --- a/src/core/mac/mac.cpp +++ b/src/core/mac/mac.cpp @@ -482,7 +482,7 @@ Error Mac::RequestDataPollTransmission(void) Error error = kErrorNone; VerifyOrExit(IsEnabled(), error = kErrorInvalidState); - VerifyOrExit(!IsActiveOrPending(kOperationTransmitPoll), error = kErrorAlready); + VerifyOrExit(!IsActiveOrPending(kOperationTransmitPoll)); // We ensure data frame and data poll tx requests are handled in the // order they are requested. So if we have a pending direct data frame diff --git a/src/core/mac/mac.hpp b/src/core/mac/mac.hpp index a5929a6d1..940a458bc 100644 --- a/src/core/mac/mac.hpp +++ b/src/core/mac/mac.hpp @@ -228,7 +228,6 @@ public: * This method requests transmission of a data poll (MAC Data Request) frame. * * @retval kErrorNone Data poll transmission request is scheduled successfully. - * @retval kErrorAlready MAC is busy sending earlier poll transmission request. * @retval kErrorInvalidState The MAC layer is not enabled. * */