openhab / jamod

A fork of Java Modbus Library (jamod) - http://jamod.sourceforge.net/
Apache License 2.0
17 stars 26 forks source link

Support other serial implementations #19

Open wborn opened 1 year ago

wborn commented 1 year ago

It would be nice when the library supports using other serial implementations instead of gnu.io.

That way openHAB could use its own serial transport with it, which would solve several issues (https://github.com/openhab/openhab-addons/issues/7573).

This could for instance be implemented similar to the calimero-rxtx implementation (see also this comment). See also https://github.com/openhab/openhab-addons/pull/14051 for how such a mechanism can be used for using the openHAB serial transport.

CC: @ssalonen

ssalonen commented 1 year ago

Are there drop-in replacement interfaces available for the gnu.io API?

wborn commented 1 year ago

Not that I'm aware of. It would be nice if there was a facade for serial communications similar to slf4j. The code probably only depends on a subset of all gnu.io functionality so it may be easier to only add that subset to the interface(s).

wborn commented 4 months ago

See also https://github.com/openhab/openhab-addons/pull/16376 for another example of how to support multiple serial implementations in a library used by an add-on.