4

I encounter some weird behaviour on Android Bluetooth LE (using an Android 4.4.2 device from Samsung, and a 4.4.4 device from Google).

After connecting to a bluetooth low energy device, discovering services and then reading a characteristic, in the callback event the code BluetoothGattCharacteristic.getPermissions() always returns zero. The code BluetoothGattCharacteristic.getProperties() does return expected return values.

What is the difference between PERMISSION_READ and PROPERTY_READ in Android BluetoothGattCharacteristic? And why does getPermissions() always returns zero? What does this mean?

matcauthon
  • 2,261
  • 1
  • 24
  • 41
  • 1
    I had the same problem with the getPermissions() method and it looks like it's an android API problem, have a look at the answer to this SO question: http://stackoverflow.com/questions/23674668/android-bluetooth-low-energy-characteristic-getpermissions-returns-0 – KikiTheMonk Oct 23 '14 at 23:14

1 Answers1

2

PERMISSION_READ is the operation that allows someone or something to read.

PROPERTY_READ is the property that something has to be readable.

Something can be readable but maybe you cannot read it because of your permissions.

I think that is quite normal that using getProperties you get expected values.

About getPermissions() if your returned value is 0. That means that you don't have any permissions.

https://developer.android.com/reference/android/bluetooth/BluetoothGattCharacteristic.html

Alfaplus
  • 1,713
  • 2
  • 19
  • 29
  • But i have all the rights. The peripheral is configured to 'read', 'write', 'writeWithoutResponse', 'notify' without securing this operations. I'm also able to do these operations on Android. – matcauthon Oct 23 '14 at 08:54