Skip to content

org-arl/jhwbus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jhwbus

Java hardware bus access

A simple, thin JNI based Java library to enable accessing hardware buses (for eg. I2C) from Java on Linux. Bundles the native library into the jar and dynamically loads it at runtime.

Currently supports the following hardware:

  • I2C/SMBUS

Currently supports the following operating systems:

  • Linux
  • macOS (dummy support for testing only)

Building

Requirements

  • Java
  • gcc
  • gradle

Ensure that the environment variable JAVA_HOME is defined and points the Java installation.

Commands

gradle : Generates a jar with the native library included in build/libs

Using

Since the library is very platform (OS and architecture) specific, it is recommended that you add it as gradle source dependency instead of a normal gradle dependency, so that it gets compiled on your platform.

In settings.gradle :

sourceControl {
  gitRepository("https://github.com/org-arl/jhwbus.git") {
    producesModule("org.arl.jhwbus:jhwbus")
  }
}

In build.gradle :

 implementation('org.arl.jhwbus:jhwbus:1.1.1') {
    version {
        branch = 'master'
    }
}

License

BSD 3-Clause License

See LICENSE file.