Fix the issue on AppControl share (BT) operation
[platform/core/connectivity/bluetooth-frwk.git] / test / bluetooth-frwk-test.c
index eeeda98..31d934b 100644 (file)
@@ -189,55 +189,13 @@ tc_table_t tc_table[] = {
        {"bluetooth_gatt_unregister_service", 99},
        {"bluetooth_gatt_delete_services", 100},
 
-#if 0
-       {"bluetooth_rfcomm_is_server_uuid_available"    , 26},
-
-       {"bluetooth_hdp_activate"       , 30},
-       {"bluetooth_hdp_deactivate"     , 31},
-       {"bluetooth_hdp_connect"        , 32},
-       {"bluetooth_hdp_disconnect"     , 33},
-       {"bluetooth_hdp_send_data"      , 34},
-
-       {"bluetooth_opc_init"           , 35},
-       {"bluetooth_opc_push_file"      , 36},
-       {"bluetooth_opc_cancel_push"    , 37},
-       {"bluetooth_opc_deinit"         , 38},
-       {"bluetooth_obex_server_init"   , 39},
-       {"bluetooth_obex_server_deinit" , 40},
-       {"bluetooth_obex_server_accept_authorize"       , 41},
-       {"bluetooth_obex_server_reject_authorize"       , 42},
-       {"bluetooth_is_supported"       , 43},
-       {"bluetooth_opc_session_is_exist"       , 46},
-       {"bluetooth_obex_server_is_activated"   , 47},
-       {"bluetooth_obex_server_cancel_transfer"        , 48},
-
-       {"bluetooth_oob_read_local_data"        , 50},
-       {"bluetooth_oob_add_remote_data"        , 51},
-       {"bluetooth_oob_remove_remote_data"     , 52},
-
-       {"bluetooth_network_activate_server"    , 60},
-       {"bluetooth_network_deactivate_server"  , 61},
-       {"bluetooth_network_connect"    , 62},
-       {"bluetooth_network_disconnect" , 63},
-
-       {"bluetooth_gatt_discover_primary_services", 64},
-       {"bluetooth_gatt_discover_service_characteristics",     65},
-       {"bluetooth_gatt_get_service_property",         66},
-       {"bluetooth_gatt_get_characteristics_value",    67},
-       {"bluetooth_gatt_set_characteristics_value",    68},
-#endif
        /* -----------------------------------------*/
        {"Finish"                                                       , 0x00ff},
        {NULL                                                           , 0x0000},
 
 };
 
-#if 0
-#define tc_result(success, tc_index) \
-       TC_PRT("Test case [%d - %s] %s", tc_table[tc_index].tc_code, tc_table[tc_index].tc_name, ((success == TC_PASS) ? "Success" : "Failed"));
-#else
 #define tc_result(success, tc_index)
-#endif
 
 bluetooth_device_info_t bond_dev;
 int is_bond_device = FALSE;
@@ -562,7 +520,7 @@ int test_input_callback(void *data)
                ret = bluetooth_authorize_device(&device_address, FALSE);
                if (ret < 0)
                        TC_PRT("%s failed with [0x%04x]", tc_table[23].tc_name, ret);
-                       break;
+               break;
        }
        case 25:
        {
@@ -1144,36 +1102,48 @@ int test_input_callback(void *data)
 
        case 92:
        {
+/*
+#if TODO_40
                ret = bluetooth_gatt_init();
                if (ret < 0)
                        TC_PRT("gatt init failed with [0x%04x]", ret);
+#endif
+*/
                break;
        }
 
        case 93:
        {
+/*
+#if TODO_40
                ret = bluetooth_gatt_deinit();
                if (ret < 0)
                        TC_PRT("gatt deinit failed with [0x%04x]", ret);
-
+#endif
+*/
                break;
        }
 
        case 94:
        {
+/*
+#if TODO_40
                char *service_uuid = g_strdup("00001802-0000-1000-8000-00805f9b34fb");
 
                ret = bluetooth_gatt_add_service(service_uuid,
                        &svc_obj_path);
 
                TC_PRT("service obj_path is %s", svc_obj_path);
-
+#endif
+*/
                break;
        }
 
        case 95:
        {
+/* #if TODO_40 */
                /* testing with dummy values*/
+/*
                char *char_uuid = g_strdup("00002a06-0000-1000-8000-00805f9b34fb");
                bt_gatt_permission_t perms = 0;
                bt_gatt_characteristic_property_t props = BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_READ |
@@ -1186,60 +1156,78 @@ int test_input_callback(void *data)
                        perms, props, &char_obj_path);
 
                TC_PRT("characteristic obj_path is %s", char_obj_path);
-               g_free(char_uuid);
+#endif
+*/
                break;
        }
 
        case 96: {
+/*
+#if TODO_40
                char *desc_uuid = g_strdup("000026ff-0000-1000-8000-00805f9b34fb");
                bt_gatt_permission_t perms = BLUETOOTH_GATT_PERMISSION_READ |
-                       BLUETOOTH_GATT_PERMISSION_WRITE;
+                               BLUETOOTH_GATT_PERMISSION_WRITE;
 
                ret = bluetooth_gatt_add_descriptor(char_obj_path,
-                               desc_uuid, perms, &desc_obj_path);
-
+                       desc_uuid, perms, &desc_obj_path);
                TC_PRT("add descriptor error is %d", ret);
-               g_free(desc_uuid);
+#endif
+*/
                break;
        }
 
        case 97: {
+/*
+#if TODO_40
                ret = bluetooth_gatt_register_service(svc_obj_path);
                TC_PRT("register service error is %d", ret);
-
+#endif
+*/
                break;
        }
 
        case 98: {
+/*
+#if TODO_40
                ret = bluetooth_gatt_register_application();
 
                TC_PRT("register service error is %d", ret);
-
+#endif
+*/
                break;
        }
 
        case 99: {
+/*
+#if TODO_40
                char char_data[4] = {10, 20, 30, 40};
                int char_length = 4;
                ret = bluetooth_gatt_update_characteristic(char_obj_path,
                                        char_data, char_length);
 
                TC_PRT("update_characteristic error is %d", ret);
-
+#endif
+*/
                break;
        }
 
        case 100: {
+/*
+#if TODO_40
                ret = bluetooth_gatt_unregister_service(svc_obj_path);
                TC_PRT("service removed with error is %d", ret);
-
+#endif
+*/
                break;
        }
 
        case 101:
+/*
+#if TODO_40
                ret = bluetooth_gatt_delete_services();
                TC_PRT("services deleted with error is %d", ret);
-
+#endif
+*/
                break;
 
        default:
@@ -1392,25 +1380,6 @@ void bt_event_callback(int event, bluetooth_event_param_t* param, void *user_dat
        {
                // bluetooth_get_bonded_device_list is changed as synchronous API. This event is not used any more.
                // 2011.01.06
-#if 0
-//             int i = 0;
-               TC_PRT("BLUETOOTH_EVENT_BONDED_DEVICE_FOUND, result [0x%04x]", param->result);
-               if (param->result >= BLUETOOTH_ERROR_NONE) {
-                       ///tc_result(TC_PASS, 15);
-                       bluetooth_device_info_t * bt_dev_info = (bluetooth_device_info_t*)param->param_data;
-                               TC_PRT("Dev Name = %s, Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X, COD (major,minor,service)= 0x%x:%x:%x\n", bt_dev_info->device_name.name,
-                               bt_dev_info->device_address.addr[0], bt_dev_info->device_address.addr[1], bt_dev_info->device_address.addr[2], \
-                               bt_dev_info->device_address.addr[3], bt_dev_info->device_address.addr[4], bt_dev_info->device_address.addr[5], \
-                               bt_dev_info->device_class.major_class, bt_dev_info->device_class.minor_class, bt_dev_info->device_class.service_class);
-
-               } else if (param->result == BLUETOOTH_ERROR_END_OF_DEVICE_LIST) /*End of the Device found indication*/ {
-                       tc_result(TC_PASS, 15);
-                       TC_PRT("*****<<No more BLUETOOTH_EVENT_BONDED_DEVICE_FOUND indication>>***** ");
-               } else {
-                       tc_result(TC_FAIL, 15);
-                       TC_PRT("*****API failed ***** ");
-               }
-#endif
                break;
        }
 
@@ -1594,100 +1563,6 @@ void bt_event_callback(int event, bluetooth_event_param_t* param, void *user_dat
        {       TC_PRT("BLUETOOTH_EVENT_MANUFACTURER_DATA_CHANGED");
                break;
        }
-#if 0
-       case BLUETOOTH_EVENT_GATT_PRIM_SVC_DISCOVERED:
-       {
-               TC_PRT("BLUETOOTH_EVENT_GATT_PRIM_SVC_DISCOVERED");
-               bt_gatt_handle_info_t *prim_svc = param->param_data;
-               int i;
-
-               if (prim_svc == NULL) {
-                       TC_PRT("prim_svc is NULL");
-                       break;
-               }
-
-               for (i = 0; i < prim_svc->count; i++)
-                       TC_PRT("prim_svc[%d] = %s\n", i, prim_svc->handle[i]);
-
-               break;
-       }
-
-       case BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED:
-       {
-               TC_PRT("BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED");
-               bt_gatt_discovered_char_t *svc_char = param->param_data;
-               int i = 0;
-
-               if (svc_char == NULL) {
-                       TC_PRT("svc_char is NULL");
-                       break;
-               }
-
-               if (svc_char->service_handle != NULL)
-                       TC_PRT("svc_char->service_handle %s \n", svc_char->service_handle);
-
-               for (i = 0; i < svc_char->handle_info.count; i++)
-                       TC_PRT("svc_char.handle_info.handle[%d] = %s\n", i, svc_char->handle_info.handle[i]);
-
-               break;
-       }
-
-       case BLUETOOTH_EVENT_GATT_SVC_PROP_RECEIVED:
-       {
-               TC_PRT("BLUETOOTH_EVENT_GATT_SVC_PROP_RECEIVED");
-               bt_gatt_service_property_t *svc_pty = param->param_data;
-               int i;
-
-               if (svc_pty == NULL) {
-                       TC_PRT("char_pty is NULL \n");
-                       break;
-               }
-
-               if (svc_pty->service_handle != NULL)
-                       TC_PRT("svc_pty->service_handle %s \n", svc_pty->service_handle);
-
-               if (svc_pty->uuid != NULL)
-                       TC_PRT("svc_pty->uuid %s \n", svc_pty->uuid);
-
-               for (i = 0; i < svc_pty->handle_info.count; i++)
-                       TC_PRT("svc_char[%d] = %s\n", i, svc_pty->handle_info.handle[i]);
-
-               break;
-       }
-
-       case BLUETOOTH_EVENT_GATT_CHAR_PROP_RECEIVED:
-       {
-               TC_PRT("BLUETOOTH_EVENT_GATT_CHAR_PROP_RECEIVED");
-               bt_gatt_char_property_t *char_pty = param->param_data;
-               int i = 0;
-
-               if (char_pty->char_handle != NULL)
-                       TC_PRT("char_pty->char_handle %s \n", char_pty->char_handle);
-
-               if (char_pty->uuid != NULL)
-                       TC_PRT("char_pty->uuid %s \n", char_pty->uuid);
-
-               if (char_pty == NULL) {
-                       TC_PRT("char_pty is NULL \n");
-                       break;
-               }
-
-               if (char_pty->name != NULL)
-                       TC_PRT("char_pty->name %s \n", char_pty->name);
-
-               if (char_pty->description != NULL)
-                       TC_PRT("char_pty->description %s \n", char_pty->description);
-
-               if (char_pty->val != NULL) {
-                       TC_PRT("char_pty->val_len %d \n", char_pty->val_len);
-
-                       for (i = 0; i < char_pty->val_len; i++)
-                               TC_PRT("char_pty->val %02x \n", char_pty->val[i]);
-               }
-
-               break;
-       }
-#endif
        case BLUETOOTH_EVENT_KEYBOARD_PASSKEY_DISPLAY:
        {
                bluetooth_authentication_request_info_t *auth_info = param->param_data;