The binding currently uses serialPortManager.getIdentifiers() to see if there are any SerialPortIdentifiers.
This workaround was added in #335 by @triller-telekom.
The workaround causes serial port detection issues because the getIdentifiers() method will only return discovered ports.
As a result:
- Undiscovered (non-standard) RXTX ports will not work this way (e.g ports defined in udev rules), the transport adds undiscovered ports to
gnu.io.rxtx.SerialPorts so they can be used without users having to configure this
- RFC2217 ports cannot be used because there is no discovery logic for these ports.
We've upgraded nrjavaserial in OH3 so we should retest if this is still an issue.
We should also test if it is fixed with nrjavaserial 5.1.0+ because it contains fixes for hardware that gets removed.
If this is no longer an issue we should remove the workaround by instead detecting that a controller is disconnected by just opening the port and handling any resulting exceptions.
If it is still an issue, we should create an issue for it in the nrjavaserial issue tracker with a reproduction scenario. That way we can fix the root cause and don't need to add such workarounds (causing discovery issues) to other add-ons.
Related to:
The binding currently uses serialPortManager.getIdentifiers() to see if there are any
SerialPortIdentifiers.This workaround was added in #335 by @triller-telekom.
The workaround causes serial port detection issues because the
getIdentifiers()method will only return discovered ports.As a result:
gnu.io.rxtx.SerialPortsso they can be used without users having to configure thisWe've upgraded nrjavaserial in OH3 so we should retest if this is still an issue.
We should also test if it is fixed with nrjavaserial 5.1.0+ because it contains fixes for hardware that gets removed.
If this is no longer an issue we should remove the workaround by instead detecting that a controller is disconnected by just opening the port and handling any resulting exceptions.
If it is still an issue, we should create an issue for it in the nrjavaserial issue tracker with a reproduction scenario. That way we can fix the root cause and don't need to add such workarounds (causing discovery issues) to other add-ons.
Related to: