Bluetooth: Core ver 2.10 NET: Registered protocol family 31 Bluetooth: HCI device and connection manager initialized Bluetooth: HCI socket layer initialized Bluetooth: L2CAP ver 2.8 Bluetooth: L2CAP socket layer initialized Bluetooth: RFCOMM socket layer initialized Bluetooth: RFCOMM TTY layer initialized Bluetooth: RFCOMM ver 1.8 Bluetooth: HIDP (Human Interface Emulation) ver 1.1 eth1: no IPv6 routers present usb 1-1: new full speed USB device using uhci_hcd and address 2 usb 1-1: configuration #1 chosen from 1 choice usb 1-2: new full speed USB device using uhci_hcd and address 3 Bluetooth: HCI USB driver ver 2.9 usb 1-2: configuration #1 chosen from 1 choice hub 1-2:1.0: USB hub found hub 1-2:1.0: 7 ports detected usbcore: registered new driver hci_usb hci_scodata_packet: hci0 SCO packet for unknown connection handle 20480 hci_scodata_packet: hci0 SCO packet for unknown connection handle 43088 hci_acldata_packet: hci0 ACL packet for unknown connection handle 0 hci_acldata_packet: hci0 ACL packet for unknown connection handle 0 hci_scodata_packet: hci0 SCO packet for unknown connection handle 20480 hci_scodata_packet: hci0 SCO packet for unknown connection handle 43088 hci_scodata_packet: hci0 SCO packet for unknown hci_scodata_packet: hci0 SCO packet for unknown connection handle 53248 usb 1-1: USB disconnect, address 2 usb 1-1: new full speed USB device using uhci_hcd and address 4 usb 1-1: configuration #1 chosen from 1 choice |
/usr/sbin/hciconfig : configure Bluetooth devices
/usr/bin/sdptool : control and interrogate SDP servers
#lsusb Bus 001 Device 004: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode) Bus 001 Device 003: ID 0e0f:0002 Bus 001 Device 001: ID 0000:0000 Bus 002 Device 001: ID 0000:0000 |
[root@huisen ~]# hciconfig |
hcid.conf rfcomm.conf
# HCId options # Security Manager mode # Pairing mode # Default PIN code for incoming connections |
service bluetooth start
hcitool scan Scanning ... 00:21:19:A4:E0:F1 Meizu M8 |
rfcomm0{ bind no; device 00:21:19:A4:E0:F1; channel 1; comment "Meizu M8"; } |
chmod 666 /dev/rfcomm0
三.关于蓝牙配置文件
-------------------------------------------
蓝牙的配置文件主要是 /etc/bluetooth目录下的hcid.conf和rfcomm.conf.
options { # Automatically initialize new devices autoinit yes; security user; |
这里的security 是表示配对的认证模式,user表示由用户输入密码。这个需要在后面用
pin_helper 指明用哪一个程序输入密码,这程序可以是图形界面程序,或者是字符界面程序。
常见的pin_helper有
/usr/bin/bluez-pin : bluez自带的pin输入界面
kbluepin
passkey 配置项指明请求联接的设备的pin码。当采用auto模式时,将采用这个密码来联接.