为什么用QT在Android上写的有关蓝牙程序,在不同手机上有的能用,有的不能用呢

hh8582 2014-12-03 02:19:39
最近用QT在Android上写蓝牙和单片机通过串口扩展的蓝牙模块通信,发现在有的手机上能运行,有的手机居然不行,连接蓝牙模块时提示以下提示,信息
W/System.err( 2356): java.io.IOException: [JSR82] connect: Connection is not created (failed or aborted).
W/System.err( 2356): at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:396)
W/System.err( 2356): at dalvik.system.NativeStart.run(Native Method)
I/BluetoothSocket_MTK( 2356): [JSR82] Bluetooth Socket Constructor
I/BluetoothSocket_MTK( 2356): [JSR82] type=1 fd=-1 auth=true encrypt=true port=-1
I/BluetoothSocket_MTK( 2356): [JSR82] connect: do SDP
I/BluetoothSocket_MTK( 2356): [JSR82] SdpHelper::onRfcommChannelFound: channel=-1
W/System.err( 2356): java.io.IOException: Service discovery failed
W/System.err( 2356): at android.bluetooth.BluetoothSocket$SdpHelper.doSdp(BluetoothSocket.java:814)
W/System.err( 2356): at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:383)
W/System.err( 2356): at dalvik.system.NativeStart.run(Native Method)
W/ResourceType( 2356): No package identifier when getting name for resource number 0x00000001
I/View ( 2356): Touch down dispatch to org.qtproject.qt5.android.QtSurface{411ce6a0 V.E..... ........ 0,0-1024,490 #1}, event = MotionEvent { action=ACTION_DOWN, id[0]=0, x[0]=943.07904, y[0]=425.22794, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=682683, downTime=682683, deviceId=2, source=0x1002 }
...全文
405 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
街头蚂蚁 2015-05-08
  • 打赏
  • 举报
回复
敢问解决了没有,我一个 hello world 都这样了
方骓与抛神 2015-05-08
  • 打赏
  • 举报
回复
请问使用qt使蓝牙的问题解决了么?

16,216

社区成员

发帖
与我相关
我的任务
社区描述
Qt 是一个跨平台应用程序框架。通过使用 Qt,您可以一次性开发应用程序和用户界面,然后将其部署到多个桌面和嵌入式操作系统,而无需重复编写源代码。
社区管理员
  • Qt
  • 亭台六七座
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧