第六 蓝牙的配置文件
蓝牙的配置文件位于/etc/bluetooth目录下面。
hcid.conf # HCId options options { # Automatically initialize new devices autoinit yes; # Security Manager mode # none - Security manager disabled # auto - Use local PIN for incoming connections # user - Always ask user for a PIN # security user; |
这里最好改成user 一般的耳机在连接时都需要输入PIN,虽然第二次,选auto有时,经常会出现连不上死在那里的情况。
# Pairing mode # none - Pairing disabled # multi - Allow pairing with already paired devices # once - Pair once and deny successive attempts pairing multi; # PIN helper #pin_helper /usr/bin/bluez-pin; pin_helper /usr/lib/kdebluetooth/kbluepin; |
我用的是kde的蓝牙的framework,
pin helper,的作用是在蓝牙设备需要输入密码时,弹出对话框让你让打密码。
# D-Bus PIN helper #dbus_pin_helper; } # Default settings for HCI devices device { # Local device name # %d - device id # %h - host name name "%h-%d"; # Local device class class 0xff0100 |
oxff0100的意思是接受任何种类的蓝牙设备的连接,
0x200404 是指只接受audio/video device类的设备连接。
这个主要用于你有多台蓝牙设备时,想控制他们的互相连接时使用.
例如你有两台电脑,一个手机都带有蓝牙,而你只想让电话连到一台脑上,就可以使用这种方法来设置。
# Default packet type #pkt_type DH1,DM1,HV1; # Inquiry and Page scan iscan enable; pscan enable; # Default link mode # none - no specific policy # accept - always accept incoming connections # master - become master on incoming connections, # deny role switch on outgoing connections lm accept; # Default link policy # none - no specific policy # rswitch - allow role switch # hold - allow hold mode # sniff - allow sniff mode # park - allow park mode lp rswitch,hold,sniff,park; # Authentication and Encryption (Security Mode 3) auth enable; #encrypt enable; |
感觉还是打开验证的比较好,选AUTO,BT会记住以前的PAIR, 在连接蓝牙设备时,如果以前PAIR过了,就会直接用以前记住的PIN去连接,这个看上去不错,但我用下了经常会有连不上的情况。
}