Install
ThinkPad x61
NOKIA Mini N97
OS:RHEL 5.4 X64
Configure
配置文件
/etc/bluetooth/
|-- hcid.conf
`-- rfcomm.conf
配置
内核支持usb_hci rfcomm
软件bluez
加载模块
# modprobe hci_usb
# modprobe rfcomm
# hciconfig hci0 up
代码:
# hciconfig hci0 up
查看状况
[root@ns138 bluetooth]# hciconfig -a
hci0: Type: USB
BD Address: 00:1F:3A:EF:25:99 ACL MTU: 1017:8 SCO MTU: 64:1
UP RUNNING PSCAN ISCAN
RX bytes:2466 acl:12 sco:0 events:62 errors:0
TX bytes:695 acl:12 sco:0 commands:34 errors:0
Features: 0xff 0xff 0x8f 0xfe 0x9b 0xf9 0x00 0x80
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: SLAVE ACCEPT
Name: 'thinkpad'
Class: 0x120104
Service Classes: Networking, Object Transfer
Device Class: Computer, Desktop workstation
HCI Ver: 2.0 (0x3) HCI Rev: 0x212b LMP Ver: 2.0 (0x3) LMP Subver: 0x41d3
Manufacturer: Broadcom Corporation (15)
扫描周围蓝牙设备
[root@ns138 bluetooth]# hcitool scan
Scanning ...
34:7E:39:4E:96:DB At
Ping一下看看:
[root@ns138 bluetooth]# l2ping 34:7E:39:4E:96:DB (l2ping,是小写的L而不是数字1)
Ping: 34:7E:39:4E:96:DB from 00:1F:3A:EF:25:99 (data size 44) ...
0 bytes from 34:7E:39:4E:96:DB id 0 time 67.84ms
0 bytes from 34:7E:39:4E:96:DB id 1 time 23.99ms
0 bytes from 34:7E:39:4E:96:DB id 2 time 37.31ms
0 bytes from 34:7E:39:4E:96:DB id 3 time 8.48ms
0 bytes from 34:7E:39:4E:96:DB id 4 time 12.01ms
Recv failed: Connection reset by peer
本地主机配置文件(主机名等参数):
/etc/bluetooth/hcid.conf
PIN配对码所在文件:
/etc/bluetooth/pin
加载配置文件:
#hcid -f /etc/bluetooth/hcid.conf
阅读(1544) | 评论(0) | 转发(0) |