[posix-app] always reset radio when init (#3149)

This commit is contained in:
Yakun Xu
2018-10-12 13:19:08 -07:00
committed by Jonathan Hui
parent d64b889f52
commit 98457ea65e
+1 -1
View File
@@ -523,7 +523,6 @@ void RadioSpinel::Init(const char *aRadioFile, const char *aRadioConfig)
{
mSockFd = OpenFile(aRadioFile, aRadioConfig);
VerifyOrExit(mSockFd != -1, error = OT_ERROR_INVALID_ARGS);
SuccessOrExit(error = SendReset());
}
#if OPENTHREAD_CONFIG_POSIX_APP_ENABLE_PTY_DEVICE
else if (S_ISREG(st.st_mode))
@@ -533,6 +532,7 @@ void RadioSpinel::Init(const char *aRadioFile, const char *aRadioConfig)
}
#endif // OPENTHREAD_CONFIG_POSIX_APP_ENABLE_PTY_DEVICE
SuccessOrExit(error = SendReset());
SuccessOrExit(error = WaitResponse());
VerifyOrExit(mIsReady, error = OT_ERROR_FAILED);