You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've developed a bit of a problem.. When transmitting, if I remove my serial port.. it will thrown a exception, in which serial_.isOpen will still be true. When I try to manually close, it will complain about calling terminate after a portnotopened exception. As you may see, I have a interval configure to reconnect, since the serial instance will not detect a proper disconnect, that reconnection attempt will not run. Are there any ways to make serial_isOpen properly detect removal of the serial device?
The text was updated successfully, but these errors were encountered:
// Disconnected devices, at least on Linux, show the
// behavior that they are always ready to read immediately
// but reading returns nothing.
throwSerialException ("device reports readiness to read but "
"returned no data (device disconnected?)");
But I don't know if this is related to your use case. Perhaps you can just catch the exception when you try to close it and keep going? But I'm honestly not sure.
See https://github.com/Teaduskeskus-AHHAA/oskar_driver/blob/cf0a9f6b7cb7d4382fb9ac8d07a1e08d070df620/src/board_comms.cpp for how I'm using this serial library in ros/ubuntu18.04
I've developed a bit of a problem.. When transmitting, if I remove my serial port.. it will thrown a exception, in which serial_.isOpen will still be true. When I try to manually close, it will complain about calling terminate after a portnotopened exception. As you may see, I have a interval configure to reconnect, since the serial instance will not detect a proper disconnect, that reconnection attempt will not run. Are there any ways to make serial_isOpen properly detect removal of the serial device?
The text was updated successfully, but these errors were encountered: