[TBT][BluetoothCallback][NonACR][TFIVE-14878, Fixed bluetooth callback print issue] 18/191518/2
authorAmritanshu Pandia <a.pandia1@samsung.com>
Thu, 18 Oct 2018 03:21:35 +0000 (08:51 +0530)
committerAmritanshu Pandia <a.pandia1@samsung.com>
Thu, 18 Oct 2018 04:00:39 +0000 (09:30 +0530)
Change-Id: I812fef901859d62500304db448d1d2b8f4be88ca
Signed-off-by: Amritanshu Pandia <a.pandia1@samsung.com>
release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk
release/binary-x86/org.tizen.tbtcoreapp-1.0.0-x86.tpk
tbtcoreapp/src/view/tbt-bluetooth-callback-view.c

index 398a13130a11c76453df761e6815b5e262f03573..d82b4d25ea1e2a696eecee260d2cdca70dbe1bb8 100755 (executable)
Binary files a/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk and b/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk differ
index 57a3b954ea444fd752a6cfb797e2c774bf0de628..0b94bcf98017cb8da3bf973762ade07de45f6d75 100755 (executable)
Binary files a/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-x86.tpk and b/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-x86.tpk differ
index 49df945436026858e3eb0c41583809786f30a6f2..4330d0d3c1888c089cab0e57a7ea15efbd1f7b42 100644 (file)
@@ -38,7 +38,7 @@
 struct _bluetooth_view
 {
        common_view* view;
-
+       bt_adapter_state_e adapter_state;
        Evas_Object *create_label;
 };
 
@@ -178,8 +178,20 @@ bluetooth_view *bluetooth_callback_view_add(Evas_Object *navi, tbt_info *tbt_inf
                elm_label_line_wrap_set(this->create_label, ELM_WRAP_WORD);
 
                char resultc[256] ={0,};
-               sprintf(resultc, "result = %s", "Maually ON bluetooth and pair this device with some other device");
-                ui_utils_label_set_text(this->create_label, resultc, "left");
+                ret = bt_adapter_get_state(&this->adapter_state);
+                 RETVM_IF(ret != BT_ERROR_NONE, NULL,"bt_adapter_get_state fail > Error = %d", get_bluetooth_error(ret));
+
+        //If the Bluetooth Service is not enabled
+                if(this->adapter_state == BT_ADAPTER_ENABLED)
+                {
+                        sprintf(resultc, "result = %s","BT_ERROR_NONE");
+                }
+                else
+                {
+                        sprintf(resultc, "result = %s","BT_ERROR_NOT_ENABLED");
+                }
+
+               ui_utils_label_set_text(this->create_label, resultc, "left");
                ret = bt_device_set_bond_created_cb(Bluetooth_bt_device_bond_created_cb_p, this);
                DBG("bt_device_set_bond_created_cb %d", ret);
                RETVM_IF(ret != BT_ERROR_NONE && ret != BT_ERROR_NOT_SUPPORTED, NULL, "bt_device_set_bond_created_cb failed : %s", get_bluetooth_error(ret));
@@ -205,8 +217,20 @@ bluetooth_view *bluetooth_callback_view_add(Evas_Object *navi, tbt_info *tbt_inf
                //ui_utils_guide_instruction_popup_button(navi, "Instructions:<br/>Test Type One<br/>1.Bluetooth On<br/>2. Destroy Bonding callback Invoked<br/><br/>Test Type Two<br/>1. Bluetooth Off<br/>2. Correct Error Message Displayed<br/><b>Note:You can also refer info section");
 
                char resultc[256] ={0,};
-               sprintf(resultc, "result = %s", "Maually ON bluetooth and invoke destroy bond callback");
-                ui_utils_label_set_text(this->create_label, resultc, "left");
+                ret = bt_adapter_get_state(&this->adapter_state);
+                 RETVM_IF(ret != BT_ERROR_NONE, NULL,"bt_adapter_get_state fail > Error = %d", get_bluetooth_error(ret));
+
+        //If the Bluetooth Service is not enabled
+                if(this->adapter_state == BT_ADAPTER_ENABLED)
+                {
+                        sprintf(resultc, "result = %s","BT_ERROR_NONE");
+                }
+                else
+                {
+                        sprintf(resultc, "result = %s","BT_ERROR_NOT_ENABLED");
+                }
+
+               ui_utils_label_set_text(this->create_label, resultc, "left");
                ret = bt_device_set_bond_created_cb(Bluetooth_bt_device_bond_created_cb_p, this);
                 DBG("bt_device_set_bond_created_cb %d", ret);
                 RETVM_IF(ret != BT_ERROR_NONE && ret != BT_ERROR_NOT_SUPPORTED, NULL, "bt_device_set_bond_created_cb failed : %s", get_bluetooth_error(ret));