標籤:通訊 掃描 0ms pack bluetooth bridge ... can sla
載入模組:
# modprobe hci_usb
# modprobe rfcomm
# hciconfig hci0 up
# 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
linux 用藍芽和手機通訊