0

我切换到 Marshmallow 并将扫描 API 更新到版本 10.2.1.0。它在 Lollipop 中运行良好,但我在更新 Marshmallow 的应用程序时遇到了一些麻烦。我正在使用以下扫描仪型号:SocketMobile CHS 8Ci。我恢复出厂设置(通过扫描用户指南中的条形码),然后将其设置为 SPP 模式(通过扫描用户指南中的另一个条形码)。我从 Android 设置 -> 蓝牙将智能手机与其配对。

现在在我的应用程序中:我认为扫描 API 初始化正常(旧 API 中曾经有一个测试序列,但现在它已经消失了)。但是我得到了NOTIFY_SCANPI_INITIALIZED,我没有看到任何错误。但是在我的应用程序内部配对时出现问题并且扫描仪失去连接。

这是我的应用程序内部配对的 logcat:

I/System.out:      2
I/System.out:      4
I/System.out:      6
D/APP: Add a new command to send
D/APP: Add a new command to send
D/APP: There are some commands to send
D/APP: And this one has status=1 for command: 262416
I/System.out: About to do a set for ID:0x40110
D/APP: Complete event received for Context:example.app.CommandContext@efd0843
D/APP: Remove command from the list
D/APP: There are some commands to send
D/APP: And this one has status=1 for command: 1179921
I/System.out: About to do a set for ID:0x120111
D/APP: There are some commands to send
D/APP: And this one has status=2 for command: 1179921
D/APP: There are some commands to send
D/APP: And this one has status=2 for command: 1179921
E/BluetoothHelper: threadId-8329:disconnected: bt socket closed, read return: -1
W/BluetoothHelper: threadId-8329:Connection is lost
E/SktScanAPI: 1476527018622:18030272:SktScanAPI (0) !!Error!! Unable to read from Serial transport
E/SktScanAPI: 1476527018623:18030272:SktScanAPI (0) !!Error!! Error: -34 GetTransport().ReadBlock(pData,nWriteOffset,nReadSize)
E/SktScanAPI: 1476527018623:18030272:SktScanAPI (0) !!Error!! Error: -34 DoReadOperation(pbPacketReady,ppReadCompletionEvent)
E/SktScanAPI: 1476527018624:18030272:SktScanAPI (0) !!Error!! Error: -34 m_pProtocol.DoIoOperation(pbPacketReady,ppReadCompletionEvent,ppWriteCompletionEvent,ppPacketReadyToSend)
E/SktScanAPI: 1476527018624:18030272:SktScanAPI (0) !!Error!! Error: -34 pCurrentDeviceInterface.DoIoOperation(CPacketReady,pReadCompletionEvent,pWriteCompletionEvent,pPacketReadyEvent)
D/APP: Complete event received for Context:example.app.CommandContext@102c7f9
D/APP: Remove command from the list
D/APP: Add a new command to send
D/APP: There are some commands to send
D/APP: And this one has status=1 for command: -2141913085
I/System.out: About to do a set for ID:0x80550003
D/DEBUG: Paired with Socket CHS [A071E2]
V/RenderScript: 0x9fd51000 Launching thread(s), CPUs 4
W/BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback
D/APP: Complete event received for Context:example.app.CommandContext@41e05d8
D/APP: Remove command from the list

之后奇怪的事情发生了。我转到 Android 设置并忘记了设备。我单击刷新,该设备不再出现在列表中。我必须将其恢复出厂设置并返回 SPP 模式才能在列表中看到它。

4

1 回答 1

0

我认为这是没有权限。它需要gps权限并打开手机的gps。ps:Android 6.0以后需要在runtime请求权限。

于 2016-10-18T23:47:27.457 回答