首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >连接到宏碁Iconia B1上的蓝牙时出错

连接到宏碁Iconia B1上的蓝牙时出错
EN

Stack Overflow用户
提问于 2013-03-09 05:43:15
回答 1查看 1.5K关注 0票数 3

感谢您关注我的问题。我在Arduino上使用RN42或HC05蓝牙模块开发了一个蓝牙应用程序。这将是一个我希望放在Play Store上的应用程序。这个应用程序似乎在我检查过的大多数平板电脑上都工作得很好,除了一台(我们想要使用的那台!)宏碁Iconia B1。

我从logCat得到的错误是:

代码语言:javascript
复制
03-08 21:35:10.972: I/BluetoothSocket_MTK(2712): [JSR82] Bluetooth Socket Constructor
03-08 21:35:10.972: I/BluetoothSocket_MTK(2712): [JSR82] type=1 fd=-1 auth=false encrypt=false port=1
03-08 21:35:10.973: D/ActivityThread(1708): BDC-Calling finishReceiver: IIntentReceiver=41441d20
03-08 21:35:10.974: D/BTSocketService(402): [JSR82][Service] initSocket
03-08 21:35:10.974: I/BluetoothSocketService.cpp(402): [JSR82][JNI] initSocketNative +++.
03-08 21:35:10.974: I/BluetoothSocketService.cpp(402): [JSR82][JNI] initSocketNative: start to initialize socket.
03-08 21:35:10.975: I/BluetoothSocketService.cpp(402): [JSR82][JNI] type=1, auth=0, encrypt=0, port=1
03-08 21:35:10.975: I/BluetoothSocketService.cpp(402): [JSR82][JNI] initSocketNative: Initialize socket done.
03-08 21:35:10.975: E/BluetoothSocketService.cpp(402): [JSR82][JNI] No free context space; the APP has registered 20 services.
03-08 21:35:10.975: I/BluetoothSocketService.cpp(402): [JSR82][JNI] initSocketNative ---. fdHandle=0
03-08 21:35:10.975: D/Bluetooth(2712): ++++ Connecting to 00:12:05:22:95:84
03-08 21:35:10.975: D/BTSocketService(402): [JSR82][Service] connect
03-08 21:35:10.975: I/BluetoothSocketService.cpp(402): [JSR82][JNI] connectNative +++. fd=0.
03-08 21:35:10.975: E/BluetoothSocketService.cpp(402): [JSR82][JNI] connectNative: The FD (0) doesn't exist.
03-08 21:35:10.976: W/System.err(2712): java.io.IOException: [JSR82] connect: Connection is not created (failed or aborted).
03-08 21:35:10.976: W/System.err(2712):     at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:395)
03-08 21:35:10.976: W/System.err(2712):     at com.test.BluetoothConnection.connectBluetooth(BluetoothConnection.java:100)
03-08 21:35:10.977: W/System.err(2712):     at com.test.BluetoothCounter$1.run(BluetoothCounter.java:64)
03-08 21:35:10.977: W/System.err(2712):     at java.lang.Thread.run(Thread.java:856)
03-08 21:35:10.977: D/dalvikvm(2712): threadid=13: exiting
03-08 21:35:10.977: D/dalvikvm(2712): threadid=13: bye!

我初始化蓝牙的代码:

代码语言:javascript
复制
   public boolean connectBluetooth() throws Exception, Exception{
        BT = BluetoothAdapter.getDefaultAdapter().getRemoteDevice(MacAddress);
        m = BT.getClass().getMethod("createInsecureRfcommSocket", new Class[] { int.class });
        mBluetoothAdapter.enable();
        sock = (BluetoothSocket) m.invoke(BT, 1);
        Log.d("Bluetooth", "++++ Connecting to " + MacAddress);
        sock.connect();
        Log.d("Bluetooth", "++++ Connected");
        connected = true;
        in = sock.getInputStream();
        return true;
    }

非常感谢您的帮助!

EN

回答 1

Stack Overflow用户

发布于 2013-09-17 22:30:57

最有可能的是,你要求的是宏碁Iconia B1没有的功能。

这款平板电脑要么不兼容蓝牙2.1 (first answer here),要么就是无法连接"A2DP立体声耳机“(上一篇here)以外的设备。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15303828

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档