BbsonLin / serial_port_flutter

A Flutter plugin integrated with Android-SerialPort-API
Other
29 stars 24 forks source link

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

Open sanxianlee opened 4 years ago

sanxianlee commented 4 years ago

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

BbsonLin commented 4 years ago

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

mortenboye commented 4 years ago

This is an issue for me as well.

BbsonLin commented 4 years ago

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. 😃