This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Android, Ble and pairing

Hello.

Some months ago I open this thread.

Yesterday talking with one member of android team, told me that the problem with "pairing/bond" persists with few Huawei phone of the company.

Let me explain what problem is:

Our app scan ble devices over the air, when device is found, connection is established in order to read/write characteristics from a service. The issue with some Huawei phone is, when pair/bond has not been done, the android is never notified when characteristics has changed so the app breaks.

We have two approaches to solve this:

1. The first one, tell the user to do pairing process manually entering Bluetooth configuration of android system. After that, open our app use it.

2. Do the pairing process by code telling the system to do the process without user interaction before continue with our app.

The hardware always reject this request type. The questions I have is, if this has happen to anyone before, if this approach is correct, or we are missing something.

Thanks in advance.

Parents Reply Children
  • Hi.

    After some research, when writing to characteristics the function is called with WRITE_TYPE_DEFAULT flag. The next state of the ble phone is busy, waiting for ack that never arrives, so the next characteristic write is never written.

    Changing this flag to WRITE_TYPE_NO_RESPONSE, the state is not busy, and the process is done succesfully.

    The thing does not end here. If we disable and enable again the Bluetooth, the phone never connects with hardware. I think, this behaviour can be related with the issue which is described in chapter 3 of this document because if bond is done programatically or manually, the phone can connect with hardware.

    The question what we are asking now is. Where and how can be ACK done on hardware?

    Thanks.

    Andres.

Related