搜索
5 3200

蓝牙连接问题

outspaceman 于 2011-3-16 16:51 发表 [复制链接]

没有eoe的账号,级别还太低,出门如何吹牛逼?

您需要 登录 才可以下载或查看,没有帐号?免费加入

x
本帖最后由 outspaceman 于 2011-3-16 16:53 编辑

用android手机蓝牙连接远程蓝牙设备device出现错误。
UUID uuid = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
BluetoothSocket socket = device.createRfcommSocketToServiceRecord(uuid);
socket.connect();// 此处会报错误
log如下:
01-06 05:54:23.820: ERROR/BluetoothEventLoop.cpp(236): event_filter: Received signal org.bluez.Device:PropertyChanged from /org/bluez/5872/hci0/dev_00_1A_DC_18_BC_DD
01-06 05:54:23.820: DEBUG/BluetoothEventLoop(236): Device property changed:00:1A:DC:18:BC:DDproperty:Connected
01-06 05:54:23.830: INFO/BluetoothService(236): ACL connected, mAclLinkCount = 1
01-06 05:54:23.870: DEBUG/BluetoothScanModeSetReceiver(833): action : android.bluetooth.device.action.ACL_CONNECTED
01-06 05:54:23.900: DEBUG/BluetoothScanModeSetReceiver(833): Start BluetoothScanSetService.
01-06 05:54:23.900: DEBUG/BluetoothScanSetService(833): onCreate()
01-06 05:54:23.900: DEBUG/BluetoothScanSetService(833): onStartCommand()
01-06 05:54:23.900: DEBUG/BluetoothScanSetService(833): ScanRestart() Get pluralconnectstandby : 0
01-06 05:54:23.900: DEBUG/BluetoothScanSetService(833): scanMode : 21
01-06 05:54:23.900: DEBUG/BluetoothScanSetService(833): action : android.bluetooth.device.action.ACL_CONNECTED
01-06 05:54:23.900: DEBUG/BluetoothScanSetService(833): action : connected
01-06 05:54:23.900: DEBUG/LocalBluetoothManager(833): checkConnectDeviceByAcl() start.
01-06 05:54:23.900: DEBUG/LocalBluetoothManager(833): ACL none.
01-06 05:54:23.900: DEBUG/LocalBluetoothManager(833): needless setScan none
01-06 05:54:23.900: DEBUG/BluetoothScanSetService(833): Service stop.
01-06 05:54:23.900: DEBUG/BluetoothScanSetService(833): onDestroy()
01-06 05:54:23.940: WARN/(5858): process_service_search_attr_rsp len:0
01-06 05:54:23.940: WARN/(5858): cont_request_needed:0
01-06 05:54:23.980: WARN/(5858): sdp_disc_server_rsp disc_state:3
01-06 05:54:23.980: WARN/(5858): process_service_search_attr_rsp len:9
01-06 05:54:23.980: WARN/(5858): ID & len: 0x00-00-00-05
01-06 05:54:23.980: WARN/(5858): lists_byte_count:2
01-06 05:54:23.980: WARN/(5858): list_len: 0, list_byte_count: 2
01-06 05:54:23.980: WARN/(5858): list_len: 2(search_attr_rsp)
01-06 05:54:23.980: WARN/(5858): *p_reply:0(16)
01-06 05:54:23.980: WARN/(5858): cont_request_needed:0
01-06 05:54:23.980: WARN/(5858): process_service_search_attr_rsp
01-06 05:54:23.980: WARN/(5858): result :3500
01-06 05:54:23.980: WARN/(5858): list_len :0 cpy_len:0 raw_size:1024 raw_used:0
01-06 05:54:23.990: ERROR/DTUN_HCID4(5872): discovery unsuccessful!
有人能帮帮我吗?小弟实在是感激不尽啊。。
zchajax No.6 江湖开发者 发表于 2011-3-16 18:18:41 | 显示全部楼层
没研究过蓝牙  希望有牛人来解答
outspaceman No.5 砖家开发者 发表于 2011-3-16 18:22:05 | 显示全部楼层
回复 zchajax 的帖子

哈哈,谢了。。
i_android 游客 发表于 2011-3-28 17:08:46 | 显示全部楼层
不了解
tiantian29 No.1 开发小菜鸟 发表于 2011-7-8 11:17:25 | 显示全部楼层
不用uuid的方法
Method m = device.getClass().getMethod("createRfcommSocket",
                                        new Class[] { int.class });
                        // tmp = device.createRfcommSocketToServiceRecord(MY_UUID);
                        try {
                                tmp = (BluetoothSocket) m.invoke(device, 1);
                        } catch (IllegalArgumentException e) {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                        } catch (IllegalAccessException e) {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                        } catch (InvocationTargetException e) {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                        }
                        mmSocket = tmp;
haojunming No.4 中级开发者 发表于 2011-8-12 09:39:34 | 显示全部楼层
问一下,谁知道android蓝牙自动配对怎么实现,我的qq1149598411
您需要登录后才可以回帖 登录 | 免费加入

本版积分规则

发新帖
  • 回复
  • 点评
  • 评分
logo

联系我们 | android培训 | 手机版 |小黑屋 |    

Copyright © 2009 - 2014eoe.cn All Rights Reversed京ICP备11018032号-2京公网安备110105014978

快速回复 返回顶部 返回列表