Guide for porting the HTTP client library to a new platform.
To use the HTTP client library, a platform must implement the following components:
Settings that can be set as macros in the config header core_http_config.h
, or passed in as compiler options.
core_http_config.h
is not provided, then the HTTP_DO_NOT_USE_CUSTOM_CONFIG macro must be defined.The following macros can be configured for this library:
In addition, the following logging macros are used throughout this library:
The HTTP client library relies on transport interface callbacks that must be implemented in order to send and receive packets on a network.
The transport interface API used by the HTTP client is defined in transport_interface.h. A port must implement functions corresponding to the following functions pointers:
The above two functions take in a pointer to a NetworkContext_t, the type name of a struct NetworkContext
. The NetworkContext struct must also be defined by the user's implementation, and ought to contain any information necessary to send and receive data with the TransportSend_t and TransportRecv_t implementations, respectively: