蓝牙套接字程序:连接:主机已关闭

蓝牙套接字程序:连接:主机已关闭

我正在尝试测试 rfcomm_server.c 和 rfcomm_client.c (来自链接https://github.com/balle/bluetooth-snippets) 在我的新蓝牙适配器上。

当我运行 rfcomm_client 时,它在连接时退出,并给出错误“连接:主机已关闭”。我正在使用 hci0 的 baddr 运行客户端。

但是,“hciconfig”显示设备已启动(本文中 Mac 地址已更改为 XX)

hci0: 
Type: BR/EDR Bus: USB BD Address: XX:XX:XX:XX:XX:XX 
ACL MTU: 310:10 SCO MTU: 64:8 UP RUNNING PSCAN ISCAN  
RX bytes:706 acl:0 sco:0 events:48 errors:0 
TX bytes:1503 acl:0 sco:0 commands:44 errors:0

“hcitool scan” 返回了其中一个配对设备的地址。所以我相信加密狗已启动。但我不确定为什么连接会返回 Host Down 错误。

感谢论坛的任何帮助。

我在 Mac 上以虚拟机形式运行 Ubuntu,并且安装了“bluez-5.27”

以下是“lsb_release -a”的详细信息

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.1 LTS
Release: 14.04
Codename: trusty

相关内容