Linux下使用蓝牙(ZT)

使用 爱立信T68i、索爱T628 与 Billionton USB Bluetooth Adapter 在Debian Kernel-2.6.0内核下测试通过。

(本人购买的台产Billionton USB Bluetooth Adapter有Win98/2k/xp的驱动和软件widcomm1.3.2.7, 而要想在win2003下用的话需要最新版1.4.2.10, 可这玩>艺是需要license的,要想在LINUX下玩的可以参考一下)

内核支持usb_hci rfcomm
软件bluez

加载模块:
# modprobe hci_usb
# modprobe rfcomm
# hciconfig hci0 up

查看状况:
# hciconfig -a
hci0: Type: USB
BD Address: 00:10:60:A3:68:9F ACL MTU: 192:8 SCO MTU: 64:8
UP RUNNING PSCAN ISCAN
RX bytes:1860 acl:10 sco:0 events:88 errors:0
TX bytes:1432 acl:10 sco:0 commands:52 errors:0
Features: 0xff 0xff 0x0f 0x00
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: HOLD SNIFF PARK
Link mode: SLAVE ACCEPT
Name: 'Debian'
Class: 0x000100
Service Classes: Unspecified
Device Class: Computer, Uncategorized
HCI Ver: 1.1 (0x1) HCI Rev: 0x20d LMP Ver: 1.1 (0x1) LMP Subver: 0x20d
Manufacturer: Cambridge Silicon Radio (10)

扫描周围蓝牙设备:
# hcitool scan

Scanning...
00:80:37:B5:A8:3A T68i
00:0E:07:1C:AE:1D T628

Ping一下看看:
# l2ping 00:0E:07:1C:AE:1D #(l2ping,是小写的L而不是数字1)
Ping: 00:0E:07:1C:AE:1D from 00:10:60:A3:68:9F (data size 20) ...
0 bytes from 00:0E:07:1C:AE:1D id 200 time 39.62ms
0 bytes from 00:0E:07:1C:AE:1D id 201 time 35.25ms
0 bytes from 00:0E:07:1C:AE:1D id 202 time 33.60ms
0 bytes from 00:0E:07:1C:AE:1D id 203 time 40.57ms
0 bytes from 00:0E:07:1C:AE:1D id 204 time 38.96ms
0 bytes from 00:0E:07:1C:AE:1D id 205 time 34.60ms
6 sent, 6 received, 0% loss

本地主机配置文件(主机名等参数):
/etc/bluetooth/hcid.conf

PIN配对码所在文件:
/etc/bluetooth/pin

加载配置文件:
#hcid -f /etc/bluetooth/hcid.conf

技术相关: