From: DoHyun Pyun Date: Wed, 30 Jan 2019 07:38:19 +0000 (+0900) Subject: [UTC][bluetooth][Non-ACR][Correct the feature value for GATT TCs] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6f30126286d4046b1bee1de0ed29c1e8faa368c0;p=test%2Ftct%2Fnative%2Fapi.git [UTC][bluetooth][Non-ACR][Correct the feature value for GATT TCs] Change-Id: I6cca699230b78c3a77e895827bf1a0503317dd7e Signed-off-by: DoHyun Pyun --- diff --git a/src/utc/bluetooth/utc_bluetooth_gatt_negative.c b/src/utc/bluetooth/utc_bluetooth_gatt_negative.c index 3d6f62529..8a625aec3 100755 --- a/src/utc/bluetooth/utc_bluetooth_gatt_negative.c +++ b/src/utc/bluetooth/utc_bluetooth_gatt_negative.c @@ -28,6 +28,8 @@ static int ret = BT_ERROR_NONE; static const char *remote_addr = "E4:32:CB:41:1F:A6"; static bool le_supported = false; static bool bt_supported = false; +static bool gatt_client_supported = false; +static bool gatt_server_supported = false; static bool ipsp_supported = false; @@ -54,6 +56,12 @@ void utc_bluetooth_gatt_negative_startup(void) le_supported = false; system_info_get_platform_bool("http://tizen.org/feature/network.bluetooth.le", &le_supported); + gatt_client_supported = false; + system_info_get_platform_bool("tizen.org/feature/network.bluetooth.le.gatt.client", &gatt_client_supported); + + gatt_server_supported = false; + system_info_get_platform_bool("tizen.org/feature/network.bluetooth.le.gatt.server", &gatt_server_supported); + ipsp_supported = false; system_info_get_platform_bool("http://tizen.org/feature/network.bluetooth.le.ipsp", &ipsp_supported); @@ -94,7 +102,7 @@ int utc_bluetooth_bt_gatt_connect_n(void) { bool auto_connect = FALSE; - if(le_supported) { + if(gatt_client_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_deinitialize(); assert_eq(ret,BT_ERROR_NONE); @@ -122,7 +130,7 @@ int utc_bluetooth_bt_gatt_connect_n(void) */ int utc_bluetooth_bt_gatt_disconnect_n(void) { - if(le_supported) { + if(gatt_client_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_deinitialize(); assert_eq(ret,BT_ERROR_NONE); @@ -152,7 +160,7 @@ int utc_bluetooth_bt_gatt_connect_n1(void) { bool auto_connect = FALSE; - if(le_supported) { + if(gatt_client_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_initialize(); assert_eq(ret,BT_ERROR_NONE); @@ -180,7 +188,7 @@ int utc_bluetooth_bt_gatt_connect_n1(void) */ int utc_bluetooth_bt_gatt_disconnect_n1(void) { - if(le_supported) { + if(gatt_client_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_initialize(); assert_eq(ret,BT_ERROR_NONE); @@ -205,7 +213,7 @@ int utc_bluetooth_bt_gatt_disconnect_n1(void) */ int utc_bluetooth_bt_gatt_set_connection_state_changed_cb_n(void) { - if(le_supported) { + if(gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_deinitialize(); assert_eq(ret,BT_ERROR_NONE); @@ -232,7 +240,7 @@ int utc_bluetooth_bt_gatt_set_connection_state_changed_cb_n(void) */ int utc_bluetooth_bt_gatt_unset_connection_state_changed_cb_n(void) { - if(le_supported) { + if(gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_deinitialize(); assert_eq(ret,BT_ERROR_NONE); @@ -260,7 +268,7 @@ int utc_bluetooth_bt_gatt_get_value_n(void) char *value = NULL; int len = 0; - if(le_supported) { + if(gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_get_value(gatt_handle, &value, &len); @@ -286,7 +294,7 @@ int utc_bluetooth_bt_gatt_get_int_value_n(void) char *value = NULL; int offset = 0; - if(le_supported) { + if(gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_get_int_value(gatt_handle, BT_DATA_TYPE_SINT16, offset, value); @@ -312,7 +320,7 @@ int utc_bluetooth_bt_gatt_get_float_value_n(void) float *value = NULL; int offset = 0; - if(le_supported) { + if(gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_get_float_value(gatt_handle, BT_DATA_TYPE_FLOAT, offset, value); @@ -338,7 +346,7 @@ int utc_bluetooth_bt_gatt_set_value_n(void) const char *value = NULL; int value_length = 0; - if(le_supported) { + if(gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_set_value(gatt_handle, value, value_length); @@ -364,7 +372,7 @@ int utc_bluetooth_bt_gatt_set_int_value_n(void) const char *value = NULL; int value_length = 0; - if(le_supported) { + if(gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_set_int_value(gatt_handle, 0x02, value, value_length); @@ -392,7 +400,7 @@ int utc_bluetooth_bt_gatt_set_float_value_n(void) int exponent = 0; int offset = 0; - if(le_supported) { + if(gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_set_float_value(gatt_handle, @@ -419,7 +427,7 @@ int utc_bluetooth_bt_gatt_get_uuid_n(void) bt_gatt_h gatt_handle = NULL; char *uuid = NULL; - if(le_supported) { + if(gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_get_uuid(gatt_handle, &uuid); @@ -443,7 +451,7 @@ int utc_bluetooth_bt_gatt_get_type_n(void) { bt_gatt_h gatt_handle = NULL; - if(le_supported) { + if(gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_get_type(gatt_handle, NULL); @@ -468,7 +476,7 @@ int utc_bluetooth_bt_gatt_service_get_client_n(void) bt_gatt_h gatt_handle = NULL; bt_gatt_client_h *client = NULL; - if(le_supported) { + if(gatt_client_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_service_get_client(gatt_handle, client); @@ -494,7 +502,7 @@ int utc_bluetooth_bt_gatt_service_get_characteristic_n(void) const char *uuid = NULL; bt_gatt_h *characteristic = NULL; - if(le_supported) { + if(gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_service_get_characteristic(service, uuid, characteristic); @@ -525,7 +533,7 @@ int utc_bluetooth_bt_gatt_service_foreach_characteristics_n(void) int test_id = 0; bt_gatt_h service = NULL; - if(le_supported) { + if(gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_service_foreach_characteristics(service, @@ -553,7 +561,7 @@ int utc_bluetooth_bt_gatt_service_get_included_service_n(void) const char *uuid = NULL; bt_gatt_h *included_service = NULL; - if(le_supported) { + if(gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_service_get_included_service(service, uuid, included_service); @@ -580,7 +588,7 @@ int utc_bluetooth_bt_gatt_service_foreach_included_services_n(void) bt_gatt_h service = NULL; const char *uuid = NULL; - if(le_supported) { + if(gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_service_foreach_included_services(service, __bt_gatt_client_foreach_chr_cb, NULL); @@ -605,7 +613,7 @@ int utc_bluetooth_bt_gatt_characteristic_get_service_n(void) bt_gatt_h characteristic = NULL; bt_gatt_h *service = NULL; - if(le_supported) { + if(gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_characteristic_get_service(characteristic, service); @@ -630,7 +638,7 @@ int utc_bluetooth_bt_gatt_characteristic_get_properties_n(void) bt_gatt_h characteristic = NULL; int *properties = NULL; - if(le_supported) { + if(gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_characteristic_get_properties(characteristic, properties); @@ -655,7 +663,7 @@ int utc_bluetooth_bt_gatt_characteristic_get_write_type_n(void) bt_gatt_h characteristic = NULL; bt_gatt_write_type_e *write_type = NULL; - if(le_supported) { + if(gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_characteristic_get_write_type(characteristic, write_type); @@ -682,7 +690,7 @@ int utc_bluetooth_bt_gatt_characteristic_set_write_type_n(void) bt_gatt_write_type_e write_type = BT_GATT_WRITE_TYPE_WRITE_NO_RESPONSE; - if(le_supported) { + if(gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_characteristic_set_write_type(characteristic, write_type); @@ -708,7 +716,7 @@ int utc_bluetooth_bt_gatt_characteristic_get_descriptor_n(void) const char *uuid = NULL; bt_gatt_h *descriptor = NULL; - if(le_supported) { + if(gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_characteristic_get_descriptor(characteristic, uuid, descriptor); @@ -735,7 +743,7 @@ int utc_bluetooth_bt_gatt_characteristic_foreach_descriptors_n(void) const char *uuid = NULL; bt_gatt_h *descriptor = NULL; - if(le_supported) { + if(gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_characteristic_foreach_descriptors(characteristic, @@ -762,7 +770,7 @@ int utc_bluetooth_bt_gatt_descriptor_get_characteristic_n(void) bt_gatt_h descriptor = NULL; bt_gatt_h *characteristic = NULL; - if(le_supported) { + if(gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_descriptor_get_characteristic(descriptor, characteristic); @@ -787,7 +795,7 @@ int utc_bluetooth_bt_gatt_client_create_n(void) const char *remote_address = "00:19:0E:01:61:17"; bt_gatt_client_h client = NULL; - if(le_supported) { + if(gatt_client_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_deinitialize(); assert_eq(ret,BT_ERROR_NONE); @@ -819,7 +827,7 @@ int utc_bluetooth_bt_gatt_client_destroy_n(void) const char *remote_address = "00:19:0E:01:61:17"; bt_gatt_client_h client = NULL; - if(le_supported) { + if(gatt_client_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_deinitialize(); assert_eq(ret,BT_ERROR_NONE); @@ -847,7 +855,7 @@ int utc_bluetooth_bt_gatt_client_get_remote_address_n(void) bt_gatt_client_h client = NULL; char *remote_address = "00:19:0E:01:61:17"; - if(le_supported) { + if(gatt_client_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_deinitialize(); assert_eq(ret,BT_ERROR_NONE); @@ -884,7 +892,7 @@ int utc_bluetooth_bt_gatt_client_read_value_n(void) { bt_gatt_h gatt_handle = NULL; - if(le_supported) { + if(gatt_client_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_client_read_value(gatt_handle, @@ -917,7 +925,7 @@ int utc_bluetooth_bt_gatt_client_write_value_n(void) bt_gatt_h client = NULL; void *user_data = NULL; - if(le_supported) { + if(gatt_client_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_client_write_value(client, __bt_gatt_client_request_completed_cb, NULL); @@ -947,7 +955,7 @@ int utc_bluetooth_bt_gatt_client_set_characteristic_value_changed_cb_n(void) { bt_gatt_h characteristic = NULL; - if(le_supported) { + if(gatt_client_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_client_set_characteristic_value_changed_cb(characteristic, @@ -975,7 +983,7 @@ int utc_bluetooth_bt_gatt_client_unset_characteristic_value_changed_cb_n(void) { bt_gatt_h characteristic = NULL; - if(le_supported) { + if(gatt_client_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_client_unset_characteristic_value_changed_cb(characteristic); @@ -1001,7 +1009,7 @@ int utc_bluetooth_bt_gatt_client_get_service_n(void) const char *uuid = NULL; bt_gatt_h *service = NULL; - if(le_supported) { + if(gatt_client_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_client_get_service(client, uuid, service); @@ -1031,7 +1039,7 @@ int utc_bluetooth_bt_gatt_client_foreach_services_n(void) { bt_gatt_client_h client = NULL; - if(le_supported) { + if(gatt_client_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_client_foreach_services(client, __bt_gatt_foreach_cb, NULL); @@ -1054,7 +1062,7 @@ int utc_bluetooth_bt_gatt_client_foreach_services_n(void) */ int utc_bluetooth_bt_gatt_service_destroy_n(void) { - if(le_supported) { + if(gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_service_destroy(NULL); @@ -1077,7 +1085,7 @@ int utc_bluetooth_bt_gatt_service_destroy_n(void) */ int utc_bluetooth_bt_gatt_characteristic_destroy_n(void) { - if(le_supported) { + if(gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_characteristic_destroy(NULL); @@ -1100,7 +1108,7 @@ int utc_bluetooth_bt_gatt_characteristic_destroy_n(void) */ int utc_bluetooth_bt_gatt_descriptor_destroy_n(void) { - if(le_supported) { + if(gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_descriptor_destroy(NULL); @@ -1123,7 +1131,7 @@ int utc_bluetooth_bt_gatt_descriptor_destroy_n(void) */ int utc_bluetooth_bt_gatt_characteristic_get_permissions_n(void) { - if(le_supported) { + if(gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_characteristic_get_permissions(NULL, NULL); @@ -1146,7 +1154,7 @@ int utc_bluetooth_bt_gatt_characteristic_get_permissions_n(void) */ int utc_bluetooth_bt_gatt_descriptor_get_permissions_n(void) { - if(le_supported) { + if(gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_descriptor_get_permissions(NULL, NULL); @@ -1171,7 +1179,7 @@ int utc_bluetooth_bt_gatt_service_create_n(void) { bt_gatt_service_type_e service_type = BT_GATT_SERVICE_TYPE_PRIMARY; - if(le_supported) { + if(gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_service_create(NULL, service_type, NULL); @@ -1194,7 +1202,7 @@ int utc_bluetooth_bt_gatt_service_create_n(void) */ int utc_bluetooth_bt_gatt_service_add_characteristic_n(void) { - if(le_supported) { + if(gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_service_add_characteristic(NULL, NULL); @@ -1217,7 +1225,7 @@ int utc_bluetooth_bt_gatt_service_add_characteristic_n(void) */ int utc_bluetooth_bt_gatt_service_add_included_service_n(void) { - if(le_supported) { + if(gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_service_add_included_service(NULL, NULL); @@ -1240,7 +1248,7 @@ int utc_bluetooth_bt_gatt_service_add_included_service_n(void) */ int utc_bluetooth_bt_gatt_service_get_server_n(void) { - if(le_supported) { + if(gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_service_get_server(NULL, NULL); @@ -1267,7 +1275,7 @@ int utc_bluetooth_bt_gatt_characteristic_create_n(void) int properties = BT_GATT_PROPERTY_READ | BT_GATT_PROPERTY_NOTIFY; char char_value[1] = {80}; - if(le_supported) { + if(gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_characteristic_create(NULL, permissions, properties, char_value, sizeof(char_value), NULL); @@ -1290,7 +1298,7 @@ int utc_bluetooth_bt_gatt_characteristic_create_n(void) */ int utc_bluetooth_bt_gatt_characteristic_add_descriptor_n(void) { - if(le_supported) { + if(gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_characteristic_add_descriptor(NULL, NULL); @@ -1316,7 +1324,7 @@ int utc_bluetooth_bt_gatt_descriptor_create_n(void) char desc_value[2] = {0, 0}; int permissions = BT_GATT_PERMISSION_READ | BT_GATT_PERMISSION_WRITE; - if(le_supported) { + if(gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_descriptor_create(NULL, permissions, desc_value, sizeof(desc_value), NULL); @@ -1338,7 +1346,7 @@ int utc_bluetooth_bt_gatt_descriptor_create_n(void) */ int utc_bluetooth_bt_gatt_server_initialize_n(void) { - if(le_supported) { + if(gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_deinitialize(); @@ -1363,7 +1371,7 @@ int utc_bluetooth_bt_gatt_server_initialize_n(void) */ int utc_bluetooth_bt_gatt_server_deinitialize_n(void) { - if(le_supported) { + if(gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_deinitialize(); @@ -1390,7 +1398,7 @@ int utc_bluetooth_bt_gatt_server_create_n(void) { bt_gatt_server_h server = NULL; - if(le_supported) { + if(gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_deinitialize(); @@ -1417,7 +1425,7 @@ int utc_bluetooth_bt_gatt_server_destroy_n(void) { bt_gatt_server_h server = NULL; - if(le_supported) { + if(gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_deinitialize(); @@ -1444,7 +1452,7 @@ int utc_bluetooth_bt_gatt_server_set_read_value_requested_cb_n(void) { bt_gatt_h characteristic = NULL; - if(le_supported) { + if(gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_deinitialize(); @@ -1475,7 +1483,7 @@ int utc_bluetooth_bt_gatt_server_set_characteristic_notification_state_change_cb { bt_gatt_h characteristic = NULL; - if(le_supported) { + if(gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_deinitialize(); @@ -1502,7 +1510,7 @@ int utc_bluetooth_bt_gatt_server_set_write_value_requested_cb_n(void) { bt_gatt_h characteristic = NULL; - if(le_supported) { + if(gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_deinitialize(); @@ -1527,7 +1535,7 @@ int utc_bluetooth_bt_gatt_server_set_write_value_requested_cb_n(void) */ int utc_bluetooth_bt_gatt_server_notify_characteristic_changed_value_n(void) { - if(le_supported) { + if(gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_deinitialize(); @@ -1552,7 +1560,7 @@ int utc_bluetooth_bt_gatt_server_notify_characteristic_changed_value_n(void) */ int utc_bluetooth_bt_gatt_server_get_service_n(void) { - if(le_supported) { + if(gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_deinitialize(); @@ -1577,7 +1585,7 @@ int utc_bluetooth_bt_gatt_server_get_service_n(void) */ int utc_bluetooth_bt_gatt_server_foreach_services_n(void) { - if(le_supported) { + if(gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_deinitialize(); @@ -1602,7 +1610,7 @@ int utc_bluetooth_bt_gatt_server_foreach_services_n(void) */ int utc_bluetooth_bt_gatt_server_register_service_n(void) { - if(le_supported) { + if(gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_deinitialize(); @@ -1627,7 +1635,7 @@ int utc_bluetooth_bt_gatt_server_register_service_n(void) */ int utc_bluetooth_bt_gatt_server_unregister_service_n(void) { - if(le_supported) { + if(gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_deinitialize(); @@ -1652,7 +1660,7 @@ int utc_bluetooth_bt_gatt_server_unregister_service_n(void) */ int utc_bluetooth_bt_gatt_server_unregister_all_services_n(void) { - if(le_supported) { + if(gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_deinitialize(); @@ -1677,7 +1685,7 @@ int utc_bluetooth_bt_gatt_server_unregister_all_services_n(void) */ int utc_bluetooth_bt_gatt_server_start_n(void) { - if(le_supported) { + if(gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_deinitialize(); @@ -1702,7 +1710,7 @@ int utc_bluetooth_bt_gatt_server_start_n(void) */ int utc_bluetooth_bt_gatt_server_send_response_n(void) { - if(le_supported) { + if(gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_deinitialize(); @@ -1727,7 +1735,7 @@ int utc_bluetooth_bt_gatt_server_send_response_n(void) */ int utc_bluetooth_bt_gatt_client_set_service_changed_cb_n(void) { - if (le_supported) { + if (gatt_client_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_deinitialize(); @@ -1753,7 +1761,7 @@ int utc_bluetooth_bt_gatt_client_set_service_changed_cb_n(void) */ int utc_bluetooth_bt_gatt_client_unset_service_changed_cb_n(void) { - if (le_supported) { + if (gatt_client_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_client_unset_service_changed_cb(NULL); @@ -1896,7 +1904,7 @@ int utc_bluetooth_bt_ipsp_unset_connection_state_changed_cb_n(void) int utc_bluetooth_bt_gatt_client_request_att_mtu_change_n(void) { - if (le_supported) { + if (gatt_client_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_client_request_att_mtu_change(NULL, 0); @@ -1911,7 +1919,7 @@ int utc_bluetooth_bt_gatt_client_request_att_mtu_change_n(void) int utc_bluetooth_bt_gatt_client_get_att_mtu_n(void) { - if (le_supported) { + if (gatt_client_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_client_get_att_mtu(NULL, NULL); @@ -1926,7 +1934,7 @@ int utc_bluetooth_bt_gatt_client_get_att_mtu_n(void) int utc_bluetooth_bt_gatt_client_set_att_mtu_changed_cb_n(void) { - if (le_supported) { + if (gatt_client_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_client_set_att_mtu_changed_cb(NULL, NULL, NULL); @@ -1941,7 +1949,7 @@ int utc_bluetooth_bt_gatt_client_set_att_mtu_changed_cb_n(void) int utc_bluetooth_bt_gatt_client_unset_att_mtu_changed_cb_n(void) { - if (le_supported) { + if (gatt_client_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_client_unset_att_mtu_changed_cb(NULL); diff --git a/src/utc/bluetooth/utc_bluetooth_gatt_positive.c b/src/utc/bluetooth/utc_bluetooth_gatt_positive.c index ad8284fa9..d8c24bb32 100755 --- a/src/utc/bluetooth/utc_bluetooth_gatt_positive.c +++ b/src/utc/bluetooth/utc_bluetooth_gatt_positive.c @@ -27,6 +27,8 @@ static int startup_flag = BT_ERROR_NONE; static int ret = BT_ERROR_NONE; static bool le_supported = false; +static bool gatt_client_supported = false; +static bool gatt_server_supported = false; static bool bt_supported = false; static bool ipsp_supported = false; @@ -89,6 +91,12 @@ void utc_bluetooth_gatt_positive_startup(void) le_supported = false; system_info_get_platform_bool("http://tizen.org/feature/network.bluetooth.le", &le_supported); + gatt_client_supported = false; + system_info_get_platform_bool("tizen.org/feature/network.bluetooth.le.gatt.client", &gatt_client_supported); + + gatt_server_supported = false; + system_info_get_platform_bool("tizen.org/feature/network.bluetooth.le.gatt.server", &gatt_server_supported); + ipsp_supported = false; system_info_get_platform_bool("http://tizen.org/feature/network.bluetooth.le.ipsp", &ipsp_supported); @@ -132,7 +140,7 @@ void utc_bluetooth_gatt_positive_cleanup(void) */ int utc_bluetooth_bt_gatt_set_connection_state_changed_cb_p(void) { - if(le_supported) { + if(gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_set_connection_state_changed_cb(gatt_connection_state_changed_cb_p, NULL); @@ -154,7 +162,7 @@ int utc_bluetooth_bt_gatt_set_connection_state_changed_cb_p(void) */ int utc_bluetooth_bt_gatt_unset_connection_state_changed_cb_p(void) { - if(le_supported) { + if(gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_unset_connection_state_changed_cb(); @@ -180,7 +188,7 @@ int utc_bluetooth_bt_gatt_service_destroy_p(void) char *service_uuid = "180f"; /* Battery Service */ bt_gatt_service_type_e service_type = BT_GATT_SERVICE_TYPE_PRIMARY; - if (le_supported) { + if (gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_service_create(service_uuid, service_type, &service); @@ -211,7 +219,7 @@ int utc_bluetooth_bt_gatt_characteristic_destroy_p(void) bt_gatt_property_e properties = BT_GATT_PROPERTY_READ | BT_GATT_PROPERTY_NOTIFY; bt_gatt_permission_e permissions = BT_GATT_PERMISSION_READ; - if (le_supported) { + if (gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_characteristic_create(char_uuid, permissions, properties, char_value, sizeof(char_value), &characteristic); @@ -221,7 +229,7 @@ int utc_bluetooth_bt_gatt_characteristic_destroy_p(void) assert_eq(ret, BT_ERROR_NONE); } else { ret = bt_gatt_characteristic_destroy(characteristic); - assert_eq(ret, BT_ERROR_NOT_SUPPORTED); + assert_eq(ret, BT_ERROR_NOT_SUPPORTED); } return 0; @@ -241,7 +249,7 @@ int utc_bluetooth_bt_gatt_descriptor_destroy_p(void) char desc_value[2] = {0, 0}; /* Notification & Indication */ bt_gatt_permission_e permissions = BT_GATT_PERMISSION_READ | BT_GATT_PERMISSION_WRITE; - if (le_supported) { + if (gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_descriptor_create(desc_uuid, permissions, desc_value, sizeof(desc_value), &descriptor); @@ -251,7 +259,7 @@ int utc_bluetooth_bt_gatt_descriptor_destroy_p(void) assert_eq(ret, BT_ERROR_NONE); } else { ret = bt_gatt_descriptor_destroy(descriptor); - assert_eq(ret, BT_ERROR_NOT_SUPPORTED); + assert_eq(ret, BT_ERROR_NOT_SUPPORTED); } return 0; @@ -273,7 +281,7 @@ int utc_bluetooth_bt_gatt_characteristic_get_permissions_p(void) bt_gatt_property_e properties = BT_GATT_PROPERTY_READ | BT_GATT_PROPERTY_NOTIFY; bt_gatt_permission_e permissions = BT_GATT_PERMISSION_READ; - if (le_supported) { + if (gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_characteristic_create(char_uuid, permissions, properties, char_value, sizeof(char_value), &characteristic); @@ -287,7 +295,7 @@ int utc_bluetooth_bt_gatt_characteristic_get_permissions_p(void) bt_gatt_characteristic_destroy(characteristic); } else { ret = bt_gatt_characteristic_get_permissions(characteristic, &permissions); - assert_eq(ret, BT_ERROR_NOT_SUPPORTED); + assert_eq(ret, BT_ERROR_NOT_SUPPORTED); } return 0; @@ -308,7 +316,7 @@ int utc_bluetooth_bt_gatt_descriptor_get_permissions_p(void) char desc_value[2] = {0, 0}; /* Notification & Indication */ bt_gatt_permission_e permissions = BT_GATT_PERMISSION_READ | BT_GATT_PERMISSION_WRITE; - if (le_supported) { + if (gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_descriptor_create(desc_uuid, permissions, desc_value, sizeof(desc_value), &descriptor); @@ -322,7 +330,7 @@ int utc_bluetooth_bt_gatt_descriptor_get_permissions_p(void) bt_gatt_descriptor_destroy(descriptor); } else { ret = bt_gatt_descriptor_get_permissions(descriptor, &permissions); - assert_eq(ret, BT_ERROR_NOT_SUPPORTED); + assert_eq(ret, BT_ERROR_NOT_SUPPORTED); } return 0; @@ -341,7 +349,7 @@ int utc_bluetooth_bt_gatt_service_create_p(void) char *service_uuid = "180f"; /* Battery Service */ bt_gatt_service_type_e service_type = BT_GATT_SERVICE_TYPE_PRIMARY; - if (le_supported) { + if (gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_service_create(service_uuid, service_type, &service); @@ -375,7 +383,7 @@ int utc_bluetooth_bt_gatt_service_add_characteristic_p(void) bt_gatt_property_e properties = BT_GATT_PROPERTY_READ | BT_GATT_PROPERTY_NOTIFY; bt_gatt_permission_e permissions = BT_GATT_PERMISSION_READ; - if (le_supported) { + if (gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_service_create(service_uuid, service_type, &service); @@ -419,7 +427,7 @@ int utc_bluetooth_bt_gatt_service_add_included_service_p(void) char *included_service_uuid = "180d"; /* Heart Rate Service */ bt_gatt_service_type_e included_service_type = BT_GATT_SERVICE_TYPE_SECONDARY; - if (le_supported) { + if (gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_service_create(service_uuid, service_type, &service); @@ -461,7 +469,7 @@ int utc_bluetooth_bt_gatt_service_get_server_p(void) char *service_uuid = "180f"; /* Battery Service */ bt_gatt_service_type_e service_type = BT_GATT_SERVICE_TYPE_PRIMARY; - if (le_supported) { + if (gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_server_initialize(); @@ -516,7 +524,7 @@ int utc_bluetooth_bt_gatt_characteristic_create_p(void) bt_gatt_property_e properties = BT_GATT_PROPERTY_READ | BT_GATT_PROPERTY_NOTIFY; bt_gatt_permission_e permissions = BT_GATT_PERMISSION_READ; - if (le_supported) { + if (gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_characteristic_create(char_uuid, permissions, properties, char_value, sizeof(char_value), &characteristic); @@ -550,7 +558,7 @@ int utc_bluetooth_bt_gatt_characteristic_add_descriptor_p(void) bt_gatt_property_e properties = BT_GATT_PROPERTY_READ | BT_GATT_PROPERTY_NOTIFY; bt_gatt_permission_e permissions = BT_GATT_PERMISSION_READ; - if (le_supported) { + if (gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_characteristic_create(char_uuid, permissions, properties, char_value, sizeof(char_value), &characteristic); @@ -591,7 +599,7 @@ int utc_bluetooth_bt_gatt_descriptor_create_p(void) char desc_value[2] = {0, 0}; /* Notification & Indication */ bt_gatt_permission_e permissions = BT_GATT_PERMISSION_READ | BT_GATT_PERMISSION_WRITE; - if (le_supported) { + if (gatt_client_supported || gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_descriptor_create(desc_uuid, permissions, desc_value, sizeof(desc_value), &descriptor); @@ -615,7 +623,7 @@ int utc_bluetooth_bt_gatt_descriptor_create_p(void) */ int utc_bluetooth_bt_gatt_server_initialize_p(void) { - if (le_supported) { + if (gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_server_deinitialize(); @@ -640,7 +648,7 @@ int utc_bluetooth_bt_gatt_server_initialize_p(void) */ int utc_bluetooth_bt_gatt_server_deinitialize_p(void) { - if (le_supported) { + if (gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_server_deinitialize(); @@ -664,7 +672,7 @@ int utc_bluetooth_bt_gatt_server_create_p(void) { bt_gatt_server_h server = NULL; - if (le_supported) { + if (gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_server_create(&server); @@ -690,7 +698,7 @@ int utc_bluetooth_bt_gatt_server_destroy_p(void) { bt_gatt_server_h server = NULL; - if (le_supported) { + if (gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_server_create(&server); @@ -723,7 +731,7 @@ int utc_bluetooth_bt_gatt_server_set_read_value_requested_cb_p(void) bt_gatt_property_e properties = BT_GATT_PROPERTY_READ | BT_GATT_PROPERTY_NOTIFY; bt_gatt_permission_e permissions = BT_GATT_PERMISSION_READ; - if (le_supported) { + if (gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_server_initialize(); @@ -764,7 +772,7 @@ int utc_bluetooth_bt_gatt_server_set_characteristic_notification_state_change_cb bt_gatt_property_e properties = BT_GATT_PROPERTY_READ | BT_GATT_PROPERTY_NOTIFY; bt_gatt_permission_e permissions = BT_GATT_PERMISSION_READ; - if (le_supported) { + if (gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_server_initialize(); @@ -805,7 +813,7 @@ int utc_bluetooth_bt_gatt_server_set_write_value_requested_cb_p(void) bt_gatt_property_e properties = BT_GATT_PROPERTY_READ | BT_GATT_PROPERTY_NOTIFY; bt_gatt_permission_e permissions = BT_GATT_PERMISSION_READ; - if (le_supported) { + if (gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_server_initialize(); @@ -846,7 +854,7 @@ int utc_bluetooth_bt_gatt_server_get_service_p(void) char *service_uuid = "180f"; /* Battery Service */ bt_gatt_service_type_e service_type = BT_GATT_SERVICE_TYPE_PRIMARY; - if (le_supported) { + if (gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_server_initialize(); @@ -903,7 +911,7 @@ int utc_bluetooth_bt_gatt_server_foreach_services_p(void) char *service_uuid = "180f"; /* Battery Service */ bt_gatt_service_type_e service_type = BT_GATT_SERVICE_TYPE_PRIMARY; - if (le_supported) { + if (gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_server_initialize(); @@ -959,7 +967,7 @@ int utc_bluetooth_bt_gatt_server_register_service_p(void) char *service_uuid = "180f"; /* Battery Service */ bt_gatt_service_type_e service_type = BT_GATT_SERVICE_TYPE_PRIMARY; - if (le_supported) { + if (gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_server_initialize(); @@ -1008,7 +1016,7 @@ int utc_bluetooth_bt_gatt_server_unregister_service_p(void) char *service_uuid = "180f"; /* Battery Service */ bt_gatt_service_type_e service_type = BT_GATT_SERVICE_TYPE_PRIMARY; - if (le_supported) { + if (gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_server_initialize(); @@ -1064,7 +1072,7 @@ int utc_bluetooth_bt_gatt_server_unregister_all_services_p(void) char *service_uuid = "180f"; /* Battery Service */ bt_gatt_service_type_e service_type = BT_GATT_SERVICE_TYPE_PRIMARY; - if (le_supported) { + if (gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_server_initialize(); @@ -1120,7 +1128,7 @@ int utc_bluetooth_bt_gatt_server_start_p(void) char *service_uuid = "180f"; /* Battery Service */ bt_gatt_service_type_e service_type = BT_GATT_SERVICE_TYPE_PRIMARY; - if (le_supported) { + if (gatt_server_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_server_initialize(); @@ -1214,7 +1222,7 @@ int utc_bluetooth_bt_gatt_client_set_att_mtu_changed_cb_p(void) bt_gatt_client_h client = NULL; static const char *remote_addr = "E4:32:CB:41:1F:A6"; - if (le_supported) { + if (gatt_client_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_client_create(remote_addr, &client); @@ -1239,7 +1247,7 @@ int utc_bluetooth_bt_gatt_client_unset_att_mtu_changed_cb_p(void) bt_gatt_client_h client = NULL; static const char *remote_addr = "E4:32:CB:41:1F:A6"; - if (le_supported) { + if (gatt_client_supported) { assert_eq(startup_flag, BT_ERROR_NONE); ret = bt_gatt_client_create(remote_addr, &client);