serial_port_flutter icon indicating copy to clipboard operation
serial_port_flutter copied to clipboard

Does not support multiple serial ports working at the same time(Because of the singleton pattern?)

Open sanxianlee opened this issue 4 years ago • 3 comments

Serial serialPortA = await FlutterSerialPort.createSerialPort( Device("deviceNameA", "/your/device/path"), 9600); Serial serialPortB = await FlutterSerialPort.createSerialPort( Device("deviceNameB", "/your/device/path"), 115200);

bool openResultA = await serialPortA.open(); print(serialPortA.isConnected) // true

bool openResultB = await serialPortB.open(); print(serialPortB.isConnected) // false

serialPortA.receiveStream.listen((recv) { print("Receive: $recv"); });

serialPortB.receiveStream.listen((recv) { print("Receive: $recv"); });

你可以参照: https://github.com/Marcello168/react-native-multi-serial-port

sanxianlee avatar Jul 24 '20 02:07 sanxianlee

Hi @sanxianlee 最近也發現了這個問題,感謝提供參考。

BbsonLin avatar Jul 24 '20 04:07 BbsonLin

This is an issue for me as well.

mortenboye avatar Aug 24 '20 09:08 mortenboye

Hi @mortenboye , actually I need some help for developing v1.0.0. I recently busy on my company job.

If you have time implementing this feature, I will be appreciated. 😃

BbsonLin avatar Aug 31 '20 02:08 BbsonLin