* descriptor.
*/
chrc = notify_chrc_create(client, handle);
- if (!chrc)
+ if (!chrc) {
+ DBG(client, "Unable to locate characteristic at 0x%04x",
+ handle);
return 0;
+ }
}
/* Fail if we've hit the maximum allowed notify sessions */
}
/*
- * If the ref count > 1, then notifications are already enabled.
+ * If the ref count > 1, ccc handle cannot be found or registration
+ * callback is not set consider notifications are already enabled.
*/
- if (chrc->notify_count > 1 || !chrc->ccc_handle) {
+ if (chrc->notify_count > 1 || !chrc->ccc_handle || !callback) {
complete_notify_request(notify_data);
return notify_data->id;
}
}
#endif
+ if (queue_isempty(client->notify_list))
+ return;
+
bt_gatt_client_ref(client);
memset(&data, 0, sizeof(data));
void *user_data,
bt_gatt_client_destroy_func_t destroy)
{
- if (!client || !client->db || !chrc_value_handle || !callback)
+ if (!client || !client->db || !chrc_value_handle ||
+ (!callback && !notify))
return 0;
#ifdef TIZEN_FEATURE_BLUEZ_MODIFY