EHS6 - USB - Cable detection | Telit Cinterion IoT Developer Community
October 27, 2017 - 5:37pm, 1876 views
Hello!
Is it possible to detect, via software, if there is connection with a PC?
I would like to avoid output of debug info if there is no USB cable connected. And allow other processes when the cable is connected.
Thank you!
Hello,
There's no system callback so that your application could be notified about plugging or unplugging of the USB cable.
You could try to detect this by listing the available ports in Java MIDlet or trying to redirect system.out to some USB interface or you'd need to use some hardware solution and a GPIO line for example to get the notification.
Regards,
Bartłomiej
Hello, thank you for the answer. I´ll try check the available ports.