From: nibha2 Date: Wed, 22 Aug 2018 04:51:40 +0000 (+0530) Subject: [TBT][bluetooth][Non-ACR][Destroy callback code and info section modified] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=301f324baa03d6410ee7c971d376dc3e6134ebab;p=test%2Ftct%2Fnative%2Fbehavior.git [TBT][bluetooth][Non-ACR][Destroy callback code and info section modified] Change-Id: I05d032b5b637593bef7164909c6d50e7a1c1d0fc Signed-off-by: nibha2 --- diff --git a/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk b/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk index 175295b..0d2c137 100755 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 diff --git a/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-x86.tpk b/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-x86.tpk index b2eb78a..4efcd81 100755 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 diff --git a/tbtcoreapp/src/model/tbt-list.c b/tbtcoreapp/src/model/tbt-list.c index 9ee5052..557a621 100644 --- a/tbtcoreapp/src/model/tbt-list.c +++ b/tbtcoreapp/src/model/tbt-list.c @@ -608,7 +608,8 @@ static tbt_info tbtapps[] = .icon_name = "dummy", .info = "Test Type One
" "1.Bluetooth On
" - "2. Destroy Bonding callback Invoked
" + "2.Connect with some device and then unpair with the same connected device
" + "3. Destroy Bonding callback Invoked
" "
Test Type Two
" "1. Bluetooth Off
" "2. Correct Error Message Displayed", @@ -2231,7 +2232,7 @@ static tbt_info tbtapps[] = .parent = "System Settings", .apptype = TBT_APP_SYSTEM_SETTINGS_TIMECHANGE, .icon_name = "dummy", - .info = "
1.Manually change settings for each item through device Settings.
2. Verify all the items' values.", + .info = "
1.sdb root on,sdb shell,vconftool set -t int memory/system/timechanged 10 -f.
", .result = 0 }, #endif diff --git a/tbtcoreapp/src/view/tbt-bluetooth-callback-view.c b/tbtcoreapp/src/view/tbt-bluetooth-callback-view.c index 8f73c47..49df945 100644 --- a/tbtcoreapp/src/view/tbt-bluetooth-callback-view.c +++ b/tbtcoreapp/src/view/tbt-bluetooth-callback-view.c @@ -43,7 +43,7 @@ struct _bluetooth_view }; static bool is_not_supported = false; -static const char *remote_address = "B8:5E:7B:E7:92:7D"; +static const char *remote_address; static void _app_destroy_cb(void* this); static void Bluetooth_bt_device_bond_created_cb_p(int result, bt_device_info_s * device_info, void *user_data); static void Bluetooth_bt_device_bond_destroyed_cb_p(int result, char *remote_address, void *user_data); @@ -178,6 +178,8 @@ 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_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)); @@ -189,10 +191,10 @@ bluetooth_view *bluetooth_callback_view_add(Evas_Object *navi, tbt_info *tbt_inf elm_object_text_set(popup, "Bluetooth is not supported"); RETVM_IF(!this->view, NULL,"Bluetooth is not supported"); } - ret = bt_device_create_bond(remote_address); - DBG("bt_device_create_bond %d", ret); - sprintf(resultc, "result = %s", get_bluetooth_error(ret)); - ui_utils_label_set_text(this->create_label, resultc, "left"); + //ret = bt_device_create_bond(remote_address); + //DBG("bt_device_create_bond %d", ret); + //sprintf(resultc, "result = %s", get_bluetooth_error(ret)); + //ui_utils_label_set_text(this->create_label, resultc, "left"); } else if (this->view->tbt_info->apptype == TBT_APP_BT_CALLBACK_DESTROY_BOND_TEST) @@ -203,8 +205,14 @@ bluetooth_view *bluetooth_callback_view_add(Evas_Object *navi, tbt_info *tbt_inf //ui_utils_guide_instruction_popup_button(navi, "Instructions:
Test Type One
1.Bluetooth On
2. Destroy Bonding callback Invoked

Test Type Two
1. Bluetooth Off
2. Correct Error Message Displayed
Note:You can also refer info section"); char resultc[256] ={0,}; - 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)); + sprintf(resultc, "result = %s", "Maually ON bluetooth and invoke destroy bond callback"); + 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)); + + //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)); if(ret == BT_ERROR_NOT_SUPPORTED) { @@ -213,14 +221,14 @@ bluetooth_view *bluetooth_callback_view_add(Evas_Object *navi, tbt_info *tbt_inf elm_object_text_set(popup, "Bluetooth is not supported"); RETVM_IF(!this->view, NULL,"Bluetooth is not supported"); } - ret = bt_device_create_bond(remote_address); - DBG("bt_device_create_bond %d", ret); - sprintf(resultc, "result = %s", get_bluetooth_error(ret)); - ui_utils_label_set_text(this->create_label, resultc, "left"); - - ret = bt_device_destroy_bond(remote_address); - sprintf(resultc, "result = %s", get_bluetooth_error(ret)); - ui_utils_label_set_text(this->create_label, resultc, "left"); + //ret = bt_device_create_bond(remote_address); + //DBG("bt_device_create_bond %d", ret); + //sprintf(resultc, "result = %s", get_bluetooth_error(ret)); + //ui_utils_label_set_text(this->create_label, resultc, "left"); + + //ret = bt_device_destroy_bond(remote_address); + //sprintf(resultc, "result = %s", get_bluetooth_error(ret)); + //ui_utils_label_set_text(this->create_label, resultc, "left"); } else if (this->view->tbt_info->apptype == TBT_APP_BT_CALLBACK_DISCOVER_DEVICES_TEST) @@ -360,6 +368,16 @@ static void Bluetooth_bt_device_bond_created_cb_p(int result, bt_device_info_s * char resultc[256] ={0,}; sprintf(resultc, "CreateBonding Callback Invoked with result = %s", get_bluetooth_error(result)); ui_utils_label_set_text(this->create_label, resultc, "left"); + remote_address = device_info->remote_address; + if (this->view->tbt_info->apptype == TBT_APP_BT_CALLBACK_DESTROY_BOND_TEST) + { + int 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)); + ret = bt_device_destroy_bond(device_info->remote_address); + sprintf(resultc, "result = %s", get_bluetooth_error(ret)); + ui_utils_label_set_text(this->create_label, resultc, "left"); + } + } /**