write method
Write data to the serial port.
Returns the amount of bytes written.
Implementation
@override
Future<int> write(Uint8List bytes, {Duration? timeout}) async {
if (_usbPort != null) {
await _usbPort!
.write(bytes)
.timeout(timeout ?? const Duration(seconds: 60));
return bytes.length; // TODO: how to get the written data amout?
}
return 0;
}