我正在编写一个应用程序,它将平板电脑的字节代码发送到μ控制器.在联想A1(Androi 2.3)和三星Galaxy Tab 7 Plus N(Android 3.2)上一切正常.现在我遇到了新的三星Galaxy Tab 2(Android 4.0)的问题.
我能够配对蓝牙天线(连接到μ控制器并通过串行协议进行通信).当我启动应用程序时,我再次被要求输入密码并配对.输入配对密码后,我的主要布局可见,但未建立连接.
日食中的LogCat告诉我:
06-19 16:00:20.656: V/BluetoothSocket.cpp(3189): availableNative
06-19 16:00:20.664: V/BluetoothSocket.cpp(3189): abortNative
06-19 16:00:20.664: V/BluetoothSocket.cpp(3189): ...asocket_abort(49) complete
06-19 16:00:20.664: I/ActivityManager(185): No longer want com.google.android.partnersetup (pid 3220): hidden #16
06-19 16:00:20.671: V/BluetoothSocket.cpp(3189): availableNative
06-19 16:00:20.671: V/BluetoothSocket.cpp(3189): destroyNative
06-19 16:00:20.671: V/BluetoothSocket.cpp(3189): ...asocket_destroy(49) complete
06-19 16:00:20.679: D/KeyguardViewMediator(185): setHidden false
06-19 16:00:20.679: W/System.err(3189): java.io.IOException: socket closed
06-19 16:00:20.679: W/System.err(3189): at android.bluetooth.BluetoothSocket.available(BluetoothSocket.java:370)
06-19 16:00:20.679: W/System.err(3189): at android.bluetooth.BluetoothInputStream.available(BluetoothInputStream.java:40)
06-19 16:00:20.679: W/System.err(3189): at java.io.BufferedInputStream.available(BufferedInputStream.java:114)
06-19 16:00:20.687: W/System.err(3189): at ebs.alphadidact.control.ReceiveThread.run(ReceiveThread.java:79) …Run Code Online (Sandbox Code Playgroud)