HTTP Server#
Functions#
Register the callbacks. This is non blocking API.
Register the event callbacks. This is non blocking API.
Register the event callbacks. This is non blocking API.
Register webpage request callbacks. This is non blocking API.
Register wireless firmware upgrade callbacks. This is non blocking API.
Load the webpage to the HTTP Server's file system that is present in the module. This is a blocking API.
Create the JSON object to the webpage that is already present in the module's HTTP server file system. This is a blocking API.
Erase the webpage from HTTP server's file system that is present in the module. This is a blocking API.
Delete the JSON object of the HTTP server's file system that is already present in the module. This is a blocking API.
Send the webpage to HTTP server's file system. This is a blocking API.
Function Documentation#
rsi_wlan_nwk_register_json_update_cb#
int16_t rsi_wlan_nwk_register_json_update_cb (uint32_t callback_id, void(*)(uint8_t *filename, uint8_t *json_object, uint32_t length, uint32_t status) callback_handler_ptr, filename, json_object, length, status)
Register the callbacks. This is non blocking API.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint32_t | [in] | callback_id | - Callback ID which needs to be registered |
void(*)(uint8_t *filename, uint8_t *json_object, uint32_t length, uint32_t status) | [in] | callback_handler_ptr | - Callback handler which needs to be registered for a given callback |
[out] | filename | - json object filename | |
[out] | json_object | - json object data | |
[out] | length | - Length of the response buffer. | |
[out] | status | - Response status. |
Returns
0 - Success
Negative Value - Failure
Note
Please refer to Error Codes section for the description of the above error codes Error Codes.
rsi_wlan_nwk_register_json_event_cb#
int16_t rsi_wlan_nwk_register_json_event_cb (uint32_t callback_id, void(*)(uint32_t status, uint8_t *json_object, uint32_t length) callback_handler_ptr, status, json_object, length)
Register the event callbacks. This is non blocking API.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint32_t | [in] | callback_id | - Callback ID which needs to be registered |
void(*)(uint32_t status, uint8_t *json_object, uint32_t length) | [in] | callback_handler_ptr | - Callback handler which needs to be registered for a given callback |
[out] | status | - Response status. | |
[out] | json_object | - json object data | |
[out] | length | - Length of the response buffer. |
Returns
0 - Success
Positive Value - Failure
rsi_wlan_nwk_register_send_large_data_event_cb#
int16_t rsi_wlan_nwk_register_send_large_data_event_cb (void(*)(int32_t sock_id, int16_t status, uint16_t length) callback_handler_ptr, socket_id, status, length)
Register the event callbacks. This is non blocking API.
Type | Direction | Argument Name | Description |
---|---|---|---|
void(*)(int32_t sock_id, int16_t status, uint16_t length) | [in] | callback_handler_ptr | - Callback handler which needs to be registered for a given callback |
[out] | socket_id | - socket id for active connection. | |
[out] | status | - Response status. | |
[out] | length | - Length of the response buffer. |
Returns
0 - Success
Positive Value - Failure
prototypes of the callback functions#
Prototype | Description | Parameters |
---|---|---|
void (*rsi_send_large_data_async_complete_callback)(int32_t sock_id, int16_t status, uint16_t length); | This callback is used to Register rsi_send_large_data complete notify | sock_id => sock_id of the connection |
rsi_wlan_nwk_register_webpage_req_cb#
int16_t rsi_wlan_nwk_register_webpage_req_cb (uint32_t callback_id, void(*)(uint8_t type, uint8_t *url_name, uint8_t *post_content_buffer, uint32_t post_content_length, uint32_t status) callback_handler_ptr, type, url_name, post_content_buffer, post_content_length, status)
Register webpage request callbacks. This is non blocking API.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint32_t | [in] | callback_id | - Callback ID which needs to be registered |
void(*)(uint8_t type, uint8_t *url_name, uint8_t *post_content_buffer, uint32_t post_content_length, uint32_t status) | [in] | callback_handler_ptr | - Callback handler which needs to be registered for a given callback |
[out] | type | - Command type | |
[out] | url_name | - URL address of the domain | |
[out] | post_content_buffer | - Response buffer. | |
[out] | post_content_length | - Length of the response buffer. | |
[out] | status | - Response status. |
Returns
0 - Success
Positive Value - Failure
rsi_wlan_nwk_register_wireless_fw_upgrade_cb#
int16_t rsi_wlan_nwk_register_wireless_fw_upgrade_cb (uint32_t callback_id, void(*)(uint8_t type, uint32_t status) callback_handler_ptr, type, status)
Register wireless firmware upgrade callbacks. This is non blocking API.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint32_t | [in] | callback_id | - Callback ID which needs to be registered |
void(*)(uint8_t type, uint32_t status) | [in] | callback_handler_ptr | - Callback handler which needs to be registered for a given callback |
[out] | type | - Command type | |
[out] | status | - Response status. |
Returns
0 - Success
Positive Value - Failure
rsi_webpage_load#
int32_t rsi_webpage_load (uint8_t flags, uint8_t * file_name, uint8_t * webpage, uint32_t length)
Load the webpage to the HTTP Server's file system that is present in the module. This is a blocking API.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | [in] | flags | - BIT [2] is used to set the webpage that is associated with JSON object |
uint8_t * | [in] | file_name | - Filename of the HTML webpage |
uint8_t * | [in] | webpage | - Pointer to the HTML webpage that contains the HTML webpage content |
uint32_t | [in] | length | - Webpage length |
Returns
0 - Success
Negative Value - Failure (Possible Error Codes - 0xfffffffc)
Note
Precondition - rsi_wireless_init() API needs to be called before this API.
Refer to Error Codes for the description of above error codes.
rsi_json_object_create#
int32_t rsi_json_object_create (uint8_t flags, const char * file_name, uint8_t * json_object, uint32_t length)
Create the JSON object to the webpage that is already present in the module's HTTP server file system. This is a blocking API.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | [in] | flags | - Reserved |
const char * | [in] | file_name | - Filename of the JSON object data |
uint8_t * | [in] | json_object | - Pointer to the JSON object data |
uint32_t | [in] | length | - Length of the JSON object data |
Returns
0 - Success
Negative Value - Failure (Possible Error Codes - 0xfffffffc)
Note
Precondition - rsi_wireless_init() API needs to be called before this API.
Refer to Error Codes for the description of above error codes.
rsi_webpage_erase#
int32_t rsi_webpage_erase (uint8_t * file_name)
Erase the webpage from HTTP server's file system that is present in the module. This is a blocking API.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t * | [in] | file_name | - Erase particular/all loaded webpage files from the HTTP server's file system. |
Returns
0 - Success
Negative Value - Failure (Possible Error Codes - 0xfffffffc)
Note
Precondition - rsi_wireless_init() API needs to be called before this API.
Refer to Error Codes for the description of above error codes.
rsi_json_object_delete#
int32_t rsi_json_object_delete (uint8_t * file_name)
Delete the JSON object of the HTTP server's file system that is already present in the module. This is a blocking API.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t * | [in] | file_name | - Delete a particular JSON object that is already created in the HTTP server's file system |
Returns
0 - Success
Negative Value - Failure (Possible Error Codes - 0xfffffffc)
Note
Precondition - rsi_wireless_init() API needs to be called before this API.
Refer to Error Codes for the description of above error codes.
rsi_webpage_send#
int32_t rsi_webpage_send (uint8_t flags, uint8_t * webpage, uint32_t length)
Send the webpage to HTTP server's file system. This is a blocking API.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | [in] | flags | - Reserved |
uint8_t * | [in] | webpage | - Pointer to the HTML webpage that contains the HTML webpage content |
uint32_t | [in] | length | - Webpage length |
Returns
0 - Success
Negative Value - Failure (Possible Error Codes - 0xfffffffc)
Note
Precondition - rsi_wlan_connect() API needs to be called before this API.
Refer to Error Codes for the description of above error codes.