LOM2M  0.8.0
Functions | Variables
bsp-esp8266.cpp File Reference
#include "bsp-esp8266.h"
#include <LittleFS.h>

Functions

const char * contentType (const String &filename)
 
utime_t get_utime ()
 
String get_ctime (time_t t)
 
utime_t getTimeFromString (String et)
 
void printHuman (Stream &to, int level, const char *tag, const char *data)
 
void printHumanSerial (int level, const char *tag, const char *data)
 
String getMac ()
 
void log_setup ()
 
void log (const char *fmt,...)
 
bool FSOpen ()
 
void FSClose ()
 
int persistenceStore (JsonObject toStore, const char *name)
 
DeserializationError persistenceLoad (JsonDocument &toStore, const char *name)
 

Variables

FS * filesystem = &LittleFS
 

Function Documentation

◆ contentType()

const char* contentType ( const String &  filename)

◆ FSClose()

void FSClose ( )

Enable to close the file system

Returns
true if success, false if failure

◆ FSOpen()

bool FSOpen ( )

Enable to open the file system

Returns
true if success, false if failure

◆ get_ctime()

String get_ctime ( time_t  t)

◆ get_utime()

utime_t get_utime ( )

◆ getMac()

String getMac ( )

◆ getTimeFromString()

utime_t getTimeFromString ( String  t)

Get the time given in parameter. Use the oneM2M format %04d%02d%02dT%02d%02d%02d

Parameters
t- time as String in oneM2M format
Returns
time in the used structure

◆ log()

void log ( const char *  fmt,
  ... 
)

◆ log_setup()

void log_setup ( )

◆ persistenceLoad()

DeserializationError persistenceLoad ( JsonDocument &  toStore,
const char *  name = defaultPersistenceName 
)

Enable to load data from a file into a jsondocument (provided) This open and close file system to do so

Returns
errorCode (see src/ArduinoJson/Deserialization/DeserializationError.hpp)
  • DeserializationError::Ok
  • DeserializationError::IncompleteInput
  • DeserializationError::InvalidInput
  • DeserializationError::NoMemory
  • DeserializationError::NotSupported <– + file or filesystem error
  • DeserializationError::TooDeep

◆ persistenceStore()

int persistenceStore ( JsonObject  toStore,
const char *  name = defaultPersistenceName 
)

Enable to store in a json file the whole json object provided This open and close file system to do so

Parameters
toStorejson object to store in the file
name(optional) name of the file where the data will be stored
Returns
error code, -1: error, >= 0 size of written data

◆ printHuman()

void printHuman ( Stream &  to,
int  level,
const char *  tag,
const char *  data 
)

◆ printHumanSerial()

void printHumanSerial ( int  level,
const char *  tag,
const char *  data 
)

Variable Documentation

◆ filesystem

FS* filesystem = &LittleFS