[diag] handle errors of TransmitPacket() (#11076)

`TransmitPacket()` should return an error from platform Radio
implementation, as for example Radio can be in incorrect state.

If error occurs, increase `mSentErrorInvalidStatePackets` stat.

Add wrong state case to tests and fix `diag repeat stop` called
too lata.

Signed-off-by: Maciej Baczmanski <[email protected]>
This commit is contained in:
Maciej Baczmański
2025-01-09 10:47:40 -08:00
committed by GitHub
parent e7f8f75320
commit d7a266856f
6 changed files with 46 additions and 14 deletions
+4 -3
View File
@@ -2693,13 +2693,14 @@ class OTCI(object):
result['sent_success_packets'] = int(output[1].split(":")[1])
result['sent_error_cca_packets'] = int(output[2].split(":")[1])
result['sent_error_abort_packets'] = int(output[3].split(":")[1])
result['sent_error_others_packets'] = int(output[4].split(":")[1])
result['sent_error_invalid_state_packets'] = int(output[4].split(":")[1])
result['sent_error_others_packets'] = int(output[5].split(":")[1])
values = re.findall("\-?\d+", output[5])
values = re.findall("\-?\d+", output[6])
result['first_received_packet_rssi'] = int(values[0])
result['first_received_packet_lqi'] = int(values[1])
values = re.findall("\-?\d+", output[6])
values = re.findall("\-?\d+", output[7])
result['last_received_packet_rssi'] = int(values[0])
result['last_received_packet_lqi'] = int(values[1])