FreeRTOS: HTTPS Client
HTTPS Client v1.0.0 library
Return to main page ↑
IotHttpsClientCallbacks_t Struct Reference

HTTPS Client library callbacks for asynchronous requests. More...

#include <iot_https_types.h>

Data Fields

void(* appendHeaderCallback )(void *pPrivData, IotHttpsRequestHandle_t reqHandle)
 User-provided callback function signature for appending a header to current asynchronous request. More...
 
void(* writeCallback )(void *pPrivData, IotHttpsRequestHandle_t reqHandle)
 User-provided callback function signature for writing data to the network for a current asynchronous request. More...
 
void(* readReadyCallback )(void *pPrivData, IotHttpsResponseHandle_t respHandle, IotHttpsReturnCode_t rc, uint16_t status)
 User-provided callback function signature for reading data from the network for a current asynchronous response. More...
 
void(* responseCompleteCallback )(void *pPrivData, IotHttpsResponseHandle_t respHandle, IotHttpsReturnCode_t rc, uint16_t status)
 User-provided callback function signature to indicate that the asynchronous response is completed. More...
 
void(* connectionClosedCallback )(void *pPrivData, IotHttpsConnectionHandle_t connHandle, IotHttpsReturnCode_t rc)
 User-provided callback function signature to indicate that the connection has been close in an asynchronous request process. More...
 
void(* errorCallback )(void *pPrivData, IotHttpsRequestHandle_t reqHandle, IotHttpsResponseHandle_t respHandle, IotHttpsReturnCode_t rc)
 User-provided callback function signature to indicate that an error occurred during the asynchronous request process. More...
 

Detailed Description

HTTPS Client library callbacks for asynchronous requests.

Parameter for: IotHttpsClient_InitializeRequest

This type is a parameter in IotHttpsResponseInfo_t.

If any of the members in this type are set to NULL, then they will not be invoked during the asynchronous request/response process.

See Asynchronous Callbacks Ordering for the order of the order of the callbacks and when they will be invoked.

Field Documentation

◆ appendHeaderCallback

void( * IotHttpsClientCallbacks_t::appendHeaderCallback) (void *pPrivData, IotHttpsRequestHandle_t reqHandle)

User-provided callback function signature for appending a header to current asynchronous request.

If this is set to NULL, then it will not be invoked. See IotHttpsClient_AddHeader for more information on adding a header in this callback.

Appending the header when request is in progress is good for things like time limited authentication tokens.

Parameters
[in]pPrivData- User context configured in IotHttpsAsyncInfo_t.pPrivData
[in]reqHandle- The handle for the current HTTP request in progress.

◆ writeCallback

void( * IotHttpsClientCallbacks_t::writeCallback) (void *pPrivData, IotHttpsRequestHandle_t reqHandle)

User-provided callback function signature for writing data to the network for a current asynchronous request.

If this is set to NULL, then it will not be invoked. See IotHttpsClient_WriteRequestBody for more information on writing request body.

Parameters
[in]pPrivData- User context configured in IotHttpsAsyncInfo_t.pPrivData
[in]reqHandle- The handle for the current HTTP request in progress.

◆ readReadyCallback

void( * IotHttpsClientCallbacks_t::readReadyCallback) (void *pPrivData, IotHttpsResponseHandle_t respHandle, IotHttpsReturnCode_t rc, uint16_t status)

User-provided callback function signature for reading data from the network for a current asynchronous response.

The network indicated that after sending the associated request, the response is available for reading. If this is set to NULL, then it will not be invoked and any response body received will be ignored. See IotHttpsClient_ReadResponseBody for more information about reading the response body in this callback.

Parameters
[in]pPrivData- User context configured in IotHttpsAsyncInfo_t.pPrivData
[in]respHandle- The handle for the current HTTP response in progress.
[in]rc- A return code indicating any errors before this callback was invoked.
[in]status- The HTTP response status code of the current response in progress.

◆ responseCompleteCallback

void( * IotHttpsClientCallbacks_t::responseCompleteCallback) (void *pPrivData, IotHttpsResponseHandle_t respHandle, IotHttpsReturnCode_t rc, uint16_t status)

User-provided callback function signature to indicate that the asynchronous response is completed.

If this is set to NULL, then it will not be invoked.

This callback is invoked when the response is fully received from the network and the request/response pair is complete. If there was an error in sending the request or an error in receiving the associated response, this callback will be invoked, if the error caused the request or associated response to finish. IotHttpsClientCallbacks_t.errorCallback will be invoked first before this callback. This callback is invoked to let the application know that memory used by IotHttpsRequestInfo_t.userBuffer and IotHttpsResponseInfo_t.userBuffer can be freed, modified, or reused.

For a non-persistent connection, the connection will be closed first before invoking this callback.

Parameters
[in]pPrivData- User context configured in IotHttpsAsyncInfo_t.pPrivData
[in]respHandle- The handle for the current HTTP response in progress.
[in]rc- A return code indicating any errors before this callback was invoked.
[in]status- The HTTP response status code of the current response in progress.

◆ connectionClosedCallback

void( * IotHttpsClientCallbacks_t::connectionClosedCallback) (void *pPrivData, IotHttpsConnectionHandle_t connHandle, IotHttpsReturnCode_t rc)

User-provided callback function signature to indicate that the connection has been close in an asynchronous request process.

If this is set to NULL, then it will not be invoked. If there are errors during sending/receiving in the asynchronous process, the connection is not automatically closed. If the server closes the connection during the asynchronous process, this callback is not invoked. This callback is invoked only if the connection was flagged as non-persistent in IotHttpsConnectionInfo_t.flags.

Parameters
[in]pPrivData- User context configured in IotHttpsAsyncInfo_t.pPrivData
[in]connHandle- The handle for the current HTTP connection.
[in]rc- A return code indicating any errors before this callback was invoked.

◆ errorCallback

void( * IotHttpsClientCallbacks_t::errorCallback) (void *pPrivData, IotHttpsRequestHandle_t reqHandle, IotHttpsResponseHandle_t respHandle, IotHttpsReturnCode_t rc)

User-provided callback function signature to indicate that an error occurred during the asynchronous request process.

If respHandle is NULL, then reqHandle will not be NULL and vise-versa. This signals which handle the error occurred and if it is during the sending or receiving.

Parameters
[in]pPrivData- User context configured in IotHttpsAsyncInfo_t.pPrivData
[in]respHandle- The handle for the current HTTP response.
[in]reqHandle- The handle for the current HTTP request.
[in]rc- A return code indicating any errors before this callback was invoked.

The documentation for this struct was generated from the following file: