Prevent Issue fixes 28/189528/2
authorAbhishek Chandra <abhishek.ch@samsung.com>
Tue, 18 Sep 2018 09:45:32 +0000 (15:15 +0530)
committerAbhishek Chandra <abhishek.ch@samsung.com>
Tue, 18 Sep 2018 09:58:11 +0000 (15:28 +0530)
Prevent Issue fixes :
- 1026365
- 1026068
- 109410

Change-Id: Iadeeeb303ee008387ecb5299c08854b53ab90d7a
Signed-off-by: Abhishek Chandra <abhishek.ch@samsung.com>
src/bluetooth-adapter.c
src/bluetooth-hrp.c
test/bt_unit_test.c

index f53f221..5204eea 100644 (file)
@@ -787,7 +787,7 @@ int bt_adapter_foreach_profile_connected_devices(const char *profile_uuid,
                        ret = _bt_convert_address_to_string(&remote_address, remote_addr);
                        if (ret != BT_ERROR_NONE) {
                                BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret);
-                               return ret;
+                               break;
                        }
 
                        if (!callback(remote_address, user_data)) {
index 1f416d0..3df0e9d 100644 (file)
@@ -1102,7 +1102,10 @@ int bt_hrp_collector_set_notification(bt_hrp_collector_h collector,
        bt_gatt_h svc = NULL;
        bt_gatt_h chr = NULL;
        bt_gatt_h desc = NULL;
-       char *buf = (char *)&isNotify;
+       char buf[1];
+
+       if (isNotify == true) buf[0] = '1';
+       else buf[0] = '0';
 
        if (_bt_hrp_collector_find(collector_s->remote_address) == NULL)
                return BT_ERROR_NOT_INITIALIZED;
@@ -1125,7 +1128,7 @@ int bt_hrp_collector_set_notification(bt_hrp_collector_h collector,
                return error_code;
        }
 
-       bt_gatt_set_value(desc, buf, 2);
+       bt_gatt_set_value(desc, buf, 1);
 
        collector_s->char_update_cb = callback;
 
index 6f126a1..0b6249a 100644 (file)
@@ -2209,9 +2209,7 @@ void __bt_gatt_client_service_changed_cb(bt_gatt_client_h c,
 
        ret = bt_get_uuid_name(uuid, &svc);
        if (ret != BT_ERROR_NONE)
-               svc = g_strdup(uuid);
-
-       TC_PRT("Remote deivce [%s] : %s is %s", addr, svc,
+               TC_PRT("Remote device [%s] : %s is %s", addr, svc,
                        type == BT_GATT_CLIENT_SERVICE_ADDED ?
                        "Added" : "Removed");
        g_free(svc);