Git Product home page Git Product logo

jnacan's Introduction

jnaCan

CAN bus for Java, uses JNA to access the Linux SocketCan API.

This software is Alpha quality, please do not use in production.

Through the use of Java Native Access, no native code needs to be written to access the SocketCan API. This project is pure Java (well technically the JNA jar has some small ready made native binary libraries included).

The library currently only supports the raw can mode. The read and write calls will block. However there is socket option which sets the SO_RCVTIMEO value so that the read will timeout.

A Netty 4.0 channel implementation is included.

jnaCan is licensed under the GNU LESSER GENERAL PUBLIC LICENSE Version 3, see LICENSE.txt

jnaerator switches

Note that some of constants defined in the Linux C header files may be different on your platform and so the generated Java code might not work. I have tested the bindings on x86_64 and arm7l (BeagleBone).

If you need to create your own bindings, this is the command I used with jnaerator to generate the Java files in the JNA "CLibrary" binding package. Some small modifications were made afterwards, I addded padding to can_frame and fixed an error in ifreq.

java -jar jnaerator-0.12-SNAPSHOT-20130727.jar -D__s8=char -runtime JNA -mode Directory -I/usr/include/x86_64-linux-gnu/ -I/usr/include/linux/ -library c /usr/include/net/if.h /usr/include/linux/can.h /usr/include/x86_64-linux-gnu/sys/socket.h /usr/include/x86_64-linux-gnu/bits/socket.h /usr/include/asm-generic/socket.h /usr/include/unistd.h /usr/include/x86_64-linux-gnu/sys/ioctl.h /usr/include/linux/can/raw.h /usr/include/linux/can/error.h /usr/include/linux/can/gw.h /usr/include/linux/can/bcm.h /usr/include/linux/can/netlink.h

jnacan's People

Contributors

gerdzanker avatar jazdw 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.