ConnectingUbuntuAndNokiaN70UsingBluetoothAndObex

来自Ubuntu中文
跳到导航跳到搜索

使用蓝牙连接 Nokia N70

原文出处:http://godiane.wordpress.com/2006/07/30/connecting-ubuntu-and-nokia-n70-using-bluetooth-and-obex/

原文作者:Diane

授权许可:

翻译人员:spider5

校正人员:

贡献人员:

适用版本: 文章状态:等待校正


这是我写的怎样连接我的手机和笔记本上的Ubuntu系统的方法:

0. 确信您的Ubuntu已经安装了bluez-utils。您可以使用新立得下载,或者代之以sudo apt-get install bluez-utils

0. 执行sudo /etc/init.d/bluez-utils restart重启您的蓝牙服务;

0. 执行hcitool scan检查您的笔记本是否能发现手机设备。在我的上面会提示类似这样的信息:

Scanning ... 00:13:B0:32:31:00 Diane Gonzales

0. 使用sdptool browse <bluetooth-ID>(i.e.00:13:B0:32:31:00)命令浏览您的电话服务;

提示的信息如下:

Service Name: Hands-Free Audio Gateway
Service RecHandle: 0x10000
Service Class ID List:
"Handfree Audio Gateway" (0x111f)
"Generic Audio" (0x1203)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 1
Language Base Attr List:
code_ISO639: 0x454e
encoding:    0x6a
base_offset: 0x100
Profile Descriptor List:
"Handfree Audio Gateway" (0x111f)
Version: 0x0101

Service Name: Headset Audio Gateway
Service RecHandle: 0x10001
Service Class ID List:
"Headset Audio Gateway" (0x1112)
"Generic Audio" (0x1203)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 2
Language Base Attr List:
code_ISO639: 0x454e
encoding:    0x6a
base_offset: 0x100
Profile Descriptor List:
"Headset" (0x1108)
Version: 0x0100

Service Name: OBEX File Transfer
Service RecHandle: 0x10002
Service Class ID List:
"OBEX File Transfer" (0x1106)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 10
"OBEX" (0x0008)
Language Base Attr List:
code_ISO639: 0x454e
encoding:    0x6a
base_offset: 0x100
Profile Descriptor List:
"OBEX File Transfer" (0x1106)
Version: 0x0100

Service Name: SyncMLClient
Service RecHandle: 0x10003
Service Class ID List:
"Error: This is UUID-128" (0x00000002-0000-1000-8000-0002ee000002)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 11
"OBEX" (0x0008)
Language Base Attr List:
code_ISO639: 0x454e
encoding:    0x6a
base_offset: 0x100
Profile Descriptor List:
"Error: This is UUID-128" (0x00000002-0000-1000-8000-0002ee000002)
Version: 0x0100

Service Name: Nokia OBEX PC Suite Services
Service RecHandle: 0x10004
Service Class ID List:
"Error: This is UUID-128" (0x00005005-0000-1000-8000-0002ee000001)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 12
"OBEX" (0x0008)
Language Base Attr List:
code_ISO639: 0x454e
encoding:    0x6a
base_offset: 0x100
Profile DescriptorList:
"Error: This is UUID-128" (0x00005005-0000-1000-8000-0002ee000001)
Version: 0x0100

Service Name: OBEX Object Push
Service RecHandle: 0x10005
Service Class ID List:
"OBEX Object Push" (0x1105)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 9
"OBEX" (0x0008)
Language Base Attr List:
code_ISO639: 0x454e
encoding:    0x6a
base_offset: 0x100
Profile Descriptor List:
"OBEX Object Push" (0x1105)
Version: 0x0100

Service Name: Imaging
Service RecHandle: 0x10006
Service Class ID List:
"Imaging Responder" (0x111b)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 15
"OBEX" (0x0008)
Language Base Attr List:
code_ISO639: 0x454e
encoding:    0x6a
base_offset: 0x100
Profile Descriptor List:
"Imaging" (0x111a)
Version: 0x0100

Service Name: Dial-Up Networking
Service RecHandle: 0x10007
Service Class ID List:
"Dialup Networking" (0x1103)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 3
Language Base Attr List:
code_ISO639: 0x454e
encoding:    0x6a
base_offset: 0x100
Profile Descriptor List:
"Dialup Networking" (0x1103)
Version: 0x0100

0. 设置您的rfcomm

vi /etc/bluetooth/rfcomm.conf

我把它改成这样:

rfcomm0 {
bind yes;
device 00:13:B0:32:31:00;  # Bluetooth address of the device
channel 14;                # RFCOMM channel for the connection
comment "Diane Gonzales";  # Description of the connection
}

rfcomm3 {
bind yes;
device 00:13:B0:32:31:00;
channel 10;
comment "OBEX File Transfer";
}

注意粗体字母要一致:

Service Name: OBEX File Transfer
Service RecHandle: 0x10002
Service Class ID List: “OBEX File Transfer” (0×1106)
Protocol Descriptor List:
“L2CAP” (0×0100)
“RFCOMM” (0×0003)
Channel: 10
“OBEX” (0×0008)
Language Base Attr List:
code_ISO639: 0×454e
encoding:    0×6a
base_offset: 0×100
Profile Descriptor List:
“OBEX File Transfer” (0×1106)
Version: 0×0100

rfcomm3{
bind yes;
device 00:13:B0:32:31:00;
channel 10;
comment “OBEX File Transfer”;
}

0. 重启bluez-utils.

0. 在命令提示符下输入下列命令:

rfcomm release 3
rfcomm connect 3

您的手机将会有反应。按照手机上的指示做,两者就连上了!

0. 您要想能从手机上传送文件,这样做:

gnome-obex-server
sudo vi /etc/bluetooth/hcid.conf

翻到Device小节,把其中内容改成:

# Local device class
class 0x100100

就可以了,:)