1. how do the root node relay the required message to the node?
2. what is the purpose for the following code? I found those code in the node_handle_task
Code: Select all
/**
* @brief Processing request commands, generating response data
*
* @note Handling only the body part of http, the header
* of http is handled by mlink_httpd
*/
mlink_handle_data_t handle_data = {
.req_data = (char *)data,
.req_size = size,
.req_fromat = MLINK_HTTPD_FORMAT_JSON,
.resp_data = NULL,
.resp_size = 0,
.resp_fromat = MLINK_HTTPD_FORMAT_JSON,
};
ret = mlink_handle_request(&handle_data);
MDF_ERROR_GOTO(ret != MDF_OK, FREE_MEM, "<%s> mlink_handle", mdf_err_to_name(ret));
if (handle_data.resp_fromat == MLINK_HTTPD_FORMAT_JSON) {
mlink_json_pack(&handle_data.resp_data, "status_msg", mdf_err_to_name(ret));
handle_data.resp_size = mlink_json_pack(&handle_data.resp_data, "status_code", -ret);
}
Thanks
Samuel