LOGGER  Logger
Data Logging using ESP8266
Classes | Macros | Typedefs | Functions | Variables
consoleio.cpp File Reference
#include <arduino.h>
#include <string.h>
#include <stdio.h>
#include <Time.h>
#include "consoleio.h"
#include "dataservices.h"
#include "dlvrpressure.h"
#include "flashservices.h"
#include "i2cservices.h"
#include "onewireservices.h"
#include "pincounter.h"
#include "sensorlibrary.h"
#include "services.h"
#include "sleepservices.h"
#include "tca9539.h"
#include "timeservices.h"
#include "version.h"
#include "pins_arduino.h"

Classes

struct  command
 Definition of command table entry. More...
 

Macros

#define consoleioEdit   2
 version of this module
 
#define SMALL_CONSOLE   0
 Build a small Console when true.
 
#define PIN_CONTROLS_ENABLED   1
 Controls for pin I/O can be disabled here.
 

Typedefs

typedef void(* pCOMMAND_FUNC) (const char *pLine)
 
typedef void(* pVOID_COMMAND_FUNC) ()
 Pointer to a command function with no arguments.
 

Functions

size_t strspn (const char *pString, const char *pChars)
 
LOCALREF void do_clearExpert ()
 If small turn off pin controls no matter what. More...
 
LOCALREF void do_dumpPin (const char *pLine)
 Dump current state of a pin.
 
LOCALREF void do_dumpPort (const char *pLine)
 
LOCALREF void do_help ()
 Print a simple help message.
 
LOCALREF void do_null ()
 Does nothing, for commands that do nothing.
 
LOCALREF void do_question (const char *pLine)
 
LOCALREF void do_setExpert ()
 Permit expert commands.
 
LOCALREF void do_setMode (const char *pLine)
 Dump current state of a pin.
 
LOCALREF int getNumericField (const char *pLine, int number, int base=10)
 
LOCALREF char * getField (const char *pLine, int number, bool capitalize=false)
 
LOCALREF const char * getRestAtFieldN (const char *pLine, int number)
 
LOCALREF bool parseCommand (const char *pLine)
 
EXTERNDEF void consoleioLoop ()
 < version of this include file More...
 

Variables

EXTERNVAR bool verboseReports
 True to emit verbose reports. More...
 

Detailed Description

Command line Parsing and console I/O

Typedef Documentation

typedef void(* pCOMMAND_FUNC) (const char *pLine)

Pointer to a command function. The function must accept a string which is the entire command line.

Function Documentation

EXTERNDEF void consoleioLoop ( )

< version of this include file

Command line parsing management. Call this routine once per main loop to see if a new command is ready and to parse and execute the command if it is.

EXTERNDEF void do_clearExpert ( )

If small turn off pin controls no matter what.

Forbid expert commands.

static void do_dumpPort ( const char *  pLine)

Dump a port

Parameters
pLinefirst field is port name one of B, C, or D
static void do_question ( const char *  pLine)

Print a list of commands

Parameters
pLinewhen NULL does verbose help
static char * getField ( const char *  pLine,
int  number,
bool  capitalize 
)

gets the Nth field

Parameters
pLinepointer to command line
numberwhich field to get (1 for first field)
capitalizetrue to convert to capital letters
Returns
pointer to string in static storage, never NULL, may be empty valid only until next call to this routine.

skip leading space

skip leading space

static int getNumericField ( const char *  pLine,
int  number,
int  base 
)

gets the Nth numeric field. A field that starts with 0x is in hex.

Parameters
pLinepointer to command line
numberwhich field to get (0 based)
basebase for field
Returns
pointer to string in static storage
static const char * getRestAtFieldN ( const char *  pLine,
int  number 
)

gets the remainder of a line starting at field N

Parameters
pLinepointer to command line
numberwhich field to get (0 based)
Returns
pointer to remainder of line starting at field N

skip leading space

skip leading space

static bool parseCommand ( const char *  pLine)

Look up a command and execute it.

Parameters
pLineNUL terminated command line
size_t strspn ( const char *  pString,
const char *  pChars 
)

same as C/C++ library function

??? This should be in the C library...

Variable Documentation

EXTERNVAR bool verboseReports

True to emit verbose reports.

Flag to control verbose reports.