Added request for full list of CommPortIdentifiers if we're unable to get identifer by name. #12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello!
I was receiving a problem of OpenHAB being to unable to open COM port under OpenSUSE Linux (detailed explanation and what i've tried is here https://community.openhab.org/t/modbus-binding-does-not-see-serial-port/118527).
More exactly, there was these errors in logfiles:
After poking the code for some time it seems to me, that
CommPortIdentifier
class could return null for existing port if there was no call togetCommPortIdentifiers()
before callinggetCommPortIdentifier(String)
(that is because is has internal list of ports with head inCommPortIndex
variable and this list is filled only whengetCommPortIdentifiers()
is called).So, i'm suggesting a bit ugly but tiny workaround for that problem. I've tested it in my environment and it works after fix.