serial_port icon indicating copy to clipboard operation
serial_port copied to clipboard

Examples should set the baudrate

Open freedaun opened this issue 5 years ago • 0 comments

Hello, how does one set the baudrate?? And where, client or server?

A typical serial port can't be used if the baudrate can't be set. Curiously all the examples ignore this non-optional part of a serial connection.

Other connection parameters also want at least one example.

To those that need an answer, in io_demo.dart use this:

ConnectionOptions options = ConnectionOptions()..bitrate = 115200;
    SerialStreamChannel serialStreamChannel = 
         await service.serial.createChannel(deviceInfo.path, options: options);

ps It would also be wise to mention "baudrate" besides "bitrate", because common searches for baudrate come up empty.

freedaun avatar May 23 '19 16:05 freedaun