Skip to content

Commit

Permalink
Implement independent ASHv2 protocol parsing (#606)
Browse files Browse the repository at this point in the history
* Implement independent ASHv2 protocol parsing

* Implement dynamic timeout computation

* Use a semaphore instead of a lock to allow concurrent sending of un-ACKed frames

* Replace current ASH+EZSP implementation

* Increase max concurrency to match ASH

* Allow setting the ACK mode as host or NCP

* [TEST] Shut down the event loop with a separate exception

* Re-implement a CLI tool to parse ASH frames from debug logs

* Remove `host` handling of timeouts

* Properly send ACKs in response to re-transmitted frames

* Set maximum command concurrency to 1

* Get ASH TX and NAK handling working reliably

* Fix RStackFrame `to_bytes()`

* Bump flake8

* Optimize command logging for readability

* Get unit tests passing again

* Revert "[TEST] Shut down the event loop with a separate exception"

This reverts commit d155888.

* Fix startup reset unit test

* Use strict `zip`

* Use better parsing errors

* Revert "Use strict `zip`"

This reverts commit ce3da98.

* Implement both sides of ASH to make testing easier

* Only pop the pending frame future if the frame number was actually assigned

* Move NCP ASH implementation into tests

* Ensure tests pass with 3.8

* Properly handle cancel and substitute bytes

* Add a unit test

* Simulate NAK state during end-to-end testing

* Ensure transports are resilient when it comes to framing

* Introduce random loss testing as well

* Add more tests

* Add more tests

* Cancel all pending frames when receiving a NAK

* Move reserved bytes into an enum

* Send a `CANCEL` byte before the reset frame

* Improve logging

* Fix unit tests

* Ensure codebase works with 3.8

* Almost at 100% coverage

* Unit test UART callbacks

* Get coverage up to 100%

* Make tests less flaky
  • Loading branch information
puddly authored May 10, 2024
1 parent 4f4adaf commit eae32ea
Show file tree
Hide file tree
Showing 8 changed files with 1,333 additions and 621 deletions.
5 changes: 3 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ repos:
- --quiet

- repo: https://github.com/pycqa/flake8
rev: 6.0.0
rev: 7.0.0
hooks:
- id: flake8
entry: pflake8
additional_dependencies:
- Flake8-pyproject==1.2.3
- pyproject-flake8==7.0.0

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
Expand Down
Loading

0 comments on commit eae32ea

Please sign in to comment.