fprintf(stderr,"Device is disconnected from remote address.");
}
+static void __bt_gatt_server_read_value_requested_cb_p(const char *remote_address, int request_id,
+ bt_gatt_server_h server, bt_gatt_h gatt_handle, int offset, void *user_data)
+{
+ fprintf(stderr, "__bt_gatt_server_read_value_requested_cb");
+}
+
+static void __bt_gatt_server_notification_state_change_cb_p(bool notify, bt_gatt_server_h server, bt_gatt_h gatt_handle, void *user_data)
+{
+ fprintf(stderr, "__bt_gatt_server_notification_state_change_cb");
+}
+
+static void __bt_gatt_server_write_value_requested_cb_p(const char *remote_address, int request_id, bt_gatt_server_h server,
+ bt_gatt_h gatt_handle, int offset, const char *value, int len, void *user_data)
+{
+ fprintf(stderr, "__bt_gatt_server_write_value_requested_cb");
+}
+
+static bool __bt_gatt_server_foreach_svc_cb_p(int total, int index, bt_gatt_h svc_handle, void *data)
+{
+ fprintf(stderr, "__bt_gatt_server_foreach_svc_cb");
+}
+
/**
* @function utc_bluetooth_gatt_positive_startup
* @description check if bluetooth is supported and LE is supported, Initialize bluetooth and check the adapter state and
if (le_supported) {
assert_eq(startup_flag, BT_ERROR_NONE);
+ ret = bt_gatt_server_initialize();
+ assert_eq(ret, BT_ERROR_NONE);
+
ret = bt_gatt_server_create(&server);
assert_eq(ret, BT_ERROR_NONE);
bt_gatt_service_destroy(service);
bt_gatt_server_destroy(server);
+ bt_gatt_server_deinitialize();
} else {
ret = bt_gatt_service_get_server(service, &get_server);
assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
if (le_supported) {
assert_eq(startup_flag, BT_ERROR_NONE);
+ ret = bt_gatt_server_initialize();
+ assert_eq(ret, BT_ERROR_NONE);
+
ret = bt_gatt_characteristic_create(char_uuid, permissions, properties, char_value, sizeof(char_value), &characteristic);
assert_eq(ret, BT_ERROR_NONE);
assert_eq(ret, BT_ERROR_NONE);
bt_gatt_characteristic_destroy(characteristic);
+ bt_gatt_server_deinitialize();
} else {
ret = bt_gatt_server_set_read_value_requested_cb(characteristic, __bt_gatt_server_read_value_requested_cb_p, NULL);
assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
if (le_supported) {
assert_eq(startup_flag, BT_ERROR_NONE);
+ ret = bt_gatt_server_initialize();
+ assert_eq(ret, BT_ERROR_NONE);
+
ret = bt_gatt_characteristic_create(char_uuid, permissions, properties, char_value, sizeof(char_value), &characteristic);
assert_eq(ret, BT_ERROR_NONE);
assert_eq(ret, BT_ERROR_NONE);
bt_gatt_characteristic_destroy(characteristic);
+ bt_gatt_server_deinitialize();
} else {
ret = bt_gatt_server_set_characteristic_notification_state_change_cb(characteristic, __bt_gatt_server_notification_state_change_cb_p, NULL);
assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
if (le_supported) {
assert_eq(startup_flag, BT_ERROR_NONE);
+ ret = bt_gatt_server_initialize();
+ assert_eq(ret, BT_ERROR_NONE);
+
ret = bt_gatt_characteristic_create(char_uuid, permissions, properties, char_value, sizeof(char_value), &characteristic);
assert_eq(ret, BT_ERROR_NONE);
assert_eq(ret, BT_ERROR_NONE);
bt_gatt_characteristic_destroy(characteristic);
+ bt_gatt_server_deinitialize();
} else {
ret = bt_gatt_server_set_write_value_requested_cb(characteristic, __bt_gatt_server_write_value_requested_cb_p, NULL);
assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
if (le_supported) {
assert_eq(startup_flag, BT_ERROR_NONE);
+ ret = bt_gatt_server_initialize();
+ assert_eq(ret, BT_ERROR_NONE);
+
ret = bt_gatt_server_create(&server);
assert_eq(ret, BT_ERROR_NONE);
bt_gatt_service_destroy(service);
bt_gatt_server_destroy(server);
+ bt_gatt_server_deinitialize();
} else {
ret = bt_gatt_server_get_service(server, service_uuid, &get_service);
assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
if (le_supported) {
assert_eq(startup_flag, BT_ERROR_NONE);
+ ret = bt_gatt_server_initialize();
+ assert_eq(ret, BT_ERROR_NONE);
+
ret = bt_gatt_server_create(&server);
assert_eq(ret, BT_ERROR_NONE);
bt_gatt_service_destroy(service);
bt_gatt_server_destroy(server);
+ bt_gatt_server_deinitialize();
} else {
ret = bt_gatt_server_foreach_services(server, __bt_gatt_server_foreach_svc_cb_p, NULL);
assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
if (le_supported) {
assert_eq(startup_flag, BT_ERROR_NONE);
+ ret = bt_gatt_server_initialize();
+ assert_eq(ret, BT_ERROR_NONE);
+
ret = bt_gatt_server_create(&server);
assert_eq(ret, BT_ERROR_NONE);
bt_gatt_service_destroy(service);
bt_gatt_server_destroy(server);
+ bt_gatt_server_deinitialize();
} else {
ret = bt_gatt_server_register_service(server, service);
assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
if (le_supported) {
assert_eq(startup_flag, BT_ERROR_NONE);
+ ret = bt_gatt_server_initialize();
+ assert_eq(ret, BT_ERROR_NONE);
+
ret = bt_gatt_server_create(&server);
assert_eq(ret, BT_ERROR_NONE);
bt_gatt_service_destroy(service);
bt_gatt_server_destroy(server);
+ bt_gatt_server_deinitialize();
} else {
ret = bt_gatt_server_unregister_service(server, service);
assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
if (le_supported) {
assert_eq(startup_flag, BT_ERROR_NONE);
+ ret = bt_gatt_server_initialize();
+ assert_eq(ret, BT_ERROR_NONE);
+
ret = bt_gatt_server_create(&server);
assert_eq(ret, BT_ERROR_NONE);
bt_gatt_service_destroy(service);
bt_gatt_server_destroy(server);
+ bt_gatt_server_deinitialize();
} else {
ret = bt_gatt_server_unregister_all_services(server);
assert_eq(ret, BT_ERROR_NOT_SUPPORTED);