LOGGER
Logger
Data Logging using ESP8266
|
#include "basetype.h"
Go to the source code of this file.
Functions | |
void | webServicesInit () |
Initialize the web services. | |
void | webServicesLoop () |
Perform periodic tasks managing web services. | |
void | webXMLstartFile () |
Start a XML file output. | |
void | webXMLendFile () |
End an XML file output. | |
void | webStartPage (const char *pName="") |
void | webEndPage () |
void | servicePageArguments () |
EXTERNDEF void | emitButton (Print *pPrint, const char *pTitle, const char *pValue, bool highlight=false, bool enabled=true) |
void | emitButtonTD (Print *pPrint, const char *pTitle, const char *pValue, bool highlight=false, bool enabled=true) |
void | emitNumberInput (Print *pPrint, String prefix, String name, int32_t defaultValue, int digits, int minAllowed, int maxAllowed) |
void | emitGenericSelector (Print *pPrint, String prefix, const char *pName, String selectedName, const char *const pNames[], bool isEnabled=true) |
void | emitMonthSelector (Print *pPrint, String prefix, const char *pName, uint8_t month) |
String | getDefaultedArgument (String name, String defaultValue="") |
bool | webservicesDoesArgumentExist (const char *pName) |
void | webservicesSetPermanentVariableFromArguments () |
void | versionPage () |
Report version information. | |
Variables | |
Print * | pWebPrint |
< version of this include file More... | |
Web page Service Routines
EXTERNDEF void emitButton | ( | Print * | pPrint, |
const char * | pTitle, | ||
const char * | pValue, | ||
bool | highlight = false , |
||
bool | enabled = true |
||
) |
Emit the control for a button. When pressed a post is done with the name 'ButtonPress' and value of pName to indicate which button was pressed. The button is placed in its own table to help with formatting on the page.
pPrint | where to send the output |
pTitle | presented to the user in the button image |
pValue | value of the buttonPress argument showing what was pressed |
highlight | true to highlight the value |
enabled | true if button can be clicked |
void emitButtonTD | ( | Print * | pPrint, |
const char * | pTitle, | ||
const char * | pValue, | ||
bool | highlight = false , |
||
bool | enabled = true |
||
) |
Emit a button in a TD element
pPrint | where to send the output |
pTitle | presented to the user in the button image |
pValue | value of the buttonPress argument showing what was pressed |
highlight | true to highlight the value |
enabled | true if button can be clicked |
void emitGenericSelector | ( | Print * | pPrint, |
String | prefix, | ||
const char * | pName, | ||
String | selectedName, | ||
const char *const | pNames[], | ||
bool | isEnabled = true |
||
) |
Make a Generic chooser
Forms a select list with one line per option:
/// <select name=selectName> /// <option VALUE="opt1">opt1 /// ... /// </select> ///
@param pPrint where to send the output @param prefix string to prefix the object name with @param pName name of the object @param selectedName which option is currently selected @param pNames list of names with a NULL at the end @param isEnabled true to allow selection
void emitMonthSelector | ( | Print * | pPrint, |
String | prefix, | ||
const char * | pName, | ||
uint8_t | month | ||
) |
Make a Month chooser
Forms a select list with one line per month:
/// <select name=selectName> /// <option VALUE="1">January /// ... /// </select> ///
@param pPrint where to send the output @param prefix string to prefix the object name with @param pName name of the object @param month current selected month as an integer 1-12
void emitNumberInput | ( | Print * | pPrint, |
String | prefix, | ||
String | name, | ||
int32_t | defaultValue, | ||
int | digits, | ||
int | minAllowed, | ||
int | maxAllowed | ||
) |
Emit a field of a form that inputs a number. When the minimum and maximum allowed values are both 0 then any positive value is allowed. When both are -1 than any value is allowed. When the maximum is less than the minimum no maximum constraint is used.
pPrint | where to send the output |
prefix | prefix string for the field name |
name | remainder of the field name |
defaultValue | value for the field |
digits | number of digits expected |
minAllowed | minimum allowed value |
maxAllowed | maximum allowed value |
String getDefaultedArgument | ( | String | name, |
String | defaultValue = "" |
||
) |
Get a server argument with a default value if the argument is not passed.
name | name of the argument to read |
defaultValue | value to use if the argument is missing |
void servicePageArguments | ( | ) |
Service arguments to the page. This will call application specific code with argument values read from the page arguments. It is expected that pages which handle arguments (i.e. button presses) will call this routine at the correct time in their display output to process the arguments and display the results of that processing.
void webEndPage | ( | ) |
End a web page. This emits the matching framework to a webStartPage().
bool webservicesDoesArgumentExist | ( | const char * | pName | ) |
Test to see if an argument exists
void webservicesSetPermanentVariableFromArguments | ( | ) |
Check the arguments to the web page. If the permanentname and the permanentvalue argument are both present set the permanent variable to the new value. Security checking is the responsibility of the caller.
void webStartPage | ( | const char * | pName = "" | ) |
Start a web page. This emits a framework for the page and initiates a table that has a menu in the left column a header across the top and a footer at the bottom. This call ends by emitting a
for a cell for the page unique content is the content. The for this cell will be emitted in the webEndPage() call.
pName | name of the page |
Print* pWebPrint |
< version of this include file
Global pointer to where to send output for the current web page