diff options
author | Seungyoun Ju <sy39.ju@samsung.com> | 2017-09-07 20:28:33 +0900 |
---|---|---|
committer | DoHyun Pyun <dh79.pyun@samsung.com> | 2017-09-12 18:44:22 +0900 |
commit | 8d1b54d0df28760d058b586459a94b3d73090e9f (patch) | |
tree | 38d8b00413ca82f965f5192deeac8188f4578c24 /src/bluetooth-common.c | |
parent | 2ff2128d396f4f39527d9f1afea5fdd0c5192adb (diff) | |
download | bluetooth-8d1b54d0df28760d058b586459a94b3d73090e9f.tar.gz bluetooth-8d1b54d0df28760d058b586459a94b3d73090e9f.tar.bz2 bluetooth-8d1b54d0df28760d058b586459a94b3d73090e9f.zip |
Fix : GATT client services are not updated
If GATT client handle is created during service discovery, some services
could not be imported. But there is no logic to refresh services once
discovery is done. This patch set a flag of services_discovered to false
if importing one of services is failed. So that, when service discovery
is done, it imports again services.
Change-Id: I366c09ed208e11b47423b034d01e288e09c1c0a7
Signed-off-by: Seungyoun Ju <sy39.ju@samsung.com>
Diffstat (limited to 'src/bluetooth-common.c')
-rw-r--r-- | src/bluetooth-common.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/bluetooth-common.c b/src/bluetooth-common.c index 94250f0..31ff603 100644 --- a/src/bluetooth-common.c +++ b/src/bluetooth-common.c @@ -1830,14 +1830,10 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us _bt_convert_address_to_string(&device_addr, (bluetooth_device_address_t *)(param->param_data)); client_s = (bt_gatt_client_s *)_bt_gatt_get_client(device_addr); - if (client_s && !client_s->services_discovered) { - if (_bt_gatt_client_update_services(client_s) != BT_ERROR_NONE) - BT_ERR("_bt_gatt_client_update_services failed"); - else - client_s->services_discovered = true; - } - if (client_s) + if (client_s) { client_s->connected = true; + _bt_gatt_client_update_services(client_s); + } if (event_index >= 0) cb = bt_event_slot_container[event_index].callback; if (cb) |