linux – BlueZ on i.MX25:无法连接RFCOMM套接字:操作正在进行
我正在尝试连接到嵌入式
Linux上的蓝牙设备.
> BlueZ版本是4.101. 使用描述的方法 但是,我无法将i.MX25板(嵌入式自定义Linux)连接到目标设备.只扫描有效. rfcomm.conf rfcomm0 { # Automatically bind the device at startup bind yes; # Bluetooth address of the device device 00:07:80:5A:48:93; # RFCOMM channel for the connection channel 1; # Description of the connection comment "Example Bluetooth device"; } hciconfig -a输出 hci0: Type: BR/EDR Bus: USB BD Address: 00:15:83:44:39:E2 ACL MTU: 384:8 SCO MTU: 64:8 UP RUNNING PSCAN RX bytes:28633 acl:0 sco:0 events:204 errors:0 TX bytes:899 acl:0 sco:0 commands:60 errors:0 Features: 0xff 0xff 0x8f 0xfe 0x9b 0xff 0x59 0x83 Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 Link policy: RSWITCH HOLD SNIFF PARK Link mode: SLAVE ACCEPT Name: 'Bluetooth2.1+EDR CLASS1' Class: 0x000000 Service Classes: Unspecified Device Class: Miscellaneous,HCI Version: 2.1 (0x4) Revision: 0x149c LMP Version: 2.1 (0x4) Subversion: 0x149c Manufacturer: Cambridge Silicon Radio (10) rfcomm连接输出 # rfcomm connect 0 Can't connect RFCOMM socket: Operation now in progress hcitool cc输出 # hcitool cc 00:07:80:5A:48:93 Can't create connection: Connection timed out l2ping输出 # l2ping 00:07:80:5A:48:93 Can't connect: Invalid exchange 在谷歌搜索时,我发现唯一相关的thread表明rfcomm连接输出可能是由于内核2.6.27回归,但我的是3.10.28(使用uname -r). 任何帮助表示赞赏,谢谢! 编辑 解决方法
事实证明目标设备正在从我的i.MX25板请求验证.
通常,PIN码处理是通过使用bluetooth-agent完成的. 但是这个代理实际上没有安装在主板上(我以为是……),所以我不得不手动提供所要求的PIN码. 我就这样做了: >编辑/etc/bluetooth/rfcomm.conf,就像我之前做的那样 00:15:83:44:39:E2是本地设备的蓝牙地址 l2ping作品: # l2ping 00:07:80:5A:48:93 Ping: 00:07:80:5A:48:93 from 00:15:83:44:39:E2 (data size 44) ... 4 bytes from 00:07:80:5A:48:93 id 0 time 13.14ms 4 bytes from 00:07:80:5A:48:93 id 1 time 26.34ms rfcomm connect工作原理: # rfcomm connect 0 Connected /dev/rfcomm0 to 00:07:80:5A:48:93 on channel 1 Press CTRL-C for hangup 2015年5月15日更新 今天我再次尝试在目标设备上进行l2ping,如前所述.出于某种原因,它会给我一个“权限被拒绝”的错误. >保存/usr/var / lib / bluetooth / 00:15:83:44:39:E2 / pincodes在其他地方>删除/usr/var / lib / bluetooth / 00:15:83:44:39:E2下的所有内容>重新启动>将保存的密码文件放回/usr/var / lib / bluetooth / 00:15:83:44:39:E2>如前所述重试ping (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |