mirror of
https://github.com/espressif/openthread.git
synced 2026-10-01 13:27:42 +00:00
[spinel] networkInfo may not exist when recovering from RCP failure (#9327)
Current implementation of RestoreProperties() assumes there's always a networkInfo structure stored in the settings. But, it's possible the RCP device needs to be recovered before this structure is populated. Signed-off-by: Axel Le Bourhis <[email protected]>
This commit is contained in:
@@ -2143,9 +2143,11 @@ template <typename InterfaceType> void RadioSpinel<InterfaceType>::RestoreProper
|
|||||||
|
|
||||||
if (mInstance != nullptr)
|
if (mInstance != nullptr)
|
||||||
{
|
{
|
||||||
SuccessOrDie(static_cast<Instance *>(mInstance)->template Get<Settings>().Read(networkInfo));
|
if (static_cast<Instance *>(mInstance)->template Get<Settings>().Read(networkInfo) == OT_ERROR_NONE)
|
||||||
SuccessOrDie(
|
{
|
||||||
Set(SPINEL_PROP_RCP_MAC_FRAME_COUNTER, SPINEL_DATATYPE_UINT32_S, networkInfo.GetMacFrameCounter()));
|
SuccessOrDie(
|
||||||
|
Set(SPINEL_PROP_RCP_MAC_FRAME_COUNTER, SPINEL_DATATYPE_UINT32_S, networkInfo.GetMacFrameCounter()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < mSrcMatchShortEntryCount; ++i)
|
for (int i = 0; i < mSrcMatchShortEntryCount; ++i)
|
||||||
|
|||||||
@@ -54,17 +54,6 @@ puts "RCP PID: $rcp_pid"
|
|||||||
try {
|
try {
|
||||||
puts "Before enabling"
|
puts "Before enabling"
|
||||||
|
|
||||||
spawn_node 1 "rcp" "spinel+hdlc_uart://$host_pty"
|
|
||||||
|
|
||||||
exec kill $rcp_pid
|
|
||||||
puts "Killed $rcp_pid"
|
|
||||||
sleep 1
|
|
||||||
set rcp_pid [exec $::env(OT_SIMULATION_APPS)/ncp/ot-rcp 1 < $radio_pty > $radio_pty &]
|
|
||||||
puts "RCP PID: $rcp_pid"
|
|
||||||
|
|
||||||
expect eof
|
|
||||||
|
|
||||||
|
|
||||||
puts "Queued parent-to-child packets, as parent"
|
puts "Queued parent-to-child packets, as parent"
|
||||||
|
|
||||||
spawn_node 1 "rcp" "spinel+hdlc_uart://$host_pty"
|
spawn_node 1 "rcp" "spinel+hdlc_uart://$host_pty"
|
||||||
|
|||||||
Reference in New Issue
Block a user