检测与已知的ID隐藏蓝牙设备 [英] Detect hidden bluetooth device with known ID

查看:533
本文介绍了检测与已知的ID隐藏蓝牙设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有目标蓝牙设备的MAC-ID,并想看看他是否在范围内。我怎样才能建立他的连接,当我知道他的身份证,他是在隐藏模式?

I have the target bluetooth device MAC-ID and would like to see if he is in range. How can I establish a connection to him, when I know his ID and he is in hidden mode?

我使用bluecove(JAVA)这一点。

I'm using bluecove (java) for this.

推荐答案

我不知道你的意思是隐藏模式。您可以连接到设备,是不是发现,但不能连接到设备不能连接。

I'm not sure what you mean by "hidden mode." You can connect to a device that is not discoverable, but you cannot connect to a device that is not connectable.

一般情况下,使用JSR-82(或Bluecove,一个JSR-82实现),你需要有一个远端设备对象,以打开连接。得到的唯一方式远端设备是通过设备搜索。它看起来像你不能做你的情况设备搜索,因为该设备是隐藏。

Generally, using JSR-82 (or Bluecove, a JSR-82 implementation) you need to have a RemoteDevice object in order to open a connection. The only way to get a RemoteDevice is via device search. It looks like you can't do a device search in your case, as the device is "hidden."

在Bluecove,你​​会发现,远端设备有一个保护的构造函数蓝牙地址字符串。您可以创建远端设备的子类,只是使这个构造公众。例如:

In Bluecove, you'll notice that RemoteDevice has a protected constructor that takes a Bluetooth address String. You can create a subclass of RemoteDevice that simply makes that constructor public. For example:


public class MyRemoteDevice extends javax.Bluetooth.RemoteDevice {
  public MyRemoteDevice(String addr) {
    super(addr);
  }
}

您可以创建一个实例 MyRemoteDevice ,传递已知的MAC地址,并用它来打开连接。

You can then create an instance of MyRemoteDevice, passing it the known MAC address, and use it to open the connection.

这篇关于检测与已知的ID隐藏蓝牙设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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