2

I have a BLE app that has hundreds of happy users on a variety of devices. Most of my testing has been done on Nexus devices, but a user reported an issue with HTC M8 so I just bought one. Sure enough, for some reason connectGatt isn't working. It doesn't throw any exceptions and the BluetoothGatt object it returns isn't null. But onConnectionStateChange in the BluetoothGattCallback I pass in is never called.

I found a few reports that some phones needed connectGatt to be called on the UI thread, so I tried that but nothing changed.

Here's the log I get:

D/BluetoothGatt: connect() - device: CE:FA:92:61:A3:4F, auto: false
D/BluetoothGatt: registerApp()
D/BluetoothGatt: registerApp() - UUID=f7a1a0e9-0d45-4b71-9457-9adf6ccb4bf8
D/BluetoothGatt: onClientRegistered() - status=0 clientIf=5

Then silence...

Any ideas? Thanks!

James Nick Sears
  • 930
  • 9
  • 16

1 Answers1

0

Can you connect to the same device from the M8 using another application like Nordic's nRF Master Control Panel?

Does the HCI snoop log contain anything relating to the issue?

Do you have access to a protocol analyser? This would at least let you see whether there's even an attempt to connect taking place.

  • Good idea. I tried and cannot connect to it from nRF MCP on the M8 in Android 6.0. It works fine on my Nexus 4 running 5.1.1 though. (FWIW the device is connectable in Android 6.0 for myself and many users as well on other devices). – James Nick Sears May 06 '16 at 11:34
  • Here's a screenshot from Wireshark with the HCI snoop log from the M8 while trying to make a connection (the device's mac address is visible in the frame on the highlighted line). http://files.cousins-sears.com/3Q3j0r1o1O3p It looks like the connection is attempted, and then cancelled 11 seconds or so later. Unfortunately, I do not have access to a protocol analyzer. – James Nick Sears May 06 '16 at 11:40
  • Can you share the details of that Command Status event please? It may contain a clue as to what's happening here. – martin_bluetooth_sig May 13 '16 at 08:49
  • Here are the details from that event: http://files.cousins-sears.com/0B2p200w0H0X And the whole log if you want to look at anything else: http://files.cousins-sears.com/0t1K2a32102H Thanks a lot! – James Nick Sears May 16 '16 at 15:03
  • Looks like Android 6 (at least on some phones) requires a device name in order to connect reliably. I found it in this thread: https://devzone.nordicsemi.com/question/55309/connection-issues-with-android-60-marshmallow-and-nexus-6/ Getting our devices in the field updated isn't going to be an easy task though, so if anyone has any ideas for a workaround, I'd really love to hear them. – James Nick Sears May 16 '16 at 19:29