...
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 function can be set up with the API function HTTPc_ConnSetParam()
with parameter type HTTPc_PARAM_TYPE_CONN_CONNECT_CALLBACK
. This hook is mandatory when the API function HTTPc_ConnOpen()
is called in no-blocking mode.
Prototype
Code Block |
---|
void HTTPc_ConnConnectHook (HTTPc_CONN_OBJ *p_conn_obj,
CPU_BOOLEAN open_status); |
...
Notes / Warnings
None.
Example Template
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
static void HTTPc_ConnConnectHook (HTTPc_CONN_OBJ *p_conn,
CPU_BOOLEAN open_status)
{
if (open_status == DEF_OK) {
printf("Connection to server succeeded.\n\r");
} else {
printf("Connection to server failed.\n\r");
}
} |