mirror of
https://github.com/espressif/openthread.git
synced 2026-08-06 10:47:46 +00:00
[diag] count the number of packets that are sent succeed and failed (#11108)
When using the `diag frame -c xxxx` command to enable the CSMA-CA when transmitting the frame, the command `diag send` won't output any message the CCA failure happens. It is difficult for users to know whether the CSMA-CA is actually effective via diag commands. This commit counts the number of packets that are sent succeed and failed, outputs the transmision failure reason and do not re-transmit the frame after it fails to send.
This commit is contained in:
@@ -68,7 +68,10 @@ sleep 2
|
||||
|
||||
send "diag stats\n"
|
||||
expect "received packets: 0"
|
||||
expect "sent packets: 10"
|
||||
expect "sent success packets: 10"
|
||||
expect "sent error cca packets: 0"
|
||||
expect "sent error abort packets: 0"
|
||||
expect "sent error others packets: 0"
|
||||
expect "first received packet: rssi=0, lqi=0"
|
||||
expect "last received packet: rssi=0, lqi=0"
|
||||
expect_line "Done"
|
||||
@@ -77,7 +80,10 @@ switch_node 1
|
||||
|
||||
send "diag stats\n"
|
||||
expect "received packets: 10"
|
||||
expect "sent packets: 0"
|
||||
expect "sent success packets: 0"
|
||||
expect "sent error cca packets: 0"
|
||||
expect "sent error abort packets: 0"
|
||||
expect "sent error others packets: 0"
|
||||
expect "first received packet: rssi=-20, lqi=0"
|
||||
expect "last received packet: rssi=-20, lqi=0"
|
||||
expect_line "Done"
|
||||
@@ -100,7 +106,10 @@ switch_node 1
|
||||
|
||||
send "diag stats\n"
|
||||
expect -r {received packets: \d+}
|
||||
expect "sent packets: 0"
|
||||
expect "sent success packets: 0"
|
||||
expect "sent error cca packets: 0"
|
||||
expect "sent error abort packets: 0"
|
||||
expect "sent error others packets: 0"
|
||||
expect "first received packet: rssi=-20, lqi=0"
|
||||
expect "last received packet: rssi=-20, lqi=0"
|
||||
expect_line "Done"
|
||||
|
||||
Reference in New Issue
Block a user