1

I am using moto X play android 5.1.1 in android app i am doing below steps, 1) find ble device 2) connect 3)inside connect callback- discover services 4)inside onServicesDiscovered callback -gatt.getServices() & gattService.getCharacteristics() -> then-> read Characteristics * i am trying to read 12 Characteristics one by one. after call back of onCharacteristicRead first , i will read second Characteristics and so on..

i am facing issue in step 4. some time it is reading 1 Characteristics, some time 2, some time it is directly disconnecting.

i checked in 2 different device MI redmi 3 , and moto x play .. same issue happening.

in nexus 5x,android 6.0 this issue is not happening, i am able to read all Characteristics.

Parth
  • 1,908
  • 1
  • 19
  • 37
  • Seems you have an unstable BLE radio connection. Could you check the status parameter in the onConnectionStateChange callback if it's 8? That means the connection was lost. – Emil May 19 '16 at 19:34
  • 1
    onCharacteristicRead i am getting status =133 after that BluetoothGatt: onClientConnectionState() - status=22 clientIf=6 device=C4:BE:84:34:63:04 – Parth May 20 '16 at 07:01
  • Status 22 means "Connection terminated by local host", which means your phone actively disconnected the link, for some reason. Is logcat showing you some kind of reason? – Emil May 20 '16 at 07:05
  • after connected callback connection connection will work for only 670 milliseconds , after that it will immediately disconnect in "MI" device – Parth May 20 '16 at 07:21
  • for every callback of onCharacteristicRead i am getting this error log also E/: GKI_timer_update no work to be done when expected work – Parth May 20 '16 at 07:23
  • The ble stack on Android is very unstable, we had some success by adding small breaks between the different steps, maybe it helps you too. Just wait ~100 ms before reading the next characteristic. – p2pkit May 20 '16 at 13:04
  • delay is also not working, i am checking packets in packet sniffer , then for both device packets are coming different , diffrence is (for MOTO-not working device is reading att_read_by_group_type_req) but in nexus 5x -working device (ATT_read_req) i don't know what it means – Parth May 23 '16 at 13:16
  • was anyone able to fix this? – daniel metlitski Oct 03 '16 at 22:53
  • this issue due to problem during renew connection interval. this packet will send by BLE device. so changed in firmware its works fine for me. – Parth Oct 04 '16 at 06:50
  • I am not sure, but i think slave latency is one of parameter will affect on this issue in firmware side. – Parth Oct 04 '16 at 06:55
  • 1
    Do you solve that issue? I am having same issue `status=22 clientIf=6` – Jame Dec 03 '16 at 13:13
  • @user8430 For me this issue was happening only for selected devices. this issue is solved by change in firmware for renew connection interval. while your ble device is in connected state. – Parth Dec 08 '16 at 06:57
  • Yes. I am also happens in some device such as Galaxy S3. Change firmware means change the OS version such as Android L, Android M.... – Jame Dec 08 '16 at 07:24
  • @user8430 change firmware means not to change OS of android mobile phone. here we are using 1 ble device like fitness watch,heart rate monitor etc. in that we are using firmware that will control advertisement frequency (how frequent device should advertise )and data to send and many more things. – Parth Dec 08 '16 at 09:59
  • @Parth@Jame Hi i am facing the gatt 22 disconnection problem now . I searched a lot didn't find any solution. Help could be appreciated my question is here https://stackoverflow.com/q/47596419/4111151 – prasanthMurugan Dec 04 '17 at 05:27

0 Answers0