NeuronRobotics / nrjavaserial

A Java Serial Port system. This is a fork of the RXTX project that uses in jar loading of the native code.
Other
345 stars 143 forks source link

NRSerialPort.getAvailableSerialPorts() is empty in 3.14, wasn't in 3.13 #127

Closed pseudo555 closed 4 years ago

pseudo555 commented 5 years ago

Hello,

NRSerialPort.getAvailableSerialPorts() is supposed to return all serial port available.

The following code: for(String s: NRSerialPort.getAvailableSerialPorts()) { System.out.println("Availible port(s): " + s); } Displays nothing using version 3.14.

In 3.13 (or previous, i was on 3.11 before), the same code (no other change expect nrjavaserial version) produces: Availible port(s): COM5 Availible port(s): COM3 Availible port(s): COM1

So i don't know what broken that in those commits: https://github.com/NeuronRobotics/nrjavaserial/compare/3.13.0...master

I'm using java 8.0 u60 x32 on win10 1803 x64 computer.

kaikreuzer commented 5 years ago

This is a known issue on Windows - https://github.com/NeuronRobotics/nrjavaserial/pull/121 is supposed to fix it. Unfortunately, it seems that this project is hardly maintained, so that such critical fixes in a release are not addressed :-/

pseudo555 commented 5 years ago

Thank's for your really quick answer.

From what i read, this should work as a workaround: RXTXCommDriver RXTXDriver = new RXTXCommDriver(); RXTXDriver.initialize(); Set x = RXTXDriver.getPortIdentifiers();

Got me the required port as soon as i add jna & jna-platform dependencies.

Edit 2: the original code i used also works once jna & jna-platform are set as dependencies.

kaikreuzer commented 5 years ago

the original code i used also works once jna & jna-platform are set as dependencies.

Right, this is the workaround I stated in https://github.com/NeuronRobotics/nrjavaserial/pull/121#issuecomment-410652896.

madhephaestus commented 5 years ago

Is this fixed in the new 3.15.0?

madhephaestus commented 4 years ago

this all should be fixed as of 3.19.0