Skip to content
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

Add ability to retrieve com port properties #88

Open
wants to merge 9 commits into
base: 2.8.0
Choose a base branch
from

Conversation

rlishtaba
Copy link

No description provided.

Opening /dev/cu.* doesn't require DCD to be asserted and succeeds immediately.
This includes /dev/tty.Bluetooth-Modem and friends.
Opening certain devices, such as serial endpoints over Bluetooth, can take a long time before they fail. Moreover, it's better to show devices even when the user currently doesn't have permissions to access them - else one might think of a problem with the device or driver, when a "sudo chmod 666" would do the trick.
Before dynamically extracting the matching native library, first try to load it using System.loadLibrary(). This is helpful when it's not desired to modify the host system (but rather make changes to java.library.path).
The command used to compile this on 10.9.1:
g++ -shared -arch i386 -arch x86_64 -I"$JAVA_HOME/include" -I"$JAVA_HOME/include/darwin" -I"/System/Library/Frameworks/IOKit.framework/Headers" -o libjSSC-2.8_universal.jnilib jssc.cpp
getPortProperties() returns a map with keys and values as string. The currently available properties are: idProduct (lowercase hexadecimal zero-padded to four digits), idVendor (same as idProduct), manufacturer, product, serial. This is currently implemented for Linux and OS X (only in the Universal binary).

The command used to compile this on 10.9.1:
g++ -shared -arch i386 -arch x86_64 -I"$JAVA_HOME/include" -I"$JAVA_HOME/include/darwin" -I"/System/Library/Frameworks/IOKit.framework/Headers" -framework CoreFoundation -framework IOKit -o libjSSC-2.8_universal.jnilib jssc.cpp
Command used to compile on a current Raspbian: g++ -shared -march=armv6 -mfpu=vfp -mfloat-abi=hard -I/usr/lib/jvm/jdk-7
-oracle-armhf/include -I/usr/lib/jvm/jdk-7-oracle-armhf/include/linux -o libjSSC-2.8_armhf.so jssc.cpp
This was built with: g++ -shared -I /usr/lib/jdk1.8.0_121/include -I/usr/lib/jdk1.8.0_121/include/linux -o libjSSC-2.8_aarch64.so jssc.cpp
@RomanBelkov
Copy link

See #113 for Windows support

hiddenalpha pushed a commit to hiddenalpha/jssc that referenced this pull request May 18, 2021
Use JDK5+ foreach
Remove redundant conditionals

Co-authored-by: Tomas Nieboer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants