()
| 555 | } |
| 556 | |
| 557 | fn read_ack() { |
| 558 | for attempt in 0..MAX_READ_ATTEMPTS { |
| 559 | let Some(packet) = read_packet() else { |
| 560 | error!( |
| 561 | "Expected ACK but no response on attempt {}/{}", |
| 562 | attempt + 1, |
| 563 | MAX_READ_ATTEMPTS |
| 564 | ); |
| 565 | continue; |
| 566 | }; |
| 567 | |
| 568 | if packet[0] == 0x5a && packet[1] == 0x02 { |
| 569 | debug!("ACK received: {:02x?}", &packet[..12]); |
| 570 | return; |
| 571 | } |
| 572 | |
| 573 | debug!( |
| 574 | "Discarded non-ACK packet while waiting for ACK on attempt {}: {:02x?}", |
| 575 | attempt + 1, |
| 576 | &packet[..12] |
| 577 | ); |
| 578 | } |
| 579 | |
| 580 | error!("No ACK received after {} attempts", MAX_READ_ATTEMPTS); |
| 581 | } |
| 582 | |
| 583 | // ─── DSP Getter/Setter (0x96 family via 0x11/0x12) ────────────────────────── |
| 584 |
no test coverage detected