我的设备如下:
电脑:安装Ubuntu 6.06 (6.06版本内核已自带蓝牙模块)
手机: Nokia 5500
电脑上装有USB蓝牙适配器
1.配置/etc/bluetooth/hcid.conf
#
# HCI daemon configuration file.
#
# 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
#
#修改成auto模式
security auto;
# Pairing mode
# none – Pairing disabled
# multi – Allow pairing with already paired devices
# once – Pair once and deny successive attempts
pairing multi;
# Default PIN code for incoming connections
# 默认PIN码,与手机匹配时使用
passkey “1234”;
}
# Default settings for HCI devices
device {
# Local device name
# %d – device id
# %h – host name
# 设置PC端的蓝牙名称,可随意设置
name “%h-%d”;
# Local device class
class 0x3e0100;
# Default packet type
#pkt_type DH1,DM1,HV1;
# Inquiry and Page scan
iscan enable; pscan enable;
discovto 0;
# 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;
} 2.配置完成后,重启蓝牙服务
sudo /etc/init.d/bluetooth restart
3.手机连接PC端蓝牙设备,完成匹配,匹配时需要输入hcid.conf中的匹配码
4.配置/etc/bluetooth/rfcomm.conf
#
# RFCOMM configuration file.
#
rfcomm0 {
# Automatically bind the device at startup
bind yes;
# Bluetooth address of the device
# 手机端的蓝牙地址可以通过hcitool scan获得
device 00:18:0F:8B:B0:63;
# RFCOMM channel for the connection
channel 1;
# Description of the connection
comment “NOKIA 5500 Bluetooth device”;
}
配置完成后,可以用rfcomm connect 0连接手机
4.下载安装GNOME下的GUI蓝牙工具
sudo apt-get install gnome-bluetooth gnome-phone-manager
5.开启蓝牙文件共享服务
gnome-obex-server 用来接收手机端发送过来的文件
gnome-obex-send 发送文件到手机端,在gnome里也可以选择文件点右键发送到手机(发送为选择Bluetooth)
gnome-phone-manmager 启用后选择手机设置,可以通过PC端给朋友发短信
备注:gnome-obex-send找不到手机的解决办法
sudo hciconfig hci0 inqmode 0
Linux下手机与蓝牙连接配置方案
转载请注明出处:服务器评测 » Linux下手机与蓝牙连接配置方案
相关推荐
- 【新加坡高防服务器租用】1Gbps独享带宽 SSD固态硬盘 限时立减$50
- 【高性价比服务器】8GB内存 / 1Gbps带宽 / 足量IPv4与IPv6地址 / 反向解析支持 / 月付$54起
- ★ 高性价比独立服务器促销 ★ 月付仅28美元起 ★ 12TB大硬盘 + IPMI + 双倍内存/流量!
- 【闪购狂欢】仅$249独享10Gbps无限流量服务器,支持加密货币支付!
- Hivelocity黑色星期五钜惠:专属服务器享终身35%优惠或前半年5折抢购!
- 65美元/月:八核三十六G强劲配置,支持/24 IPv4子网租用。
- 新加坡/印尼独立服务器 ⚡ 今日下单仅 $49.5 ⚡ 限时特惠
- HC ★ AMD高性能独立服务器 ★ 覆盖阿什本、阿姆斯特丹、达拉斯、纽约、斯德哥尔摩、东京等多节点
服务器评测



