Reputation: 54682
i wrote a c++ code to communicate with usb gsm modem using com ports. now i want to be informed immediately when the modem is pulled out or disconnected somehow. can i do this by using event handling or any other way? if the answer is yes then I'll be very grateful if someone tell me the way. thanks in advance :).
thanks Arefin
Upvotes: 0
Views: 494
Reputation: 3820
If your platform is Win32, there are messages for device removal that you can register for. I'm sure there is something similar in Linux and other large OS.
Upvotes: 0
Reputation: 179819
Yes. The USB standard is quite definite about the fact that unplugging of devices is allowed and must be managed by the OS. Since you haven't told us which OS, we can't point you to the precise function. In general, you'd look at the device management functions.
Upvotes: 1