[TBT][BluetoothCallback][NonACR][Fixed bluetooth on/off print issue] 20/191520/1
authorAmritanshu Pandia <a.pandia1@samsung.com>
Thu, 18 Oct 2018 04:08:24 +0000 (09:38 +0530)
committerAmritanshu Pandia <a.pandia1@samsung.com>
Thu, 18 Oct 2018 04:08:24 +0000 (09:38 +0530)
Change-Id: I24cb946862ef691650d9f7ae73cea0a1d8d0c104
Signed-off-by: Amritanshu Pandia <a.pandia1@samsung.com>
release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk
tbtcoreapp/src/view/tbt-bluetooth-callback-view.c

index 8cf1e7f80d494e76b2d530354392cedaebb8bfed..16a4fe79a93aa4286f9bf00d4f1e5a7d223c245c 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 978ea44e18a4961dcbe193a1883979e675f58cea..dbf5b4e7cc6f489b61b793bc52a8b9adb1252bd2 100644 (file)
@@ -38,7 +38,7 @@
 struct _bluetooth_view
 {
        common_view* view;
-
+       bt_adapter_state_e adapter_state;
        Evas_Object *create_label;
 };
 
@@ -180,8 +180,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. Create Bond with some device and Create 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",get_bluetooth_error(ret));
-                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));
@@ -207,8 +219,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. Create bond with device and destroy bond then 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",get_bluetooth_error(ret));
-                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_destroyed_cb(Bluetooth_bt_device_bond_destroyed_cb_p, this);
                RETVM_IF(ret != BT_ERROR_NONE && ret != BT_ERROR_NOT_SUPPORTED, NULL, "bt_device_set_bond_created_cb failed : %s", get_bluetooth_error(ret));