tarm / serial

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How catch Lost Serial port(for example USB virtual rs-232 unplug)

irbismaestro opened this issue · comments

Hi
Thanks for library.
I have a question. My environment: Linux Centos 7x 64 .
Usb Virtual rs-232 . Its mapped as /dev/USB0(1,2,3..) or /dev/ACM0(1,2,3...)
library work but when USB device unplug, my application have crashed and exit. How I can catch this event(unplug) and reconnect(or wait connection),?

I think that calls for a state machine that catches the error and goes into a (re)connect state when the connection is lost. But I guess that should not be part of a basic serial port library such as this.