如何拥有连接到汽车单OBD2蓝牙设备的多个连接 [英] How to have multiple connections to a single Obd2 bluetooth device connected to car

查看:668
本文介绍了如何拥有连接到汽车单OBD2蓝牙设备的多个连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须做一个Android应用程序,从连接到汽车的OBD-II端口蓝牙设备通过蓝牙读取值。

I have to do an Android application that reads value via Bluetooth from a Bluetooth device connected to OBD-II port of a car.

我用的UUID SPP UUID 00001101-0000-1000-8000-00805F9B34FB。

I use the UUID SPP UUID 00001101-0000-1000-8000-00805F9B34FB .

如果我创建了要连接到OBD-II器件的4个线程,3 连接()取值失败,只有一个线程能够连接到设备。

If I create 4 threads that want to connect to the OBD-II device, 3 connect()s fail and only one thread is able to connect to the device.

有没有办法通过蓝牙更螺纹连接到OBD-II器件的方法吗?

Is there a way to connect more thread to an OBD-II device via Bluetooth?

我不知道,如果榆树237 设备能够与更多的线程进行通信。

I don't know if the elm-237 device is able to communicate with more threads.

推荐答案

我不是OBD / OBD-II的专家,但我知道一点上串行端口。

I am not an expert on OBD/OBD-II, but I know a little on serial ports.

其实,你看到了什么并不让我感到吃惊的。串口设备通常必须以独占模式运行,因此只有一个演员能够在单个时间点与他们交谈。有完全是在创建多个线程是没有意义的 - 这会不会让你的串行口说话快,也不会使外部设备(OBD芯片)响应速度更快!这不是一个网络!谈谈几个并联的设备,你需要有实际的数根电缆 - 大概也几个芯片

Actually, what you see does not surprise me at all. Serial-port devices usually must operate in exclusive mode, so only one actor can talk to them at a single point of time. There is totally no point in creating multiple threads for that - this will not make your serial port "talk faster", nor it will make the external device (OBD chip) respond faster! This is not a network! To talk to several devices in parallel, you'd need to have actual several cables - and probably also several chips.

ELM327是在你的OBD-2电缆连接的设备。它介导在汽车芯片和您的USB端口之间的通信,并通过USB总线暴露了一个虚拟串口。我从来没有听说过任何便宜的蓝牙功能的ELM327克隆,但我知道有OBD-II蓝牙适配器 - 最后我见过的<击>计算成本约2000 $,因为它与汽车零部件的大型诊断软件和数据库来(罢工:见注释),当然没有任何电缆的工作。但我认为,它仍然会仅提供1个虚拟串口,1个设备说话。

ELM327 is the device in your OBD-2 cable. It mediates the communication between the chips in the car and your USB port and exposes a virtual serial port over USB bus. I never heard of any cheap Bluetooth-enabled ELM327 clones, but I know that there are OBD-II Bluetooth adapters - the last I've seen costed about $2000 as it was coming with a large diagnostic software and database of car parts(strike: see comments) and of course worked without any cables. But I think that still it would provide only 1 virtual serial port to talk with 1 device.

这篇关于如何拥有连接到汽车单OBD2蓝牙设备的多个连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆