Cascoda / ca821x-posix

Library for posix systems to connect the ca821x-api to an available interface (usb/kernel driver)
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Flush USB before registering upcoming fragments #1

Closed CiaranWoodward closed 7 years ago

CiaranWoodward commented 7 years ago

Currently if the program does not shut down smoothly, it can trigger the assert assert((is_first) == (*offset == 0)); to fail. This should be fixed by:

  1. Ignore fragments that cannot be registered in the correct place. This has the downside of not necessarily noticing bad packets that may occur in the middle of execution, which should be more seriously considered.

  2. Upon startup, read all packets into a junk buffer, as is currently done in the kernel exchange. This will cause the startup messages to be missed also, however.

CiaranWoodward commented 7 years ago

Fixed with option 2.