-
-
Notifications
You must be signed in to change notification settings - Fork 428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pure Java Comm - Initial Contribution #3632
base: main
Are you sure you want to change the base?
Conversation
bundles/org.openhab.core.io.transport.serial.purejavacomm/.vscode/launch.json
Outdated
Show resolved
Hide resolved
bundles/org.openhab.core.io.transport.serial.purejavacomm/.vscode/settings.json
Outdated
Show resolved
Hide resolved
bundles/org.openhab.core.io.transport.serial.purejavacomm/.vscode/tasks.json
Outdated
Show resolved
Hide resolved
@splatch Why is there an error on the DCO for this PR? |
Looks like bot does not recognize sign off for you commit. Can you do |
mmh..... "nothing to commit, working tree clean" |
@kgoderis Sorry, it should be |
Pfff.... It was because of a space between "off" and ":". LOL |
Just for my understanding: Is there any limitation compared to the implementation we already have? Otherwise I would say we could also replace the code we use now. It seems to be confusing to have code that does not work on some architectures when we have very similar code that does. |
There is, pure java comm provides just a serial port API, nrjavaserial brings rfc2217 which handles serial over tcp. Whole rfc2217 support in nrjavaserial provides API compatible with rxtx: https://github.com/NeuronRobotics/nrjavaserial/blob/af0e83d320920cf0ca3cc8fd25a4f25f482fd0d6/src/main/java/gnu/io/rfc2217/TelnetSerialPort.java#L58. |
@J-N-K Side question : is there a way to delay the loading of bundles that use serial transport bundles? I noticed that (in this case with pure java comm) some dependant bundles receive an empty serial port list from the SerialPortManager at first; one has to pause and reinitialize things in order to get connected the serial port |
@J-N-K http://www.sparetimelabs.com/purejavacomm/purejavacomm.php |
@openhab/core-maintainers When will this be merged ? |
@kgoderis I think you may improve feature a bit by making certain features conditional. Given that purejavacomm can be default serial provider for mac, we could utilize karaf features with Looking at it I think its possible to define a operating system condition through https://docs.osgi.org/specification/osgi.core/7.0.0/framework.namespaces.html#framework.namespaces.osgi.native, however I never really tested that . I been using Standardized operating system labels are here: https://docs.osgi.org/reference/osnames.html |
Signed-off-by: Karel Goderis <[email protected]>
@splatch Ok, I tried something, and it is compiling, but I have no clue if that is any indication that things are working. |
@openhab/core-maintainers Can someone verify the above? |
@@ -232,6 +232,15 @@ | |||
<bundle>mvn:org.eclipse.kura/org.eclipse.soda.dk.comm.x86_64/1.2.201</bundle> | |||
</feature> | |||
|
|||
<conditional> | |||
<condition>req:osgi.native;filter:="(&(osgi.native.osname=MacOSX)(osgi.native.processor=AArch64))"</condition> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that conditional
element can be specified under <feature>
element to determine conditional dependencies. From this point of view proper place might be a upper level feature such as openhab.tp-serial
(if one exists) which can make two conditions 1) for macos/aarch64 - which you made, calling feature openhab.tp-serial-purejavacomm
, and 2) for anything else than macos/aarch64 pulling in openhab.tp-serial-rxtx
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See for example:
openhab-core/features/karaf/openhab-core/src/main/feature/feature.xml
Lines 523 to 533 in d3d0fe3
<conditional> | |
<condition>req:osgi.native;filter:="(osgi.native.osname=Linux)"</condition> | |
<bundle>mvn:org.openhab.core.bundles/org.openhab.core.config.discovery.usbserial.linuxsysfs/${project.version}</bundle> | |
</conditional> | |
<bundle>mvn:org.openhab.core.bundles/org.openhab.core.config.discovery.usbserial.ser2net/${project.version}</bundle> | |
<conditional> | |
<condition>req:osgi.native;filter:="(osgi.native.osname=Windows*)"</condition> | |
<bundle>mvn:org.openhab.core.bundles/org.openhab.core.config.discovery.usbserial.windowsregistry/${project.version}</bundle> | |
</conditional> |
Would be nice to know how well it performs compared to nrjavaserial. As I understand JNA based implementations perform a lot worse compared to implementations using JNI. https://en.wikipedia.org/wiki/Java_Native_Access#Performance:
|
Some bindings do not use the OH serial transport, so you won't be able to use these with your ARM64 Apples. |
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/oh3-x-oh4-x-alternative-java-serial-provider/128462/34 |
<parent> | ||
<groupId>org.openhab.core.bundles</groupId> | ||
<artifactId>org.openhab.core.reactor.bundles</artifactId> | ||
<version>4.0.0-SNAPSHOT</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<version>4.0.0-SNAPSHOT</version> | |
<version>4.3.0-SNAPSHOT</version> |
Alternative Comm Port Provider based on https://github.com/nyholku/purejavacomm. PureJavaComm aims to be a drop-in replacement for Sun's (now Oracle) abandoned JavaComm and an easier to deploy alternative to RXTX. Note that RXTX native binaries are not provided for Apple's (newer) ARM64 architecture, and therefore this is the only alternative to get serial ports working
Signed-off-by : Karel Goderis [email protected]