HTTPS_W to networking system tasks and avoid system freezes. This module implements the HTTPS Interface.
Overview
HTTPS_W (Hypertext Transfer Protocol Secure) is a protocol that encrypts data and transmits it between a web server and a client (such as a browser). Its primary function is to facilitate the transfer of data, including web pages, images, and other content, between the server and the client. It works on top of the TCP/IP protocol.
Features
The HTTPS_W module has the following key features:
- Start HTTP Server
- Stop HTTP Server
- Send HTTP request to Server
Configuration
Build Time Configurations for rm_https_w
The following build time configurations are defined in fsp_cfg/rm_https_w_cfg.h:
| Configuration | Options | Default | Description |
| Parameter Checking |
-
Default (BSP)
-
Enabled
-
Disabled
| Default (BSP) | If selected code for parameter checking is included in the build. |
| Watchdog Service Support |
| Disabled | Enable when using the Watchdog Service. |
| HTTP Server |
| Enabled | If selected HTTP Server role support is included in the build. |
| HTTP Client |
| Enabled | If selected HTTP Client role support is included in the build. |
Clock Configuration
This module has no required clock configurations.
Pin Configuration
This module does not use I/O pins.
Usage Notes
- This module is not a standalone module - ensure that the Wi-Fi module APIs are invoked first to configure the RA6W1/RA6W2 module and use the HTTPS APIs.
Limitations
- Note
- Should not use this the HTTPS APIs in interrupt context.
Examples
HTTPS Basic Example
This is a basic example of minimal use of the HTTPS_W in an application.
{
.port = HTTP_SERVER_PORT,
.insecure = pdFALSE,
.hostname = "localhost",
.path = "http://localhost/index.html",
};
err = wait_for_client_transfer_complete(false);
return err;
}
static fsp_err_t wait_for_client_transfer_complete (
bool allow_error)
{
uint32_t timeout = 1000000;
while (timeout > 0)
{
timeout--;
if (client_transfer_error)
{
if (allow_error)
{
break;
}
client_transfer_error = 0U;
}
if (client_transfer_complete)
{
break;
}
ulTaskNotifyTake(pdFALSE, portMAX_DELAY);
}
if (0U == timeout)
{
}
client_transfer_complete = 0U;
client_transfer_error = 0U;
return FSP_SUCCESS;
}
{
{
case HTTPS_EVENT_CLIENT_RESULT:
{
err_t err = *(int8_t *)p_args->p_param;
if (ERR_OK == err)
{
client_transfer_complete = 1;
}
else
{
client_transfer_error = 1;
}
break;
}
default:
break;
}
}
◆ https_w_instance_ctrl_t
| struct https_w_instance_ctrl_t |
◆ RM_HTTPS_W_Open()
Open Https module.
- Return values
-
| FSP_SUCCESS | HTTPS module was opened successfully. |
| FSP_ERR_ASSERTION | NULL pointer to parameters in argument. |
| FSP_ERR_ALREADY_OPEN | HTTPS module is already opened. |
◆ RM_HTTPS_W_Close()
Close Https module.
- Return values
-
| FSP_SUCCESS | HTTPS module was closed successfully. |
| FSP_ERR_ASSERTION | NULL pointer to parameters in argument. |
| FSP_ERR_NOT_OPEN | HTTPS module has not been opened |
◆ RM_HTTPS_W_ServerStart()
Start HTTP server.
- Return values
-
| FSP_SUCCESS | HTTPS server was started successfully. |
| FSP_ERR_ASSERTION | NULL pointer to parameters in argument. |
| FSP_ERR_NOT_OPEN | HTTPS module has not been opened |
| FSP_ERR_INVALID_STATE | Task was not created successfully. |
◆ RM_HTTPS_W_ServerStop()
Stop HTTP server.
- Return values
-
| FSP_SUCCESS | HTTPS server was stopped successfully. |
| FSP_ERR_ASSERTION | NULL pointer to parameters in argument. |
| FSP_ERR_NOT_OPEN | HTTPS module has not been opened |
◆ RM_HTTPS_W_CallbackSet()
Updates the user callback with the option to provide memory for the callback argument structure.
- Return values
-
| FSP_SUCCESS | Callback updated successfully. |
| FSP_ERR_ASSERTION | NULL pointer to parameters in argument. |
| FSP_ERR_NOT_OPEN | HTTPS module has not been opened |
◆ RM_HTTPS_W_ServerGetStatus()
| fsp_err_t RM_HTTPS_W_ServerGetStatus |
( |
https_ctrl_t *const |
p_api_ctrl, |
|
|
https_server_status_t * |
p_status |
|
) |
| |
Get HTTP server status.
- Return values
-
| FSP_SUCCESS | Successfully get the server status. |
| FSP_ERR_ASSERTION | NULL pointer to parameters in argument. |
| FSP_ERR_NOT_OPEN | HTTPS module has not been opened |
◆ RM_HTTPS_W_ClientSendRequest()
Send HTTP request to HTTP server.
- Return values
-
| FSP_SUCCESS | Successfully send a HTTP request. |
| FSP_ERR_ASSERTION | NULL pointer to parameters in argument. |
| FSP_ERR_NOT_OPEN | HTTPS module has not been opened |
| FSP_ERR_INVALID_ARGUMENT | Parameter passed into function was invalid. |
| FSP_ERR_INVALID_STATE | Mutex was not created successfully. |