首页 新闻 会员 周边

android Bluetooth HDP 只能运行一次?

0
悬赏园豆:100 [已关闭问题] 关闭于 2012-07-31 17:56

我用android4.0自带的HDP demo连接欧姆龙血压计,只能在第一次运行接收数据,退出程序,重新打开,接收数据报错,错误信息:E/InputQueue-JNI(4476): channel '41304a38 com.example.bluetooth.health/com.example.bluetooth.health.BluetoothHDPActivity (client)' ~ Publisher closed input channel or an error occurred.  events=0x8。

为什么?

zhujinhu的主页 zhujinhu | 初学一级 | 园豆:29
提问于:2012-07-24 15:56
< >
分享
所有回答(1)
0

首先,要看一下bluetoothHDP的说明文档:

1 /*
2 A sample application that demonstrates how to communicate with a Bluetooth Health Device Profile (HDP) device. This feature is available on Android 4.0 (API level 14) or above platforms.
3 
4 The application manages connection with Bluetooth HDP-enabled devices. Possible device type include blood pressure monitor, glucose meter, thermometer, etc. Upon connection, the application retrieves raw data sent from the device. Note that in order to interpret the data, a parser that conforms to the IEEE 11073-xxxxx specifications would be required.
5 */

This feature is available on Android 4.0 (API level 14) or above platforms。这个很重要。

下面是连接成功的界面,

还有一点在AndroidManifest.xml中有没配置这个...

1     <uses-sdk android:minSdkVersion="14"
2               android:targetSdkVersion="14" />
3     <uses-permission android:name="android.permission.BLUETOOTH" />

如果上面都没错的话,试试重新启动设备再试一下....

希望大家多多交流:hongtenzone@foxmail.com

Hongten | 园豆:1768 (小虾三级) | 2012-07-24 18:44

我的android设备是4.0.3的,第一次可以接收数据,退出程序,重新打开报错,然后设备自动重启了

支持(0) 反对(0) zhujinhu | 园豆:29 (初学一级) | 2012-07-24 18:50

@zhujinhu: 还有一种方法,就是把安装的那个应用程序,卸载了,重新安装试试

支持(0) 反对(0) Hongten | 园豆:1768 (小虾三级) | 2012-07-24 19:44

@Hongten: 这个方法也试过了,不行。

支持(0) 反对(0) zhujinhu | 园豆:29 (初学一级) | 2012-07-25 09:06

@zhujinhu: 对不起,最近会了一次家乡,没来得及查看博客园信息,不知道你的问题有没得到解决,如果有可以分享一下吗?

支持(0) 反对(0) Hongten | 园豆:1768 (小虾三级) | 2012-08-27 19:09

@Hongten: 没解决,好像是系统底层的问题。

支持(0) 反对(0) zhujinhu | 园豆:29 (初学一级) | 2012-10-17 16:09
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册