eltonvs / java-obd-api

:oncoming_automobile: An OBD-II API written in Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Java OBD API

An OBD-II API written in Java. Based on obd-java-api.

Quickstart

Android

Just include it into the build.gradle file:

   dependencies {
     ...

     // Java OBD API
     implementation 'com.github.eltonvs:java-obd-api:0.0.1'
   }

Maven

You only need to include it into your pom.xml file:

   <dependency>
     <groupId>com.github.eltonvs</groupId>
     <artifactId>java-obd-api</artifactId>
     <version>0.0.1</version>
   </dependency>

Sample Usage

After pairing and establishing a Bluetooth connection with your OBD device.

// retrieve Bluetooth socket
socket = ...; // specific to the VM you're using (Java, Android, etc.)

// Group many obd commands into a single command ()
ObdCommandGroup obdCommands = new ObdCommandGroup();
obdCommands.add(new EchoOffCommand());
obdCommands.add(new LineFeedOffCommand());
obdCommands.add(new TimeoutCommand(timeout));
obdCommands.add(new SelectProtocolCommand(protocol));

// Run all commands at once
obdCommands.run(socket.getInputStream(), socket.getOutputStream());

Contributing

We're open for contributions!

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the Apache 2.0 - see the LICENSE file for details

Acknowledgments

About

:oncoming_automobile: An OBD-II API written in Java

License:Apache License 2.0


Languages

Language:Java 100.0%