简体   繁体   English

在蓝牙设备搜索期间将obd扫描工具与其他蓝牙设备隔离

[英]Isolating obd scan tool from other bluetooth devices during bluetooth device search

I am creating a java program to communicate with a bluetooth ELM 327 . 我正在创建一个与蓝牙ELM 327通信的Java程序。 I want the program to provide the user with a list of obd adapters in the area after device search and exlude other devices such as cell phones etc. I believed it could be done by isolating obd adapters from others using Bluetooth Device Class. 我希望该程序在设备搜索之后向用户提供该区域的obd适配器列表,并排除其他设备(例如手机等)。我相信可以通过使用Bluetooth设备类将obd适配器与其他设备隔离来实现。 However I cannot find the device class of an obd adapter.(I am using JSR 82 and an ELM327 bluetooth if it helps). 但是我找不到obd适配器的设备类。(如果有帮助,我正在使用JSR 82和ELM327蓝牙)。

Can anyone tell me which device class an obd adapter conforms to OR an alternate method to isolate obd adapters? 谁能告诉我obd适配器符合哪个设备类,或者一种隔离obd适配器的替代方法?

Try what @Erik Smekens suggested. 尝试@Erik Smekens提出的建议。 You can connect to OBD-2 without pairing via insecure RFCOMM . 您可以连接到OBD-2,而无需通过不安全的RFCOMM进行配对。

As I suggested in my comment, it's not possible to identify a OBD-client. 正如我在评论中建议的那样,无法识别OBD客户端。 ( As far as I know. It still has mysteries for me). (据我所知。它对我来说仍然是个谜)。 The service is just a rfcomm/serial port over bluetooth and from the outside it looks as any other OBD adapter. 该服务只是蓝牙上的rfcomm /串行端口,从外部看,它像其他任何OBD适配器一样。

Your best shot will be connecting to each device, and send an AT command for each OBD-II device and check what the answer is. 最好的选择是连接到每个设备,并为每个OBD-II设备发送一个AT命令,并检查答案是什么。 If you want to isolate all ELM327 devices, you can use this list: 如果要隔离所有ELM327设备,可以使用以下列表:

https://www.sparkfun.com/datasheets/Widgets/ELM327_AT_Commands.pdf https://www.sparkfun.com/datasheets/Widgets/ELM327_AT_Commands.pdf

The first 2 commands (@1, @2) are probably going to help you out. 前两个命令(@ 1,@ 2)可能会帮助您。 Otherwise just send a AT Command and checks if it responds with 'OK'. 否则,只需发送AT命令并检查其是否以“ OK”响应即可。 (SP 00 might be a good one). (SP 00可能是一个不错的选择)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM