Does bluetooth hdp android 4.0 really work?

I am testing an HDP profile for Android 4.0. I think this does not work correctly, because I'm trying to use Nonin 9560BT, and it connects, but it does not send medical data to Android.

The problem is as follows:

First I initialize the bluetoothAdapter and I getProfileProxy.

After that, the device connects to android. I will catch ACL_CONNECTED with broadcastReceiver. I ask bluetoothHealth.getMainFD to open the message, but it says that Proxy is not connected to the service.

Finally, the device is disconnected.

Can anybody help me?

+4
source share
3 answers

As people ask questions about the HDP source, A & D posted it on github, find it here: https://github.com/andengineering/AD-HDP-Android-Demo

+1
source

It worked for me with A & D UA-767PBT-C without using Channel Connection, because the device automatically connects.

0
source

I managed to get a BluetoothHDP sample, but I had to connect the phone and UA-767PBT-C and add the following code:

 else if (prevState == BluetoothHealth.STATE_CHANNEL_CONNECTING && newState == BluetoothHealth.STATE_CHANNEL_CONNECTED) { if (config.equals(mHealthAppConfig)) { mChannelId = channelId; sendMessage(STATUS_CREATE_CHANNEL, RESULT_OK); (new ReadThread(fd)).start(); } else { sendMessage(STATUS_CREATE_CHANNEL, RESULT_FAIL); } 

to BluetoothHDPService.onHealthChannelStateChange() .

After that, I collected code that I could use from the sample, and changed it to fit my program.

0
source

Source: https://habr.com/ru/post/1386539/


All Articles