【问题标题】:Connect to Bluetooth device with Bluetooth address使用蓝牙地址连接到蓝牙设备
【发布时间】:2017-08-06 14:39:48
【问题描述】:

我有一个安装了蓝牙板的双向收音机。目前,收音机设置为使用低频配对系统与专有的摩托罗拉设备连接,因此现场用户不必处理经典的蓝牙连接过程。但是,我正在尝试将收音机连接到我的计算机,以便对设备进行编程。由于我无法将设备置于发现/可见模式,因此无法连接经典方式。

我知道收音机的蓝牙地址(显示在收音机菜单中)和所有蓝牙协议信息(我已经连接了一个相同的收音机)。有没有办法在知道这些信息的 Windows 中连接到这个收音机?

【问题讨论】:

  • 如果您能提供更多关于设备、目标windows平台、目标蓝牙堆栈、目标开发工具等的信息。提供帮助会更容易。

标签: windows bluetooth


【解决方案1】:

我相信您可以使用 32feet.NET 库连接到您的设备,因为您拥有有关设备的所有信息。假设您正在连接到 RFCOMM 设备并想要获取流,那么您可以执行以下操作:

using InTheHand.Net;
using InTheHand.Net.Bluetooth;
using InTheHand.Net.Sockets;        

...
...
//Somewhere in your connect function
//Replace with your mac address
BluetoothAddress addr = new BluetoothAddress(new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 });
//Replace with the service class of your device.  
Guid serviceClass = BluetoothService.SerialPort;
var ep = new BluetoothEndPoint(addr, serviceClass);
var cli = new BluetoothClient();
cli.Connect(ep);
Stream peerStream = cli.GetStream();

在这个阶段,您的设备会有一个流。

我不确定是否有足够的信息,因为问题没有提到正在使用哪些蓝牙堆栈和目标。此外,我们不知道您的设备。

如果您的设备需要带外配对,则需要以 Windows 8.1 或更高版本为目标。

祝你好运!

【讨论】:

    猜你喜欢
    • 2013-05-29
    • 1970-01-01
    • 1970-01-01
    • 2014-10-04
    • 1970-01-01
    • 1970-01-01
    • 2012-03-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多