0

I have an application that can run either with or without a USB CDC device attached to the machine. This device is programmed to respond to a question with a specific answer so I can detect which serial port is is connected to. The thing is, I need to know when to perform this check. I don't want to create a thread to run this check over and over again, so I need to know how to listen to a "device connected" event. I have searched it before, but maybe I'm just not using the right key words, so any help would be very nice.

Obs: I'm using Java 1.7 and the RXTX library.

dsolimano
  • 8,870
  • 3
  • 48
  • 63

1 Answers1

1

I have the same problem and AFAIK there is no way to do this in a platform independent way. On linux one might do it as described here.

Anyway, in case your device is a USB/Serial converter, you will only get an event when the converter is (un)plugged, not when a device is attached to the converter itself.

Community
  • 1
  • 1
jopa
  • 1,109
  • 7
  • 6