HTTP Server#

Functions#

int16_t
rsi_wlan_nwk_register_json_update_cb(uint32_t callback_id, void(*callback_handler_ptr)(uint8_t *filename, uint8_t *json_object, uint32_t length, uint32_t status))

Register the callbacks. This is non blocking API.

int16_t
rsi_wlan_nwk_register_json_event_cb(uint32_t callback_id, void(*callback_handler_ptr)(uint32_t status, uint8_t *json_object, uint32_t length))

Register the event callbacks. This is non blocking API.

int16_t
rsi_wlan_nwk_register_webpage_req_cb(uint32_t callback_id, void(*callback_handler_ptr)(uint8_t type, uint8_t *url_name, uint8_t *post_content_buffer, uint32_t post_content_length, uint32_t status))

Register webpage request callbacks. This is non blocking API.

int16_t
rsi_wlan_nwk_register_wireless_fw_upgrade_cb(uint32_t callback_id, void(*callback_handler_ptr)(uint8_t type, uint32_t status))

Register wireless firmware upgrade callbacks. This is non blocking API.

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.

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.

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.

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.

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.

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.

Parameters
[in]callback_id

- Callback ID which needs to be registered

[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.


Definition at line 134 of file driver/rsi_nwk.c

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.

Parameters
[in]callback_id

- Callback ID which needs to be registered

[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


Definition at line 167 of file driver/rsi_nwk.c

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.

Parameters
[in]callback_id

- Callback ID which needs to be registered

[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


Definition at line 205 of file driver/rsi_nwk.c

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.

Parameters
[in]callback_id

- Callback ID which needs to be registered

[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


Definition at line 237 of file driver/rsi_nwk.c

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.

Parameters
[in]flags

- BIT [2] is used to set the webpage that is associated with JSON object

[in]file_name

- Filename of the HTML webpage

[in]webpage

- Pointer to the HTML webpage that contains the HTML webpage content

[in]length

- Webpage length

Returns

  • 0 - Success

  • Negative Value - Failure (Possible Error Codes - 0xfffffffc)

Note


Definition at line 38 of file network/protocols/http_server/rsi_http_server.c

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.

Parameters
[in]flags

- Reserved

[in]file_name

- Filename of the JSON object data

[in]json_object

- Pointer to the JSON object data

[in]length

- Length of the JSON object data

Returns

  • 0 - Success

  • Negative Value - Failure (Possible Error Codes - 0xfffffffc)

Note


Definition at line 161 of file network/protocols/http_server/rsi_http_server.c

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.

Parameters
[in]file_name

- Erase particular/all loaded webpage files from the HTTP server's file system.
file_name - Erase a particular webpage file.
NULL - Erase all loaded webpage files

Returns

  • 0 - Success

  • Negative Value - Failure (Possible Error Codes - 0xfffffffc)

Note


Definition at line 277 of file network/protocols/http_server/rsi_http_server.c

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.

Parameters
[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


Definition at line 389 of file network/protocols/http_server/rsi_http_server.c

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.

Parameters
[in]flags

- Reserved

[in]webpage

- Pointer to the HTML webpage that contains the HTML webpage content

[in]length

- Webpage length

Returns

  • 0 - Success

  • Negative Value - Failure (Possible Error Codes - 0xfffffffc)

Note


Definition at line 476 of file network/protocols/http_server/rsi_http_server.c