蓝牙自动连接配对设备
我是新来的,我读了很多你的帖子,但仍然没有找到我的问题的解决方案。
我正在为 Android 2.2 编写一个应用程序,使用蓝牙连接到终端设备。 我有一个配对设备列表,我可以将我的 Android 平板电脑与每个已知的设备连接。
我想做的是,一旦 Android 平板电脑(顺便说一下,整个通信中的主设备)检测到已知配对设备之一在范围内,就会自动与终端设备连接。
一种可能性是不断轮询并尝试查看谁在我附近,但这会消耗大量电池寿命,并且如果我进入其中一台终端设备的范围内,而我的 Android 平板电脑不在范围中间轮询过程,我不会得到自动连接;我必须等到下一个轮询周期。
有没有办法解决这个问题呢?
我希望整个系统能够像 BT 耳机和我的方便设备一样工作:-/
感谢您的回答,希望我们能够解决这个问题!
I am new here and I have read a lot of your post, and still don't find the solution of my problem.
I am writing an App for Android 2.2 using Bluetooth to connect to an End-Device.
I have a list of Paired Devices and I can connect my Android-Tablet with each of my already known devices.
What I want to do, is to connect with an End-Device automatically as soon as the Android-Tablet (Master in the whole communication, by the way) detects that one of the known Paired-Devices is in range.
One possibility is to constantly poll and try to see who is near me, but that would cost a lot of battery life, and if I go in range with one of the End-Devices and my Android-Tablet is not in the middle of the Polling-Process, I would not get the automatic connection; I would have to wait until the next Polling-Cycle.
Is there any solution to the problem?
I would the whole thing to work like the BT-Headsets and my handy :-/
Thanks for your answers and hope we can deal with it!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定这个解决方案是否有效。这个想法是获取所有配对的设备并循环它并尝试使用该设备的 MAC 地址进行连接
I am not sure whether this solution works or not. The idea is get all the paired devices and loop through it and try to connect using the MAC address of that device