Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions bellows/ash.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,4 +715,8 @@ async def send_data(self, data: bytes) -> None:
)

def send_reset(self) -> None:
# Some adapters seem to send a NAK immediately but still process the reset frame
# if one eventually makes it through
self._write_frame(RstFrame(), prefix=(Reserved.CANCEL,))
self._write_frame(RstFrame(), prefix=(Reserved.CANCEL,))
self._write_frame(RstFrame(), prefix=(Reserved.CANCEL,))
5 changes: 4 additions & 1 deletion tests/test_ash.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,10 @@ async def test_ash_protocol_startup(caplog):

assert ezsp.reset_received.mock_calls == [call(t.NcpResetCode.RESET_SOFTWARE)]
assert protocol._write_frame.mock_calls == [
call(ash.RstFrame(), prefix=(ash.Reserved.CANCEL,))
# We send three
call(ash.RstFrame(), prefix=(ash.Reserved.CANCEL,)),
call(ash.RstFrame(), prefix=(ash.Reserved.CANCEL,)),
call(ash.RstFrame(), prefix=(ash.Reserved.CANCEL,)),
]

protocol._write_frame.reset_mock()
Expand Down
Loading