From 674757aa44043476349a8218aca81046206ec9db Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Tue, 12 Jun 2018 09:23:03 -0700 Subject: [PATCH] [posix] skip calling RadioReceiveDone with OT_ERROR_ABORT (#2779) This commit changes the posix platform radio implementation by not invoking the `RadioReceiveDone` callback with error `OT_ERROR_ABORT`. This is added to help remove extra logs when simulating OpenThread in posix mode. --- examples/platforms/posix/radio.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/examples/platforms/posix/radio.c b/examples/platforms/posix/radio.c index 6abfe12c5..3c3bac2ce 100644 --- a/examples/platforms/posix/radio.c +++ b/examples/platforms/posix/radio.c @@ -748,16 +748,18 @@ void radioProcessFrame(otInstance *aInstance) exit: + if (error != OT_ERROR_ABORT) + { #if OPENTHREAD_ENABLE_DIAG - - if (otPlatDiagModeGet()) - { - otPlatDiagRadioReceiveDone(aInstance, error == OT_ERROR_NONE ? &sReceiveFrame : NULL, error); - } - else + if (otPlatDiagModeGet()) + { + otPlatDiagRadioReceiveDone(aInstance, error == OT_ERROR_NONE ? &sReceiveFrame : NULL, error); + } + else #endif - { - otPlatRadioReceiveDone(aInstance, error == OT_ERROR_NONE ? &sReceiveFrame : NULL, error); + { + otPlatRadioReceiveDone(aInstance, error == OT_ERROR_NONE ? &sReceiveFrame : NULL, error); + } } }