J
Jörg Zieren
Hi,
I use javax.comm.CommPortIdentifier.getPortIdentifiers() to get a list
of the system's serial ports. This works fine, but the list is only
updated upon loading of the class CommPortIdentifier (through static code).
However, the Java application needs to detect a USB-to-serial converter
which is plugged in at runtime. This converter shows up as an additional
COM port (we're on WinXP). If it is plugged in before the app starts, it
is detected, but not if it is plugged in during runtime.
The said static code in CommPortIdentifier is:
CommDriver commdriver =
(CommDriver)Class.forName("javax.comm.RXTXCommDriver").newInstance();
commdriver.initialize();
This can be repeated, which does detect the newly appeared COM port, but
it only adds to the list of available ports that getPortIdentifiers()
returns, so I assume it's not meant to be done.
Is there some way to properly refresh the list of system COM ports
dynamically?
Thanx in advance,
Jörg
I use javax.comm.CommPortIdentifier.getPortIdentifiers() to get a list
of the system's serial ports. This works fine, but the list is only
updated upon loading of the class CommPortIdentifier (through static code).
However, the Java application needs to detect a USB-to-serial converter
which is plugged in at runtime. This converter shows up as an additional
COM port (we're on WinXP). If it is plugged in before the app starts, it
is detected, but not if it is plugged in during runtime.
The said static code in CommPortIdentifier is:
CommDriver commdriver =
(CommDriver)Class.forName("javax.comm.RXTXCommDriver").newInstance();
commdriver.initialize();
This can be repeated, which does detect the newly appeared COM port, but
it only adds to the list of available ports that getPortIdentifiers()
returns, so I assume it's not meant to be done.
Is there some way to properly refresh the list of system COM ports
dynamically?
Thanx in advance,
Jörg