Open altafc22 opened 1 year ago
I think Microsoft doesn't provide a disconnection function directly. In my opinion, there are some indirect methods to detect the device connection status.
GetLastError()
will return ERROR_HANDLE_INVALID
. Read
function is also like this. Maybe it's a little stupid...GetCommState
should return 0 when device disconnected. Periodically calling GetCommState
may be a good solution. I will test and add some function if it works.SerialPort.getAvailablePorts()
will lose current COM port if device disconnected.
Hi @FengChendian, thanks for creating such a great package for flutter, just wandering is there any way to detect serial device disconnection, i was looking arround it in my application. kindly waiting for your response on this.
Thanks