Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions modules/openthread/platform/diag.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,25 @@
return OT_ERROR_NOT_IMPLEMENTED;
}

void otPlatDiagModeSet(bool aMode)
static void log_error_returned(otError aError, const char * aName)

Check failure on line 95 in modules/openthread/platform/diag.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

POINTER_LOCATION

modules/openthread/platform/diag.c:95 "foo * bar" should be "foo *bar"
{
otError error;
if (aError != OT_ERROR_NONE) {
otPlatLog(OT_LOG_LEVEL_WARN, OT_LOG_REGION_PLATFORM,
"%s failed (%d)", aName, aError);
}

Check failure on line 100 in modules/openthread/platform/diag.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

TRAILING_WHITESPACE

modules/openthread/platform/diag.c:100 trailing whitespace
}

Check notice on line 101 in modules/openthread/platform/diag.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

modules/openthread/platform/diag.c:101 -static void log_error_returned(otError aError, const char * aName) +static void log_error_returned(otError aError, const char *aName) { if (aError != OT_ERROR_NONE) { - otPlatLog(OT_LOG_LEVEL_WARN, OT_LOG_REGION_PLATFORM, - "%s failed (%d)", aName, aError); - } + otPlatLog(OT_LOG_LEVEL_WARN, OT_LOG_REGION_PLATFORM, "%s failed (%d)", aName, + aError); + }

void otPlatDiagModeSet(bool aMode)
{
sDiagMode = aMode;

if (!sDiagMode) {
error = otPlatRadioSleep(NULL);
if (error != OT_ERROR_NONE) {
otPlatLog(OT_LOG_LEVEL_WARN, OT_LOG_REGION_PLATFORM,
"%s failed (%d)", "otPlatRadioSleep", error);
if(OT_RADIO_STATE_TRANSMIT == otPlatRadioGetState(NULL)) {

Check failure on line 108 in modules/openthread/platform/diag.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

SPACING

modules/openthread/platform/diag.c:108 space required before the open parenthesis '('
log_error_returned(otPlatRadioReceive(NULL, sChannel),

Check failure on line 109 in modules/openthread/platform/diag.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

TRAILING_WHITESPACE

modules/openthread/platform/diag.c:109 trailing whitespace
"otPlatRadioReceive");
}

Check notice on line 111 in modules/openthread/platform/diag.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

modules/openthread/platform/diag.c:111 - if(OT_RADIO_STATE_TRANSMIT == otPlatRadioGetState(NULL)) { - log_error_returned(otPlatRadioReceive(NULL, sChannel), - "otPlatRadioReceive"); + if (OT_RADIO_STATE_TRANSMIT == otPlatRadioGetState(NULL)) { + log_error_returned(otPlatRadioReceive(NULL, sChannel), + "otPlatRadioReceive");

log_error_returned(otPlatRadioSleep(NULL), "otPlatRadioSleep");
}
}

Expand Down Expand Up @@ -355,7 +362,6 @@
void otPlatDiagAlarmCallback(otInstance *aInstance)
{
uint32_t now;
otError error;
otRadioFrame *txPacket;
const uint16_t diag_packet_len = 30;

Expand All @@ -381,12 +387,9 @@
txPacket->mPsdu[i] = i;
}

error = otPlatRadioTransmit(aInstance, txPacket);
if (error != OT_ERROR_NONE) {
otPlatLog(OT_LOG_LEVEL_WARN, OT_LOG_REGION_PLATFORM,
"%s failed (%d)", "otPlatRadioTransmit", error);
}
log_error_returned(otPlatRadioTransmit(aInstance, txPacket),

Check failure on line 390 in modules/openthread/platform/diag.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

TRAILING_WHITESPACE

modules/openthread/platform/diag.c:390 trailing whitespace
"otPlatRadioTransmit");

Check warning on line 391 in modules/openthread/platform/diag.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

SPACE_BEFORE_TAB

modules/openthread/platform/diag.c:391 please, no space before tabs

Check failure on line 391 in modules/openthread/platform/diag.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

CODE_INDENT

modules/openthread/platform/diag.c:391 code indent should use tabs where possible

Check notice on line 392 in modules/openthread/platform/diag.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

modules/openthread/platform/diag.c:392 - log_error_returned(otPlatRadioTransmit(aInstance, txPacket), - "otPlatRadioTransmit"); + log_error_returned(otPlatRadioTransmit(aInstance, txPacket), + "otPlatRadioTransmit");
if (sTxCount != -1) {
sTxCount--;
}
Expand Down Expand Up @@ -421,10 +424,7 @@
diag_output("diagnostic message transmission is stopped\r\n");
sTransmitMode = DIAG_TRANSMIT_MODE_IDLE;
error = otPlatRadioReceive(aInstance, sChannel);
if (error != OT_ERROR_NONE) {
otPlatLog(OT_LOG_LEVEL_WARN, OT_LOG_REGION_PLATFORM,
"%s failed (%d)", "otPlatRadioReceive", error);
}
log_error_returned(error, "otPlatRadioReceive");
} else if (strcmp(aArgs[0], "start") == 0) {
if (sTransmitMode != DIAG_TRANSMIT_MODE_IDLE) {
return OT_ERROR_INVALID_STATE;
Expand Down
5 changes: 5 additions & 0 deletions modules/openthread/platform/radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,11 @@
radio_api->start(radio_dev);
sState = OT_RADIO_STATE_RECEIVE;

if(is_pending_event_set(PENDING_EVENT_TX_DONE))

Check warning on line 812 in modules/openthread/platform/radio.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

BRACES

modules/openthread/platform/radio.c:812 braces {} are required around if/while/for/else

Check failure on line 812 in modules/openthread/platform/radio.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

SPACING

modules/openthread/platform/radio.c:812 space required before the open parenthesis '('

Check failure on line 812 in modules/openthread/platform/radio.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

OPEN_BRACE

modules/openthread/platform/radio.c:812 that open brace { should be on the previous line
{
reset_pending_event(PENDING_EVENT_TX_DONE);

Check notice on line 814 in modules/openthread/platform/radio.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

modules/openthread/platform/radio.c:814 - if(is_pending_event_set(PENDING_EVENT_TX_DONE)) - { + if (is_pending_event_set(PENDING_EVENT_TX_DONE)) {
}

return OT_ERROR_NONE;
}

Expand Down
Loading