Skip to content

Commit

Permalink
change radio enable and disable
Browse files Browse the repository at this point in the history
  • Loading branch information
jia200x committed May 29, 2017
1 parent 5cf3425 commit 834a1bb
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions pkg/openthread/contrib/platform_radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,17 +217,11 @@ ThreadError otPlatRadioEnable(otInstance *aInstance)
DEBUG("openthread: otPlatRadioEnable\n");
(void) aInstance;

ThreadError error;

if (sDisabled) {
sDisabled = false;
error = kThreadError_None;
}
else {
error = kThreadError_InvalidState;
_set_idle();
}

return error;
return kThreadError_None;
}

/* OpenThread will call this for disabling the radio */
Expand All @@ -236,17 +230,12 @@ ThreadError otPlatRadioDisable(otInstance *aInstance)
DEBUG("openthread: otPlatRadioDisable\n");
(void) aInstance;

ThreadError error;

if (!sDisabled) {
sDisabled = true;
error = kThreadError_None;
}
else {
error = kThreadError_InvalidState;
_set_sleep();
}

return error;
return kThreadError_None;
}

bool otPlatRadioIsEnabled(otInstance *aInstance)
Expand Down

0 comments on commit 834a1bb

Please sign in to comment.