[spinel] fix errors in RCP recovery (#5965)

If mError is set to error state before entering the RCP recovery, this
error will be recognized as an error in the recovery process, and
cause it to die, while there is actually no error.

This fixes it by clearing mError when starting the recovery process.
This commit is contained in:
Moandor
2020-12-16 22:08:59 -08:00
committed by GitHub
parent 03cd73ad1c
commit d4c1c5d725
2 changed files with 14 additions and 0 deletions
@@ -74,6 +74,7 @@ try {
expect "ipaddr mleid"
expect -re {(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4})}
set addr_2 $expect_out(1,string)
expect "Done"
send "udp open\n"
expect "Done"
send "udp bind :: 11003\n"
@@ -88,6 +89,7 @@ try {
expect "ipaddr mleid"
expect -re {(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4})}
set addr_1 $expect_out(1,string)
expect "Done"
send "udp open\n"
expect "Done"
send "udp bind :: 11004\n"
@@ -107,6 +109,8 @@ try {
set rcp_pid [exec $::env(OT_SIMULATION_APPS)/ncp/ot-rcp 1 < $radio_pty > $radio_pty &]
puts "RCP PID: $rcp_pid"
sleep 1
switch_node 2
send "pollperiod 1000\n"
expect "Done"
@@ -134,6 +138,7 @@ try {
expect "ipaddr mleid"
expect -re {(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4})}
set addr_2 $expect_out(1,string)
expect "Done"
send "udp open\n"
expect "Done"
send "udp bind :: 11003\n"
@@ -148,6 +153,7 @@ try {
expect "ipaddr mleid"
expect -re {(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4})}
set addr_1 $expect_out(1,string)
expect "Done"
send "udp open\n"
expect "Done"
send "udp bind :: 11004\n"
@@ -196,6 +202,7 @@ try {
expect "ipaddr mleid"
expect -re {(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4})}
set addr(1) $expect_out(1,string)
expect "Done"
send "udp open\n"
expect "Done"
send "udp bind :: 11004\n"
@@ -242,6 +249,8 @@ try {
set rcp_pid [exec $::env(OT_SIMULATION_APPS)/ncp/ot-rcp 1 < $radio_pty > $radio_pty &]
puts "RCP PID: $rcp_pid"
sleep 1
for {set i 7} {$i <= 9} {incr i} {
switch_node $i
send "pollperiod 1000\n"
@@ -264,6 +273,8 @@ try {
set rcp_pid [exec $::env(OT_SIMULATION_APPS)/ncp/ot-rcp 1 < $radio_pty > $radio_pty &]
puts "RCP PID: $rcp_pid"
sleep 1
switch_node 5
send "pollperiod 1000\n"
expect "Done"
@@ -294,6 +305,8 @@ try {
set rcp_pid [exec $::env(OT_SIMULATION_APPS)/ncp/ot-rcp 1 < $radio_pty > $radio_pty &]
puts "RCP PID: $rcp_pid"
sleep 1
for {set i 11} {$i <= 26} {incr i} {
expect -re "\\| +$i \\| +-?\\d+ \\|"
}