This repository contains NurApi java samples.
- transports
- NurApiSerialTransport, RXTX library based transport for NurApi
- NurApiSocketTransport, TCP/IP transport for NurApi
- samples
- Set of console examples (see section 'Compiling samples')
- import
- Contains NurApi.jar (see section 'Updating NurApi.jar')
- You need to setup your specific transport in order to run samples
- See file
- After editing file, rebuilding samples is necessary
- First see Setup your transport section
- JAVA_HOME environment variable needs to point java JDK install dir
- Build all samples: build_all.bat
- Run sample: run_sample.bat <folder>
- Example: nur_sample_java>run_sample.bat samples\00_Connection
- Depending on your platform (x86,x64) you may need to change RXTXJAR path in bat scripts. (defaults x64)
- Assumes java and javac are found in path
- Assumes RXTXcomm.jar found in /usr/share/java/RXTXcomm.jar
- Assumes librxtxSerial.so found in java library path (usually /usr/lib/jni)
- Debian based distros you can install RXTX: sudo apt-get install librxtx-java
- Build all samples: sh build_all.sh
- Depending on distro, you might need to adjust run_sample.sh script with: -Djava.library.path="/usr/lib/jni/"
- Run sample: sh run_sample.sh <folder>
- Example: $> sh run_sample.sh samples/00_Connection
- Import all projects under samples folder to workspace
- Might need to fix buildpaths, depending on platform
- Run sample using right mouse click over project and select: RunAs -> Java Application
- See output from eclipse Console window
You can update to latest NurApi.jar by running script. Script will download latest NurApi.jar from nur_sdk github to import directory.
- Windows
- Run in command prompt: UpdateImportsFromGitHub.bat
- Linux
- Run in shell: sh UpdateImportsFromGitHub.sh
All source files in this repository is provided under terms specified in LICENSE file.