[spinel] print error on RCP reset before dying (#5784)

This commit makes ot-daemon print the RCP reset cause before exit, in
case the RCP resets unexpectedly.
This commit is contained in:
Diego Ismirlian
2020-11-09 20:28:22 -08:00
committed by GitHub
parent aeb46baa14
commit 5c2ad91cff
+6 -2
View File
@@ -770,8 +770,12 @@ void RadioSpinel<InterfaceType, ProcessContextType>::HandleValueIs(spinel_prop_k
if (status >= SPINEL_STATUS_RESET__BEGIN && status <= SPINEL_STATUS_RESET__END)
{
// If RCP crashes/resets while radio was enabled, posix app exits.
VerifyOrDie(!IsEnabled(), OT_EXIT_RADIO_SPINEL_RESET);
if (IsEnabled())
{
// If RCP crashes/resets while radio was enabled, posix app exits.
otLogCritPlat("Unexpected RCP reset: %s", spinel_status_to_cstr(status));
DieNow(OT_EXIT_RADIO_SPINEL_RESET);
}
otLogInfoPlat("RCP reset: %s", spinel_status_to_cstr(status));
mIsReady = true;