mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-02 07:00:35 +10:00
Enhance USB serial services with debug logging and reset functionality
- Introduced debug logging in USB serial services for better traceability. - Added reset method to UsbSerialFrameDecoder to clear buffered data. - Updated tests to verify the reset functionality of the decoder.
This commit is contained in:
committed by
just-stuff-tm
parent
c2f544eeba
commit
4c7ee3b3b0
@@ -37,6 +37,11 @@ class UsbSerialFrameDecoder {
|
||||
final List<int> _rxBuffer = <int>[];
|
||||
int _startIndex = 0;
|
||||
|
||||
void reset() {
|
||||
_rxBuffer.clear();
|
||||
_startIndex = 0;
|
||||
}
|
||||
|
||||
List<UsbSerialDecodedPacket> ingest(Uint8List bytes) {
|
||||
if (bytes.isEmpty) {
|
||||
return const <UsbSerialDecodedPacket>[];
|
||||
|
||||
Reference in New Issue
Block a user