首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >不能将Marshmallow中的套接字移动扫描仪与最新的扫描API (在Lollipop中与旧API一起工作得很好)

不能将Marshmallow中的套接字移动扫描仪与最新的扫描API (在Lollipop中与旧API一起工作得很好)
EN

Stack Overflow用户
提问于 2016-10-15 10:56:15
回答 1查看 290关注 0票数 0

我切换到Marshmallow,并将扫描API更新为10.2.1.0版本。它在棒棒糖很好,但我有一些困难,更新应用的Marshmallow。我使用的是以下扫描仪模型:SocketMobile CHS 8Ci。工厂重置(通过扫描用户指南中的条形码),然后将其设置为SPP模式(通过扫描用户指南中的另一个条形码)。我通过安卓设置->蓝牙将智能手机与其配对。

现在在我的应用程序中:我认为扫描API初始化OK (以前在旧API中有一个测试序列,但现在它已经消失了)。但是,我得到了NOTIFY_SCANPI_INITIALIZED,我没有看到任何错误。但是,当我的应用程序与扫描仪失去连接时,出现了一些问题。

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

代码语言:javascript
复制
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模式。

EN

回答 1

Stack Overflow用户

发布于 2016-10-18 23:47:27

我认为这是不允许的。它需要全球定位系统许可并打开手机的全球定位系统。Ps:在Android6.0之后,您需要在运行时请求权限。

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

https://stackoverflow.com/questions/40058162

复制
相关文章

相似问题

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