![]() |
RAFW Flexible Software Package Documentation
Release v2.0.1
|
|
Interface for HTTPS APIs.
The HTTPS interface provides HTTPS functionality including starting server or sending a HTTP request.
Data Structures | |
| struct | http_client_request_t |
| struct | http_client_receive_t |
| struct | http_client_conf_t |
| struct | https_callback_args_t |
| struct | https_cfg_t |
| struct | https_api_t |
| struct | https_instance_t |
Macros | |
| #define | HTTPC_MAX_REQ_DATA |
| Max size of HTTP Client's request data. | |
Typedefs | |
| typedef void | https_ctrl_t |
Enumerations | |
| enum | https_client_opcode_t |
| enum | https_event_t |
| enum | https_client_status_t |
| struct http_client_request_t |
HTTP Request structure
| Data Fields | ||
|---|---|---|
| https_client_opcode_t | op_code | Operation code. |
| uint32_t | iface | Interface. |
| uint32_t | port | Port number of HTTP Server. |
| uint32_t | insecure | Secure Mode. |
| char | hostname[HTTPC_MAX_HOSTNAME_LEN] | Host Name of HTTP request. |
| char | path[HTTPC_MAX_PATH_LEN] | Path of HTTP request. |
| char | data[HTTPC_MAX_REQ_DATA] | Data of HTTP request. |
| char | username[HTTPC_MAX_NAME] | User name of HTTP request. |
| char | password[HTTPC_MAX_PASSWORD] | Password of HTTP request. |
| httpc_secure_connection_t | https_conf | TLS Configuration. |
| struct http_client_receive_t |
| struct http_client_conf_t |
HTTP Client configuration
| Data Fields | ||
|---|---|---|
| https_client_status_t | status | Status of HTTP Client. |
| http_client_request_t | request | HTTP request instance. |
| http_client_receive_t | receive | HTTP receive instance. |
| struct https_callback_args_t |
Callback function parameter data
| Data Fields | ||
|---|---|---|
| https_event_t | event | The event can be used to identify what caused the callback. |
| void const * | p_context | Placeholder for user data. |
| void * | payload | |
| void * | p_param | |
| uint16_t | len | |
| struct https_cfg_t |
Configuration parameters.
Data Fields | |
| void(* | p_callback )(https_callback_args_t *) |
| Pointer to callback. | |
| void const * | p_context |
| Placeholder for user data. | |
| void const * | p_extend |
| Placeholder for user extension. | |
| struct https_api_t |
Functions implemented at the HAL layer will follow this API.
Data Fields | |
| fsp_err_t(* | open )(https_ctrl_t *const p_ctrl, https_cfg_t const *const p_cfg) |
| fsp_err_t(* | serverStart )(https_ctrl_t *const p_ctrl, https_server_sec_t *p_sec) |
| fsp_err_t(* | serverStop )(https_ctrl_t *const p_ctrl) |
| fsp_err_t(* | serverGetStatus )(https_ctrl_t *const p_ctrl, https_server_status_t *p_status) |
| fsp_err_t(* | callbackSet )(https_ctrl_t *const p_ctrl, void(*p_callback)(https_callback_args_t *), void const *const p_context, https_callback_args_t *const p_callback_memory) |
| fsp_err_t(* | clientSendRequest )(https_ctrl_t *const p_ctrl, http_client_request_t *p_request) |
| fsp_err_t(* | close )(https_ctrl_t *const p_ctrl) |
| fsp_err_t(* https_api_t::open) (https_ctrl_t *const p_ctrl, https_cfg_t const *const p_cfg) |
Initialize HTTPS module.
| [in] | p_ctrl | Pointer to control structure. |
| [in] | p_cfg | Pointer to pin configuration structure. |
| fsp_err_t(* https_api_t::serverStart) (https_ctrl_t *const p_ctrl, https_server_sec_t *p_sec) |
Start HTTP Server.
| [in] | p_ctrl | Pointer to control structure. |
| [in] | p_sec | Pointer to key and certificate. |
| fsp_err_t(* https_api_t::serverStop) (https_ctrl_t *const p_ctrl) |
Stop HTTP Server.
| [in] | p_ctrl | Pointer to control structure. |
| fsp_err_t(* https_api_t::serverGetStatus) (https_ctrl_t *const p_ctrl, https_server_status_t *p_status) |
Get server status.
| [in] | p_ctrl | Pointer to control structure. |
| [out] | p_status | Pointer to server status. |
| fsp_err_t(* https_api_t::callbackSet) (https_ctrl_t *const p_ctrl, void(*p_callback)(https_callback_args_t *), void const *const p_context, https_callback_args_t *const p_callback_memory) |
Set HTTPS module callback.
| [in] | p_ctrl | Pointer to control structure. |
| [in] | p_callback | Pointer to callback. |
| [in] | p_context | Pointer to data for callback. |
| [in] | p_callback_memory | Pointer to memory for callback. |
| fsp_err_t(* https_api_t::clientSendRequest) (https_ctrl_t *const p_ctrl, http_client_request_t *p_request) |
Send request to server.
| [in] | p_ctrl | Pointer to control structure. |
| [in] | p_request | Pointer to http request. |
| fsp_err_t(* https_api_t::close) (https_ctrl_t *const p_ctrl) |
Close HTTPS module.
| [in] | p_ctrl | Pointer to control structure. |
| struct https_instance_t |
This structure encompasses everything that is needed to use an instance of this interface.
| Data Fields | ||
|---|---|---|
| https_ctrl_t * | p_ctrl | Pointer to the control structure for this instance. |
| https_cfg_t const * | p_cfg | Pointer to the configuration structure for this instance. |
| https_api_t const * | p_api | Pointer to the API structure for this instance. |
| typedef void https_ctrl_t |
Control block. Allocate an instance specific control block to pass into the API calls.
Operation code of HTTP Client
| enum https_event_t |
Events that can trigger a callback function
Status of HTTP Client