Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

agbpatro/obd-java-api

Open more actions menu
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

obd-java-api

OBD-II Java API

Build Status

Build

Requisites

  • JDK 7
  • Maven 3.1.0 or newer

Compile, package and install locally

mvn clean install

Usage

Maven

<dependency>
  <groupId>pt.lighthouselabs.obd</groupId>
  <artifactId>obd-java-api</artifactId>
  <version>0.6</version>
</dependency>

Gradle

dependencies {
    compile 'pt.lighthouselabs.obd:obd-java-api:0.6'
}

Example

After pairing and establishing Bluetooth connection to your ELM327 device..

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

// execute commands
try {
  new EchoOffObdCommand().run(socket.getInputStream(), socket.getOutputStream());
  new LineFeedOffObdCommand().run(socket.getInputStream(), socket.getOutputStream());
  new TimeoutObdCommand().run(socket.getInputStream(), socket.getOutputStream());
  new SelectProtocolObdCommand(ObdProtocols.AUTO).run(socket.getInputStream(), socket.getOutputStream());
  new AmbientAirTemperatureObdCommand().run(socket.getInputStream(), socket.getOutputStream());
} catch (Exception e) {
  // handle errors
}

About

OBD-II Java API

Resources

License

Stars

Watchers

Forks

Packages

No packages published
Morty Proxy This is a proxified and sanitized view of the page, visit original site.