From 5d2f9c70426cbd414d035a9e3b023997a576fa40 Mon Sep 17 00:00:00 2001 From: Maciej Baczmanski Date: Fri, 10 Jan 2025 08:47:20 +0100 Subject: [PATCH] net: openthread: cleanup diag commands After https://github.com/openthread/openthread/pull/11055, platform is not required to check diagnostics mode while processing commands. Signed-off-by: Maciej Baczmanski --- modules/openthread/platform/diag.c | 16 ++++------------ west.yml | 2 +- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/modules/openthread/platform/diag.c b/modules/openthread/platform/diag.c index 23f829858121057..79f4e38984af974 100644 --- a/modules/openthread/platform/diag.c +++ b/modules/openthread/platform/diag.c @@ -125,8 +125,8 @@ void otPlatDiagRadioReceived(otInstance *aInstance, #if defined(CONFIG_IEEE802154_CARRIER_FUNCTIONS) otError otPlatDiagRadioTransmitCarrier(otInstance *aInstance, bool aEnable) { - if (!otPlatDiagModeGet() || (sTransmitMode != DIAG_TRANSMIT_MODE_IDLE && - sTransmitMode != DIAG_TRANSMIT_MODE_CARRIER)) { + if (sTransmitMode != DIAG_TRANSMIT_MODE_IDLE && + sTransmitMode != DIAG_TRANSMIT_MODE_CARRIER) { return OT_ERROR_INVALID_STATE; } @@ -175,10 +175,6 @@ static otError gpio_get_spec(uint32_t gpio_idx, const struct gpio_dt_spec **spec *spec = &gpio_spec[gpio_idx]; - if (!otPlatDiagModeGet()) { - return OT_ERROR_INVALID_STATE; - } - if (!gpio_is_ready_dt(*spec)) { return OT_ERROR_INVALID_ARGS; } @@ -326,8 +322,8 @@ static otError startModCarrier(otInstance *aInstance, uint8_t aArgsLength, char return OT_ERROR_INVALID_ARGS; } - if (!otPlatDiagModeGet() || (sTransmitMode != DIAG_TRANSMIT_MODE_IDLE && - sTransmitMode != DIAG_TRANSMIT_MODE_MODCARRIER)) { + if (sTransmitMode != DIAG_TRANSMIT_MODE_IDLE && + sTransmitMode != DIAG_TRANSMIT_MODE_MODCARRIER) { return OT_ERROR_INVALID_STATE; } @@ -396,10 +392,6 @@ static otError processTransmit(otInstance *aInstance, uint8_t aArgsLength, char long value; uint32_t now; - if (!otPlatDiagModeGet()) { - return OT_ERROR_INVALID_STATE; - } - if (aArgsLength == 0) { diag_output("transmit will send %" PRId32 " diagnostic messages with %" PRIu32 " ms interval\r\n", diff --git a/west.yml b/west.yml index 510d671cc3fc39f..6aa1237f4a02fd3 100644 --- a/west.yml +++ b/west.yml @@ -324,7 +324,7 @@ manifest: revision: 52bb1783521c62c019451cee9b05b8eda9d7425f path: modules/lib/open-amp - name: openthread - revision: 2aeb8b833ba760ec29d5f340dd1ce7bcb61c5d56 + revision: pull/186/head path: modules/lib/openthread - name: percepio path: modules/debug/percepio