Skip to content

Commit

Permalink
net: openthread: cleanup diag commands
Browse files Browse the repository at this point in the history
After openthread/openthread#11055,
platform is not required to check diagnostics mode while
processing commands.

Signed-off-by: Maciej Baczmanski <[email protected]>
  • Loading branch information
maciejbaczmanski committed Jan 10, 2025
1 parent bc6eded commit 5d2f9c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
16 changes: 4 additions & 12 deletions modules/openthread/platform/diag.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5d2f9c7

Please sign in to comment.