Fix gatt write response not occur issue
[platform/core/connectivity/bluetooth-frwk.git] / bt-service-adaptation / services / gatt / bt-service-gatt.c
index 3fd405a..78368c9 100644 (file)
@@ -4466,9 +4466,9 @@ int _bt_gatt_read_characteristic_value(
        if (req_info) {
                prop = (bluetooth_gatt_client_char_prop_info_t*)req_info->user_data;
                if (prop && !memcmp(chr->device_address.addr, prop->device_address.addr, sizeof(bluetooth_device_address_t)) /* Address matched */
-                               && memcmp(chr->svc.uuid, prop->svc.uuid, BLUETOOTH_UUID_HEX_MAX_LEN) /* Service UUID matched */
+                               && !memcmp(chr->svc.uuid, prop->svc.uuid, BLUETOOTH_UUID_HEX_MAX_LEN) /* Service UUID matched */
                                && chr->svc.instance_id == prop->svc.instance_id /* Service Instance ID matched */
-                               && memcmp(chr->characteristic.uuid, prop->characteristic.uuid, BLUETOOTH_UUID_HEX_MAX_LEN) /* Characteristic UUID matched */
+                               && !memcmp(chr->characteristic.uuid, prop->characteristic.uuid, BLUETOOTH_UUID_HEX_MAX_LEN) /* Characteristic UUID matched */
                                && chr->characteristic.instance_id == prop->characteristic.instance_id) { /* Characteristic Instance ID matched */
                        BT_INFO("Already Characteristic value Read operation in progress for same remote GATT Server");
                        /* Return and wait for events to be sent to all apps */
@@ -4528,11 +4528,11 @@ int _bt_gatt_read_descriptor_value(
        if (req_info) {
                prop = (bluetooth_gatt_client_desc_prop_info_t*)req_info->user_data;
                if (prop && !memcmp(desc->device_address.addr, prop->device_address.addr, sizeof(bluetooth_device_address_t)) /* Address matched */
-                               && memcmp(desc->svc.uuid, prop->svc.uuid, BLUETOOTH_UUID_HEX_MAX_LEN) /* Service UUID matched */
+                               && !memcmp(desc->svc.uuid, prop->svc.uuid, BLUETOOTH_UUID_HEX_MAX_LEN) /* Service UUID matched */
                                && desc->svc.instance_id == prop->svc.instance_id /* Service Instance ID matched */
-                               && memcmp(desc->characteristic.uuid, prop->characteristic.uuid, BLUETOOTH_UUID_HEX_MAX_LEN) /* Characteristic UUID matched */
+                               && !memcmp(desc->characteristic.uuid, prop->characteristic.uuid, BLUETOOTH_UUID_HEX_MAX_LEN) /* Characteristic UUID matched */
                                && desc->characteristic.instance_id == prop->characteristic.instance_id /* Characteristic Instance ID matched */
-                               && memcmp(desc->descriptor.uuid, prop->descriptor.uuid, BLUETOOTH_UUID_HEX_MAX_LEN) /* Descriptor UUID matched */
+                               && !memcmp(desc->descriptor.uuid, prop->descriptor.uuid, BLUETOOTH_UUID_HEX_MAX_LEN) /* Descriptor UUID matched */
                                && desc->descriptor.instance_id == prop->descriptor.instance_id) { /* Descriptor Instance ID matched */
                        BT_INFO("Already Descriptor value Read operation in progress for same remote GATT Server");
                        /* Return and wait for events to be sent to all apps */
@@ -4690,11 +4690,11 @@ int _bt_gatt_write_characteristic_value_by_type(
        if (req_info) {
                prop = (bluetooth_gatt_client_char_prop_info_t*)req_info->user_data;
                if (prop && !memcmp(chr->device_address.addr, prop->device_address.addr, sizeof(bluetooth_device_address_t)) /* Address matched */
-                               && memcmp(chr->svc.uuid, prop->svc.uuid, BLUETOOTH_UUID_HEX_MAX_LEN) /* Service UUID matched */
+                               && !memcmp(chr->svc.uuid, prop->svc.uuid, BLUETOOTH_UUID_HEX_MAX_LEN) /* Service UUID matched */
                                && chr->svc.instance_id == prop->svc.instance_id /* Service Instance ID matched */
-                               && memcmp(chr->characteristic.uuid, prop->characteristic.uuid, BLUETOOTH_UUID_HEX_MAX_LEN) /* Characteristic UUID matched */
+                               && !memcmp(chr->characteristic.uuid, prop->characteristic.uuid, BLUETOOTH_UUID_HEX_MAX_LEN) /* Characteristic UUID matched */
                                && chr->characteristic.instance_id == prop->characteristic.instance_id) { /* Characteristic Instance ID matched */
-                       BT_DBG("Already Characteristic Write Value operation in progress for same remote GATT Server");
+                       BT_INFO("Already Characteristic Write Value operation in progress for same remote GATT Server");
                        /* Return and wait for events to be sent to all apps */
                        return BLUETOOTH_ERROR_NONE;
                }
@@ -4762,11 +4762,11 @@ int _bt_gatt_write_descriptor_value_by_type(
        if (req_info) {
                prop = (bluetooth_gatt_client_desc_prop_info_t*)req_info->user_data;
                if (prop && !memcmp(desc->device_address.addr, prop->device_address.addr, sizeof(bluetooth_device_address_t)) /* Address matched */
-                               && memcmp(desc->svc.uuid, prop->svc.uuid, BLUETOOTH_UUID_HEX_MAX_LEN) /* Service UUID matched */
+                               && !memcmp(desc->svc.uuid, prop->svc.uuid, BLUETOOTH_UUID_HEX_MAX_LEN) /* Service UUID matched */
                                && desc->svc.instance_id == prop->svc.instance_id /* Service Instance ID matched */
-                               && memcmp(desc->characteristic.uuid, prop->characteristic.uuid, BLUETOOTH_UUID_HEX_MAX_LEN) /* Characteristic UUID matched */
+                               && !memcmp(desc->characteristic.uuid, prop->characteristic.uuid, BLUETOOTH_UUID_HEX_MAX_LEN) /* Characteristic UUID matched */
                                && desc->characteristic.instance_id == prop->characteristic.instance_id /* Characteristic Instance ID matched */
-                               && memcmp(desc->descriptor.uuid, prop->descriptor.uuid, BLUETOOTH_UUID_HEX_MAX_LEN) /* Descriptor UUID matched */
+                               && !memcmp(desc->descriptor.uuid, prop->descriptor.uuid, BLUETOOTH_UUID_HEX_MAX_LEN) /* Descriptor UUID matched */
                                && desc->descriptor.instance_id == prop->descriptor.instance_id) { /* Descriptor Instance ID matched */
                        BT_INFO("Already Descriptor value Write operation in progress for same remote GATT Server");
                        /* Return and wait for events to be sent to all apps */