emfcamp / TiDAL-badge-webserial

A web interface for badge.team-firmware badges using WebSerial
Other
3 stars 2 forks source link

Add atomic transceive and use for commands #6

Closed MatthewWilkes closed 2 years ago

MatthewWilkes commented 2 years ago

The normal transceive operation can be a bit flakey, as it may not have all data ready in a single batch, which can cause operations to process part of the output stream from their predecessor. This adds a wrapper around transceive that fixes this by defining a known bracket around the data, as well as making use of paste mode to ensure that one command running doesn't overlap with the output of the previous if run in rapid succession.