4

As per title i am able to do read/write data successfully in below lollipop but in lollipop many times i am getting read/write fails.

this is how i am doing read/write data:

boolean isRead= getmBluetoothGatt().readCharacteristic(characteristic);

in lollipop devices i am getting isRead as false many times but it works perfectly on non lollipop os.

Does any one has faced such problem ? Answer will be greatly appreciated. Thanks.

  • what's the method you are using to scan for devices ?? – Fakher Oct 13 '15 at 09:41
  • Hello @brandy embedded i'm also facing same problem. can you please help me if you resolved that problem – Rajasekhar Aug 16 '16 at 07:25
  • Finally i found the solution. when arise this issue, you need to again discover services from stack then after you able to write/read operation successfully with end device. This issue comes when we perform Read/Write operation with end device and if service is not found from stack. – brandy embedded Nov 23 '16 at 05:27

2 Answers2

0

One of the reasons could be some of the API calls defined in Android Kitkat (APIlevel 19) have been deprecated in Lollipop versions(API level 22) with updated and additional features.You can go through the developer portal

https://developer.android.com/about/versions/android-5.0.html#Wireless to know more.

HRG
  • 182
  • 5
  • 16
0

I have two bluetooth devices that have problems on android Lollipop but both works fine on Kitkat. The two devices on Lollipop has different issues. The first device does not respond to device discovery after the the bluetooth gatt is connected and so the read characteristic won't work. The second device automatically disconnects from gatt server after it is connected to gatt and so it won't respond to device discovery and read characteristic as well. I was able to solve the issue on the first device by repeating device discovery with 2 seconds delay interval. But I have no chance to fix the problem on the second bluetooth device.

I am using Nexus 9.

d_air
  • 631
  • 1
  • 4
  • 12