Giter Site home page Giter Site logo

arissetyawan / nrjavaserial Goto Github PK

View Code? Open in Web Editor NEW

This project forked from neuronrobotics/nrjavaserial

0.0 2.0 0.0 5.48 MB

A Java Serial Port system. This is a fork of the RXTX project that uses in jar loading of the native code.

Makefile 2.04% C 50.62% Java 47.15% HTML 0.20%

nrjavaserial's Introduction

About

Join the chat at https://gitter.im/NeuronRobotics/nrjavaserial

This is a fork of the RXTX library with a focus on ease of use and embeddability in other libraries.

Some of the features we have added

  • A simplified serial port object called NRSerialPort. See below for an example.

  • Self-deployment of native libraries (all native code is stored inside the JAR and deployed at runtime). No more manual installation of native code.

  • Arm Cortex support (Gumstix).

  • Android Support (requires a rooted phone to access the serial hardware).

  • Single Makefile compile which simplifies the compilation of project binaries.

  • Gradle support for JAR creation.

  • Removal of partially-implemented RXTX code to streamline the library for just serial port access.

  • Full Eclipse integration for testing application code against sources.

  • RFC 2217 support provided by incorporating the jvser library.

And a bunch of bug fixes

  • Fixed the memory access error that causes OS X to crash the JVM when serial.close() is called.

  • Fixed the Windows serial port zombie bind that prevents re-accessing serial ports when exiting on an exception.

  • Fixed erroneous printouts of native library mis-match.

Dependency Management

Maven

https://oss.sonatype.org/#nexus-search;gav~com.neuronrobotics~nrjavaserial

Building the JAR

  1. Checkout the repository.

     $ git clone https://github.com/NeuronRobotics/nrjavaserial.git
    
  2. Build with Gradle.

     $ cd nrjavaserial
     $ gradle build
    

The resulting JAR will be found in the build/libs/ directory.

Building Native Code

Native code is built using the Makefile found in the root of the repository. After the native code is built, the JAR is rebuilt.

# Build both the 32- and 64-bit Windows binaries.
$ make windows

# Build the windows binaries on Linux via Wine.
$ make wine

# Build both the 32- and 64-bit Linux x86 binaries.
$make linux

# Build 32- or 64-bit Linux binaries, respectively.
$ make linux32
$ make linux64

# Build the binaries for all the supported ARM flavors (requires arm-linux-geabi-* packages)
$ make arm

# Build the OSX binaries.
$ make osx

# Build the PPC binaries.
$ make ppc

Building on Windows

You'll need some installation of GCC. We recommend the TDM-GCC distribution of mingw64-w64.

Building on OS X

We're pretty big on maintaining backwards compatibility as far as reasonable. Our OS X natives target OS X 10.5, so to build them, you'll need an appropriate SDK installed. This StackOverflow answer provides pointers for getting the appropriate SDK installed.

How to use NRSerialPort objects

for(String s:NRSerialPort.getAvailableSerialPorts()){
		System.out.println("Availible port: "+s);
	}
String port = "COM3";
int baudRate = 115200;
NRSerialPort serial = new NRSerialPort(port, baudRate);
serial.connect();

DataInputStream ins = new DataInputStream(serial.getInputStream());
DataOutputStream outs = new DataOutputStream(serial.getOutputStream());

byte b = ins.read();
outs.write(b);

serial.disconnect();

nrjavaserial's People

Contributors

50watt avatar akuhtz avatar bobbrez avatar bparees avatar crea-doo avatar cxbrooks avatar earcam avatar gitter-badger avatar madhephaestus avatar mnlipp avatar mores avatar mrdos avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.