Fix get_service_property timeout issue 56/227156/2
authorWootak Jung <wootak.jung@samsung.com>
Wed, 5 Feb 2020 04:04:38 +0000 (13:04 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Tue, 10 Mar 2020 05:33:43 +0000 (14:33 +0900)
Fix wrong memcmp logic

Change-Id: I1c3312c23af11dff218136843219e1530438dfba

bt-service-adaptation/services/gatt/bt-service-gatt.c

index 5491f5d..28ffbfb 100644 (file)
@@ -4343,7 +4343,7 @@ int _bt_gatt_get_all_characteristic(bluetooth_gatt_client_svc_prop_info_t *svc)
        if (req_info) {
                prop = (bluetooth_gatt_client_svc_prop_info_t*)req_info->user_data;
                if (prop && !memcmp(svc->device_address.addr, prop->device_address.addr, sizeof(bluetooth_device_address_t))
-                               && memcmp(prop->svc.uuid, svc->svc.uuid, BLUETOOTH_UUID_HEX_MAX_LEN)
+                               && !memcmp(prop->svc.uuid, svc->svc.uuid, BLUETOOTH_UUID_HEX_MAX_LEN)
                                && prop->svc.instance_id == svc->svc.instance_id) {
                        BT_INFO("Already Properties browsing for Primary Service ongoing for same remote GATT Server");
                        /* Return and wait for events to be sent to all apps */
@@ -4399,9 +4399,9 @@ int _bt_gatt_get_all_characteristic_properties(
        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 Properties browsing for Characteristic ongoing for same remote GATT Server");
                        /* Return and wait for events to be sent to all apps */