OmEspHelpers
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
OmEepromClass Class Reference

Wrapper for eeprom, lets you structure fields and check signature. More...

#include <OmEeprom.h>

Public Member Functions

OmEepromFieldaddField (const char *fieldName, EOmEepromFieldType type, uint8_t length, int omeFlags, const char *label)
 
void begin (const char *signature="x")
 
void end ()
 
bool get (const char *fieldName, void *valueOut, int valueLength=-1)
 
bool put (const char *fieldName, const void *value, int valueLength=-1)
 
int commit ()
 
void dumpState (const char *note=NULL)
 Print out the in-memory contents of the Eeprom and other misc. Helpful for debugging.
 
char * addString (const char *fieldName, uint8_t length)
 Add a string field, in group 0.
 
char * addString (const char *fieldName, uint8_t length, int omeFlags, const char *label)
 
int8_t * addInt8 (const char *fieldName, int omeFlags=0, const char *label=NULL)
 
int16_t * addInt16 (const char *fieldName, int omeFlags=0, const char *label=NULL)
 
int32_t * addInt32 (const char *fieldName, int omeFlags=0, const char *label=NULL)
 
void addBytes (const char *fieldName, uint8_t length, int omeFlags=0, const char *label=NULL)
 
void set (const char *fieldName, String stringValue)
 
void set (const char *fieldName, int32_t intValue)
 
bool set (const char *fieldName, int first, int count, uint8_t *bytes)
 
String getString (const char *fieldName)
 
void setString (const char *fieldName, String value)
 
int getInt (const char *fieldName)
 
void getBytes (const char *fieldName, int first, int count, uint8_t *bytes)
 
uint8_t getByte (const char *fieldName, int index)
 
int getFieldCount ()
 
int getDataSize ()
 
const char * getFieldName (int ix)
 
int getFieldLength (int ix)
 
int getFieldType (int ix)
 
OmEepromFieldfindField (const char *fieldName)
 
OmEepromFieldfindField (int ix)
 
void fieldFromString (const char *fieldName, String value)
 set a value from a string. convert to int for int type.
 
String fieldToString (const char *fieldName)
 retrieve value as string. convert from int for int type. (todo – format styles? flags?)
 

Public Attributes

bool verbose = false
 

Static Public Attributes

static bool active = false
 

Detailed Description

Wrapper for eeprom, lets you structure fields and check signature.

Member Function Documentation

◆ addString()

char * OmEepromClass::addString ( const char *  fieldName,
uint8_t  length,
int  omeFlags,
const char *  label 
)

Add a string field.

Parameters
fieldNamename stored with the field
lengthmaximum length of string
omeFlagslowest 8 bits specifies a "group" for this field, which can be presented as a Form on a page
labelpresentation name for this field – not saved in eeprom so you can change it when needed.

◆ commit()

int OmEepromClass::commit ( )

Commit the current in-memory eeprom to persistent eeprom/flash. Return number of bytes written, or -1 for failure.

Member Data Documentation

◆ active

bool OmEepromClass::active = false
static

This global OmEeprom magics into existence if and only if you use it. Arduino-style.


The documentation for this class was generated from the following files: