This chapter provides a reference to the µC/HTTPs API. Each of the user-accessible services is presented in alphabetical order. The following information is provided for each of those services:
- A brief description
- The function prototype
- The filename of the source code
- A description of the arguments passed to the function
- A description of the returned values
- Specific notes and warnings on using the service
HTTPs_Init()
Initializes HTTP server.
Files
http-s.h
/ http-s.c
Prototype
Arguments
None.
Returned Values
DEF_OK
HTTP server successfully initialized;
DEF_FAIL
otherwise.
Required Configuration
None.
Notes / Warnings
None.
Example Usage
HTTPs_ValReq()
Returns the value corresponding to the token.
Files
http-s.h
/ Application’s source file
Called from
Prototype
Arguments
ptok
Token to look for.
pval
Value of token.
Returned Values
DEF_OK
Value of token returned successfully;
DEF_FAIL
otherwise.
Required Configuration
Available only if HTTPs_CFG_TOK_PARSE_EN
is DEF_ENABLED
in app_cfg.h
(see See Module Configuration.).
Notes / Warnings
This is a callback function that must be implemented in your application if HTTPs_CFG_TOK_PARSE_EN
is DEF_ENABLED
.
The application buffer used to parse the requested value(s) must be static/global since HTTPs_HTML_FileTokParse()
accesses this buffer after the call to HTTPs_ValReq()
.
Example Template
HTTPs_ValRx()
Handles POST action for every name-value pair received.
Files
http-s.h
/ Application’s source file
Called from
Prototype
Arguments
pvar
Name of the field
pval
Value of the field
Returned Values
DEF_OK
Value of token returned successfully;
DEF_FAIL
otherwise.
Required Configuration
None.
Notes / Warnings
This is a callback function that must be implemented in your application.