Called after an error occurred during an HTTP transaction process.
Like for every hook functions, it's only available when the µC/HTTP-client internal task is active (HTTPc_CFG_MODE_ASYNC_TASK_EN
). This hook is not mandatory when the API function HTTPc_ReqSend()
is called in blocking mode. This hook can be set up with the API function HTTPc_ReqSetParam
and the parameter type HTTPc_PARAM_TYPE_TRANS_ERR_CALLBACK
.
Prototype
Code Block |
---|
void HTTPc_TransErrHook (HTTPc_CONN_OBJ *p_conn_obj,
HTTPc_REQ_OBJ *p_req_obj,
HTTPc_ERR err); |
Arguments
p_conn_obj
Pointer to the current HTTPc Connection Object.
p_req_obj
Pointer to the current HTTPc Request Object.
err
Error code associated with the occurred error.
Return Values
None.
Required Configuration
The µC/HTTP-client Internal Task must be active. See section Task Configuration of the Compile-Time Configuration page.
Notes / Warnings
None.
Example Template
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
static void HTTPc_TransErrHook (HTTPc_CONN_OBJ *p_conn,
HTTPc_REQ_OBJ *p_req,
HTTPc_ERR err)
{
printf("Transaction error: %i\n\r", err);
} |