A chrome extension has access to serial port i/o and this is well supported in dart.
But a command line application does not.
It would be nice if dart:io could be augmented to support this.
Hopefully most of the existing file support can be reused and only functionality
for setting baud rates, etc. needs to be added.
Why is this useful? A ton of devices still use serial ports for communication, e.g.
Arduino style devices, home automation controllers, etc.
There is an existing library "serial_port" but it does not work very well on Linux
and the fact that it needs to make native calls and provides its own shared libs
makes it hard to work with.
@zoechi yes that is the library my last paragraph was referring to.
IMHO that's a generic problem with native support in pub packages. I'd suggest an tcp-RS232 converter. Many PCs don't have RS232 anymore anyway.
@zoechi, I agree that native support in pub packages is painful which is why I am lobbying to make enough functionality part of the sdk that no additional native code is needed.
WRT the suggestion of using a tcp-RS232 converter: many serial devices these days actually have
a usb connector and use serial via USB.
would be nice to have a bridge for the ble flutter plugin
For flutter there is the usb_serial https://pub.dartlang.org/packages/usb_serial
It is good to see some movement in this space but usb_serial seems to be written in and/or
depending on Java which is a heavy dependency and I doubt it would work well with the dart:io env.
Yeah not intended for dart:io integration. It targets Flutter on Android.
Nice to see that coming along as well.
My preference would be to have syscall bindings available in dart possible implemented using ffi
and then implement the usb library on top of that.
+1, this would be really useful for a project of mine...
Most helpful comment
+1, this would be really useful for a project of mine...