Don't fail on ack comms error if validated response has been received#137
Conversation
itsmojo
commented
Nov 21, 2024
- make readAndAckResponse func as private
- comment out a mostly reductant and unneeded log.debug statement
|
This code was tested by introducing fake comms errors originally at a low Bluetooth layer (PeripheralManager.runCommand()) and then later in MessageTransport.readAndAckResponse(). A flag was added to control whether to throw PodProtocolError.messageIOException as before or to just log the error and return the response if an Omnipod command message had been sent and a validated response received when the final ACK has some comms error. When faking ACK comms errors both at the low and high levels, it was found that Loop could continue and use the response instead of potentially having to go into unacknowledgedCommand mode is an exception is raised. Tests runs were done against both actual Dash pods and the rPi pod sim. On the next Omnipod message following a faked ACK comms error, actual Dash pods generally recovered immediately while the pod sim would exit and would need to be restarted. |
StatusLGTM Code ReviewThe code review looks good. Relying on the work @itmojo did by inserting errors. |