蓝牙鼠标bluetooth mouse的ubuntu 7.10开机自动连接方法指南(罗技v270)
发布时间:2008-02-07 00:59:56来源:红联作者:Dazkj
先装驱动
sudo apt-get install bluez-utils
sudo /etc/init.d/bluez-utils restart
然后
sudo hidd --server
sudo hidd --search
这一步以后应该可以找到蓝牙鼠标,并且显示出MAC码
修改/etc/default/bluetooth
# start bluetooth on boot?
# compatibility note: If this variable is not found bluetooth will
# start
BLUETOOTH_ENABLED=1
############ HIDD
#
# To have Bluetooth mouse and keyboard support, get the
# Linux 2.6.6 patch or better from bluez.org, and set
# HIDD_ENABLED to 1.
HIDD_ENABLED=1
HIDD_OPTIONS="--connect aa:bb:cc:dd:ee:ff --server"
aa:bb:cc:dd:ee:ff是鼠标的mac地址
修改完上面还不行,还要设置开机自动连接鼠标,google和baidu都没有找到真正的解决方法,这是我自己摸索出来的,也是实现开机自动连接蓝牙鼠标的关键步骤
编辑rc.local
$ sudo gedit /etc/init.d/rc.local
在后面加上
hciconfig hci0 down
hciconfig hci0 up
hidd --search
保存后重新起动
第一次会要求授权,选择总是授权,以后开机就会自动连接了
以上在富士通p1510笔记本电脑(没有内置蓝牙),IBM X40,水木行蓝牙适配器,罗技V270,ubuntu 7.10 环境下完成,设置好以后,每次重启系统,蓝牙鼠标都是自动找到,非常爽。
关于自动启动
我感觉加在rc.local不太好,因为这时候可能hidd服务还没有起来,所以楼主必须手动加上down和up。但是因为7.10似乎优化过启动顺序的,这样可能会延长启动时间。
我的做法是
A.建立一个文件/etc/init.d/xloadBluetooth.sh,内容是
hidd --search
B. 修改他的权限为777
sudo chmod 777 /etc/init.d/xloadBluetooth.sh
C. 建立一个软链接,让启动的时候,rc*脚本能运行他
sudo ln -sf /etc/init.d/xloadBluetooth.sh /etc/rcS.d/S99xloadBluetooth.sh
这样命名主要是为了让他能在启动的最后运行。