Control requests
system_ctrl_set_result - Control requests
Completes the processing of a request. The result argument specifies a result code as defined by the system_error_t enum. The function also takes an optional callback that will be invoked once the sender of the request has received the reply successfully, or an error has occurred while sending the reply.
// PROTOTYPE
void system_ctrl_set_result(ctrl_request* req, int result, ctrl_completion_handler_fn handler, void* data, void* reserved);
// EXAMPLE
void ctrl_request_custom_handler(ctrl_request *req) {
int result = SYSTEM_ERROR_NOT_SUPPORTED;
system_ctrl_set_result(req, result, nullptr, nullptr, nullptr);
}
reqis the request passed toctrl_request_custom_handlerresultthe system error code to return (0 = success)handlerthe callback function ornullptrif not useddataoptional data pointer that is passed to the handlerreservedmust be set tonullptr(0)