• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

pires/obd-java-api: OBD-II Java API

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

pires/obd-java-api

开源软件地址:

https://github.com/pires/obd-java-api

开源编程语言:

Java 100.0%

开源软件介绍:

obd-java-api

OBD-II Java API

NOTICE

I am no longer involved in any way with OBD and related activities, so don't expect my feedback on issues, pull-requests and most of all, email.

I can't even remember when I first picked this project but it was fun as hell in the beginning. Now, years went by and a few contributors jumped in with amazing, smart features and fixes. To those fine people, Thank you! This is your baby, too.

Now, it's time to say goodbye. Pires

Build status

Important resources

Before opening an issue or using this library, please take a look at the following resources:

Build

Requisites

  • JDK 7
  • Maven 3.1 or newer

Compile, package and install locally

mvn clean install

Usage

Maven

<dependency>
  <groupId>com.github.pires</groupId>
  <artifactId>obd-java-api</artifactId>
  <version>1.0</version>
</dependency>

Gradle

dependencies {
    compile 'com.github.pires:obd-java-api:1.0'
}

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 EchoOffCommand().run(socket.getInputStream(), socket.getOutputStream());
  new LineFeedOffCommand().run(socket.getInputStream(), socket.getOutputStream());
  new TimeoutCommand(125).run(socket.getInputStream(), socket.getOutputStream());
  new SelectProtocolCommand(ObdProtocols.AUTO).run(socket.getInputStream(), socket.getOutputStream());
  new AmbientAirTemperatureCommand().run(socket.getInputStream(), socket.getOutputStream());
} catch (Exception e) {
  // handle errors
}

Troubleshooting

As @dembol noted:

Have you checked your ELM327 adapter with Torque or Scanmaster to see if it works with your car? Maybe the problem is with your device?

Popular OBD diagnostic tools reset state and disable echo, spaces etc before protocol selection. Download some ELM327 terminal for android and try following commands in order:

ATD
ATZ
AT E0
AT L0
AT S0
AT H0
AT SP 0



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
amaembo/streamex: Enhancing Java Stream API发布时间:2022-04-03
下一篇:
BenMenking/routeros-api: Client API for RouterOS/Mikrotik发布时间:2022-04-03
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap