diff --git a/src/lib/spinel/radio_spinel_impl.hpp b/src/lib/spinel/radio_spinel_impl.hpp index d11a2e568..e563d00ac 100644 --- a/src/lib/spinel/radio_spinel_impl.hpp +++ b/src/lib/spinel/radio_spinel_impl.hpp @@ -248,7 +248,9 @@ void RadioSpinel::Init(bool aResetRadio, if (aRestoreDatasetFromNcp) { +#if !OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE exitCode = (RestoreDatasetFromNcp() == OT_ERROR_NONE) ? OT_EXIT_SUCCESS : OT_EXIT_FAILURE; +#endif } DieNow(exitCode); @@ -412,6 +414,7 @@ exit: return error; } +#if !OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE template otError RadioSpinel::RestoreDatasetFromNcp(void) { @@ -429,6 +432,7 @@ exit: Instance::Get().template Get().Deinit(); return error; } +#endif template void RadioSpinel::Deinit(void) @@ -585,6 +589,7 @@ exit: LogIfFail("Error processing response", error); } +#if !OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE template otError RadioSpinel::ThreadDatasetHandler(const uint8_t *aBuffer, uint16_t aLength) { @@ -738,6 +743,7 @@ otError RadioSpinel::ThreadDatasetHandler(con exit: return error; } +#endif // #if !OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE template void RadioSpinel::HandleWaitingResponse(uint32_t aCommand, @@ -2268,8 +2274,12 @@ void RadioSpinel::RestoreProperties(void) sizeof(otMacKey))); } - SuccessOrDie(Instance::Get().template Get().ReadNetworkInfo(networkInfo)); - SuccessOrDie(Set(SPINEL_PROP_RCP_MAC_FRAME_COUNTER, SPINEL_DATATYPE_UINT32_S, networkInfo.GetMacFrameCounter())); + if (mInstance != nullptr) + { + SuccessOrDie(static_cast(mInstance)->template Get().ReadNetworkInfo(networkInfo)); + SuccessOrDie( + Set(SPINEL_PROP_RCP_MAC_FRAME_COUNTER, SPINEL_DATATYPE_UINT32_S, networkInfo.GetMacFrameCounter())); + } for (int i = 0; i < mSrcMatchShortEntryCount; ++i) {