Fix the advertisement fail issue 52/227252/1 accepted/tizen/5.5/unified/20200312.234620 submit/tizen_5.5/20200311.040814
authorDoHyun Pyun <dh79.pyun@samsung.com>
Wed, 11 Mar 2020 03:11:30 +0000 (12:11 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Wed, 11 Mar 2020 03:11:30 +0000 (12:11 +0900)
The comparision value for initial adv handle was wrong, this
patchset corrects the comparision value for adv handle.

Change-Id: I76abbec8972cdd6de2c8217620c0c95756a5b844
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
bt-service-adaptation/services/gatt/bt-service-gatt.c

index ed7122d..62283e1 100644 (file)
@@ -332,7 +332,7 @@ void _bt_check_adv_app_termination(const char *name)
                                __bt_remove_all_service_handles(app);
 
                                /* If Advertising is enabled, stop it */
-                               if (app->adv_handle > 0) {
+                               if (app->adv_handle != 0) {
                                        BT_INFO("Stop advertising on instance ID [%d]", app->instance_id);
                                        /* Disable adv if running */
                                        BT_INFO("Disable Advertising Adv Handle [%d] sender [%s]",
@@ -578,7 +578,7 @@ char * _bt_get_sender_and_handle(int server_instance, int *adv_handle)
        for (k = 1; k < MAX_APPS_SUPPORTED; k++) {
                info = &numapps[k];
 
-               if (info->instance_id == server_instance && info->adv_handle != -1) {
+               if (info->instance_id == server_instance && info->adv_handle != 0) {
                        *adv_handle = info->adv_handle;
                        BT_DBG("Server instance [%d] Adv handle [%d] Sender [%s]", server_instance, *adv_handle, info->sender);
                        return g_strdup(info->sender);