This section contains APIs used when device acts as a HTTP server. 

rsi_webpage_load

Prototype int32_t rsi_webpage_load(uint8_t flags, uint8_t *file_name, uint8_t *webpage, uint32_t length);
Input Arguments uint8_t flags: BIT(2) is used to set webpage is associated with json object

uint8_t *file_name: File name of the html webpage

uint8_t *webpage: Pointer to the html webpage which contains the html webpage content Pointer to the html webpage which contains the html webpage content

uint32_t length :Webpage length

Return Value
  • On Success :  0
  • On Failure   :
  • if return value is less than 0
  • -4 : Buffer not available to serve the command
  • if return value is greater than 0
  • 0x0015,0x0021,0x0025,0x00C1,0x00C2,0x00C3,0x00C5,0x00C6,0x00C8
  • Please refer Error Codes for description of above error codes.
Description This API is used to load webpage to the HTTP Server’s file system which is present in the module
Example Usage rsi_webpage_load(8,”provisioning.html”,provisioning,(sizeof(provisioning)-1));

rsi_json_object_create

Prototype int32_t rsi_json_object_create(uint8_t flags, const char *file_name, uint8_t *json_object, uint32_t length);
Input Arguments uint8_t flags: Reserved

uint8_t *file_name: File name of the json object data

uint8_t *json_object : Pointer to the json object data

uint32_t length : Length of the json object data

Return Value
  • On Success :  0
  • On Failure   :
  • if return value is less than 0
  • -4 : Buffer not available to serve the command
  • if return value is greater than 0
  • 0x0015,0x0021,0x0025,0x002C,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6.
  • Please refer Error Codes for description of above error codes.
Description This API is used to create the json object to the webpage which is already present in the module’s HTTP server file system.
Example Usage rsi_json_object_create(0, “provisioning.html”, json_object_str, strlen(json_object_str));

rsi_webpage_erase

Prototype int32_t rsi_webpage_erase(uint8_t *file_name);
Input Arguments uint8_t *file_name: To erase particular/All loaded webpage files from the HTTP server’s file system

file_name : To erase the particular webpage file

NULL : To erase all loaded webpage files

Return Value
  • On Success :  0
  • On Failure   :
  • if return value is less than 0
  • -4 : Buffer not available to serve the command
  • if return value is greater than 0
  • 0x0021, 0x0025,0x002C, 0x00C4
  • Please refer Error Codes for description of above error codes.
Description This API is used to erase the webpage from HTTP server’s file system which is present in the module
Example Usage rsi_webpage_erase(“provisioning.html”);

rsi_json_object_delete

Prototype int32_t rsi_json_object_delete(uint8_t *file_name);
Input Arguments uint8_t *file_name: To delete the particular json object which is already created in the HTTP server’s file system
Return Value
  • On Success :  0
  • On Failure   :
  • if return value is less than 0
  • -4 : Buffer not available to serve the command
  • if return value is greater than 0
  • 0x0021, 0x0025,0x002C, 0x00B4
  • Please refer Error! Reference source not found. for description of above error codes.
Description This API is used to delete the json object of the HTTP server’s file system which is already present in the module.
Example Usage rsi_json_object_delete(“provisioning.html”);