This sequence of adding characterstics and descriptor works with
Android and Tizen both.
If we use the previous sequence of adding characterstics and descriptor
then Android writes on wrong attribute handle and fails.
Reverting changes done in LE Server in this patch:
https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/
d7a3c45d3ab7d4a0ee01a3a4fb639f5ba7f366f8
https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/387
(cherry picked from commit
15e13a59345f37b53a6500fe7520d9e83d1da281)
Change-Id: I1e0a3a136a14807fc97d95c05116775421b73f51
Signed-off-by: agrkush <kush.agrawal@samsung.com>
Signed-off-by: Amit KS <amit.s12@samsung.com>
oc_mutex_lock(g_leCharacteristicMutex);
+ /**
+ * NOTE : Currently this sequence of adding characterstic works both on android and tizen.
+ * With previous logic it was faling on android in some devices giving wrong attribute
+ * handle error. This issue needs to be fixed in Android BT layer but we have applied
+ * workaround for now so that it should work with both Android and Tizen devices.
+ */
if (read)
{
+ g_gattReadCharPath = charPath;
+ } else {
char desc_value[2] = {0, 0}; // Notification enabled.
bt_gatt_h descriptor = NULL;
permissions = BT_GATT_PERMISSION_READ | BT_GATT_PERMISSION_WRITE;
CALEGetErrorMsg(ret));
return CA_STATUS_FAILED;
}
- g_gattReadCharPath = charPath;
- }
- else{
g_gattWriteCharPath = charPath;
}