I am writing an Android BLE application, and I am trying to get the permissions of a certain characteristic. I have already managed to get the characteristic properties with characteristic.getProperties(), and it returns a non-zero value, however, when I use the getPermission() method it returns 0 even though I am sure that the characteristic has PERMISSION_WRITE_ENCRYPTED_MITM (0x00000040).
Here is a code snippet
// properties
int properties = ch.getProperties();
DebugWrapper.infoMsg("properties: " + properties, TAG); //returns non-zero value
// permissions
int permissions = ch.getPermissions();
DebugWrapper.infoMsg("permissions: " + permissions, TAG); //returns zero value
Am I doing something wrong? Is there a specific way to get the permissions of the characteristic or is this a problem with the android api?
I am using API 19 and testing my program on a Samsung Galaxy Note 3.
I appreciate any help.