Which GATT Profile and Services are used by OBD BLE Adapters like LELink, Automatic, Carista?

本小妞迷上赌 提交于 2019-12-02 03:43:30

OBD2 BLE adapters don't use any fixed GATT profiles. The way most (if not all) BLE OBD2 adapters work, is that they offer one service with one or two characteristics:

  1. A write characteristic. This one is where the mobile device can write its AT commands (in the case of, e.g., an ELM327) and PIDs to.
  2. A notify characteristic. This is the one where the results from the car (ECUs) are returned.

Once you have access to these characteristics, you can implement the OBD2 serial protocol (e.g. using a command queue that writes and waits for the response, before transmitting the finished command to the application layer).

Some BLE adapters merge these two into one characteristic. If you want to support arbitrary adapters, you will have to add a 'select your adapter' screen where you probe the found adapters, remember the characteristics, and then communicate.

That way it's possible to write apps that work with all kinds of BLE OBD2 adapters, and not only support a selected handful of vendors, e.g., such as OBD2 Expert (Disclaimer: I'm the author of that software).

Hope that helps!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!