In our Linux box we have USB -> serial device which was always identified as
/dev/ttyACM0
. So I've written an application and until yesterday, everything worked fine. But suddenly (yeah, during the remote presentation ...) the device stopped working. After quick research, I found that the connection changed to /dev/ttyACM1
. It was a little untimely, but now I have a problem - how to unambiguously identify my device? Like, for example, the storage drive could be initialized using UUID although the /dev/sd**
has changed. Is there some way to do that for serial devices?
Now I use a stupid workaround:
for(int i = 0; i < 10; i ++)
{
m_port = std::string("/dev/ttyACM") + (char)('0' + i);
m_fd = open(m_port.c_str(), O_RDWR | O_NOCTTY | O_NDELAY);
}
The link to the device we use.