bt_gatt_server_h server, bt_gatt_h gatt_handle,
int offset, void *user_data)
{
- char char_value_1[3] = {0, 1, 2};
+ char *value = "A very long test value, can be long than MTU";
int resp_status = BT_ATT_ERROR_NONE;
+ char *new_value = NULL;
+
+ new_value = g_malloc0(strlen(value) + 1);
+ strncpy(new_value, &value[offset], strlen(value) - offset);
+ new_value[strlen(value) - offset] = '\0';
+ TC_PRT("new_value: %s(len: %d)\n", new_value, strlen(new_value));
__print_gatt_handler(gatt_handle);
TC_PRT("[%s] req_id %d, offset %d", remote_address, request_id, offset);
/* Get the attribute new values here */
bt_gatt_server_send_response(request_id,
BLUETOOTH_GATT_ATT_REQUEST_TYPE_READ, offset,
- resp_status, char_value_1, 3 - offset);
+ resp_status, new_value, strlen(new_value));
+ g_free(new_value);
}
void __bt_gatt_server_notification_state_change_cb(bool notify,
}
break;
}
+ case BT_UNIT_TEST_FUNCTION_GATT_CLIENT_REQUEST_ATT_MTU:
+ param_count = 1;
+ param_type = BT_UNIT_TEST_PARAM_TYPE_INT;
+ TC_PRT("Input param(%d) type:%s", param_index + 1, param_type);
+ break;
case BT_UNIT_TEST_FUNCTION_ANCS_POSITIVE_ACTION:
case BT_UNIT_TEST_FUNCTION_ANCS_NEGATIVE_ACTION:
case BT_UNIT_TEST_FUNCTION_ANCS_GET_NOTI_ATTR: