Linux 使用Bluetooth与手机通信
发表于:2007-07-04来源:作者:点击数:
标签:
使用爱立信T68i、索爱T628与BilliontonUSBBluetoothAdapter在2.6.0内核下 测试 通过。 (本人购买的台产BilliontonUSBBluetoothAdapter有Win98/2k/xp的驱动和软件widcomm1.3.2.7,而要想在win2003下用的话需要最新版1.4.2.10,可这玩艺是需要license的,要想在L
使用 爱立信T68i、索爱T628 与 Billionton USB Bluetooth Adapter 在2.6.0内核下
测试通过。
(本人购买的台产Billionton USB Bluetooth Adapter有Win98/2k/xp的驱动和软件widcomm1.3.2.7, 而要想在win2003下用的话需要最新版1.4.2.10, 可这玩艺是需要license的,要想在LINUX下玩的可以参考一下)
内核支持usb_hci rfcomm
软件bluez
加载模块:
[code:1:3f91ddcbee]# modprobe hci_usb
# modprobe rfcomm
# hciconfig hci0 up[/code:1:3f91ddcbee]
[code:1:3f91ddcbee]# hciconfig hci0 up[/code:1:3f91ddcbee]
查看状况:
[code:1:3f91ddcbee]# hciconfig -a
hci0: Type: USB
BD Address: 00:10:60:A3:68:9F ACL MTU: 192:8 SCO MTU: 64:8
UP RUNNING PSCAN ISCAN
RX bytes:1860 acl:10 sco:0 events:88 errors:0
TX bytes:1432 acl:10 sco:0 commands:52 errors:0
Features: 0xff 0xff 0x0f 0x00
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: HOLD SNIFF PARK
Link mode: SLAVE A
CCEPT
Name: 'Debian'
Class: 0x000100
Service Classes: Unspecified
Device Class: Computer, Uncategorized
HCI Ver: 1.1 (0x1) HCI Rev: 0x20d LMP Ver: 1.1 (0x1) LMP Subver: 0x20d
Manufacturer: Cambridge Silicon Radio (10)[/code:1:3f91ddcbee]
扫描周围蓝牙设备:
[code:1:3f91ddcbee]# hcitool scan
Scanning...
00:80:37:B5:A8:3A T68i
00:0E:07:1C:AE:1D T628[/code:1:3f91ddcbee]
Ping一下看看:
[code:1:3f91ddcbee]# l2ping 00:0E:07:1C:AE:1D #(l2ping,是小写的L而不是数字1)
Ping: 00:0E:07:1C:AE:1D from 00:10:60:A3:68:9F (data size 20) ...
0 bytes from 00:0E:07:1C:AE:1D id 200 time 39.62ms
0 bytes from 00:0E:07:1C:AE:1D id 201 time 35.25ms
0 bytes from 00:0E:07:1C:AE:1D id 202 time 33.60ms
0 bytes from 00:0E:07:1C:AE:1D id 203 time 40.57ms
0 bytes from 00:0E:07:1C:AE:1D id 204 time 38.96ms
0 bytes from 00:0E:07:1C:AE:1D id 205 time 34.60ms
6 sent, 6 received, 0% loss[/code:1:3f91ddcbee]
本地主机配置文件(主机名等参数):
[code:1:3f91ddcbee]/etc/bluetooth/hcid.conf[/code:1:3f91ddcbee]
PIN配对码所在文件:
[code:1:3f91ddcbee]/etc/bluetooth/pin[/code:1:3f91ddcbee]
加载配置文件:
[code:1:3f91ddcbee]#hcid -f /etc/bluetooth/hcid.conf[/code:1:3f91ddcbee]
javascript:window.open(this.src);" style="CURSOR: pointer" onload="return imgzoom(this,550)">
|
|
fire9 回复于:2003-12-28 19:44:44 | 楼上的我的是T618,我有个蓝牙的USB,我怎么连?
| wangchao66 回复于:2003-12-28 19:48:24 | 用LINUX和手机通信?我还没听说过呢!
| aquino 回复于:2003-12-29 09:13:08 | [quote:e9486e0ad2="fire9"]楼上的我的是T618,我有个蓝牙的USB,我怎么连?[/quote:e9486e0ad2]
T618跟T628一样使用, 什么牌子的USB TB?
| aquino 回复于:2003-12-29 10:45:20 | 转眼功夫成精华啦,老板太给面子了
| grub007 回复于:2003-12-29 10:54:48 | 把你的更多更好的东西拿出来和大伙分享吧
| 弹头 回复于:2003-12-29 16:12:30 | 我用的就是T628手机,请问在那里能买到usb的蓝牙数据线?
| wheel 回复于:2003-12-29 16:24:41 | hciconfig那下的阿?
| aquino 回复于:2003-12-29 22:56:47 | [quote:db2039e228="弹头"]我用的就是T628手机,请问在那里能买到usb的蓝牙数据线?[/quote:db2039e228]
不是蓝牙数据线,而是USB接口的蓝牙适配器,就是插到USB上,发射无线信号。 这个东西在电脑市场一般有卖。
| aquino 回复于:2003-12-29 23:02:55 | [quote:792c0bbe4e="wheel"]hciconfig那下的阿?[/quote:792c0bbe4e]
安装BLUEZ。
如果你是DEBIAN,可以跟我一样直接安装 # apt-get install bluez*
如果是别的,到bluez的主页下载
| wheel 回复于:2003-12-31 13:09:56 | 到bluez的主页下载?给个链接好吗?
| aquino 回复于:2003-12-31 15:18:31 | [quote:a7fe54739d="wheel"]到bluez的主页下载?给个链接好吗?[/quote:a7fe54739d]
http://bluez.sourceforge.net/download/download.html
| wind521 回复于:2003-12-31 15:50:11 | 不错
| 天啸 回复于:2005-08-10 09:58:20 | 在http://www.bluez.org/download.html下载了驱动, * bluez-libs-2.18.tar.gz已安装 * bluez-utils-2.18.tar.gz已安装 * bluez-pin-0.25.tar.gz含有熟悉的蓝牙标志图片 * bluez-firmware-1.0.tar.gz安装
* bluez-hcidump-1.24.tar.gz已安装 * bluez-hciemu-1.2.tar.gz已安装
相关命令及结果如下: [root@lion root]# modprobe hci_usb [root@lion root]# modprobe rfcomm [root@lion root]# hciconfig hci0 up [root@lion root]# hciconfig -a hci0: Type: USB BD Address: 00:11:67:0C:19:B3 ACL MTU: 678:8 SCO MTU: 48:10 UP RUNNING PSCAN ISCAN INQUIRY RX bytes:623 acl:0 sco:0 events:14 errors:0 TX bytes:53 acl:0 sco:0 commands:14 errors:0 Features: 0xff 0xff 0x8d 0x78 0x08 0x18 0x00 0x00 Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 Link policy: Link mode: SLAVE ACCEPT Name: 'ISSCBTSPP' Class: 0x000000 Service Classes: Unspecified Device Class: Miscellaneous, HCI Ver: 1.2 (0x2) HCI Rev: 0x1ae LMP Ver: 1.2 (0x2) LMP Subver: 0x1ae Manufacturer: Integrated System Solution Corp. (57)
[root@lion root]# hcitool scan Scanning ... Inquiry failed: Connection timed out
可是试了几次都是连接超时?! 另外有几个文件不知谁配过吗?我只是在WIN下调试成功. 本地主机配置文件(主机名等参数): /etc/bluetooth/hcid.conf
PIN配对码所在文件: /etc/bluetooth/pin
加载配置文件: #hcid -f /etc/bluetooth/hcid.conf
|
原文转自:http://www.ltesting.net
|
|
|
|