muwerk Scheduler Library
A low-resource cooperative scheduler with MQTT-like queues for Arduinos, ATtiny up to ESP32
Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations | Functions
ustd Namespace Reference

The muwerk namespace. More...

Classes

class  Console
 muwerk Console Class More...
 
class  Doctor
 muwerk Doctor Class More...
 
class  heartbeat
 muwerk HeartBeat Class More...
 
class  I2CDoctor
 muwerk I2CDoctor Class More...
 
class  jsonfile
 muwerk JSON File Class More...
 
class  numericFunction
 muwerk numericFunction class More...
 
class  Scheduler
 muwerk Scheduler Class More...
 
class  sensorprocessor
 muwerk sensorprocessor class More...
 
class  SerialConsole
 muwerk Serial Console Class More...
 
class  timeout
 muwerk Timeout Class More...
 
class  utimeout
 muwerk High Precision Timeout Class More...
 

Typedefs

typedef std::function< void(String command, String args, Print *printer)> T_COMMANDFN
 Console Extension Function.
 
typedef std::function< void()> T_TASK
 Scheduler Task Function.
 
typedef std::function< void(String topic, String msg, String originator)> T_SUBS
 Scheduler Subscription Function.
 

Enumerations

enum  T_PRIO {
}
 Scheduler Task Priority. More...
 
enum  T_MSGTYPE
 Scheduler Message Type.
 

Functions

bool fsBegin ()
 
bool fsDelete (String filename)
 
fs::File fsOpen (String filename, String mode)
 
fs::Dir fsOpenDir (String path)
 
unsigned long timeDiff (unsigned long first, unsigned long second)
 
void split (String &src, char delimiter, array< String > &result)
 
String shift (String &src, char delimiter=' ', String defValue="")
 

Detailed Description

The muwerk namespace.

Typedef Documentation

◆ T_COMMANDFN

typedef std::function<void(String command, String args, Print *printer)> ustd::T_COMMANDFN

Console Extension Function.

Extension function that implements a new command for a Console.

Enumeration Type Documentation

◆ T_PRIO

Scheduler Task Priority.

WARNING: Task Priorities are currently not supported by the scheduler.

Enumerator
PRIO_TIMECRITICAL 

System critical priority.

PRIO_HIGH 

Time critical priority.

PRIO_NORMAL 

High Priority.

PRIO_LOW 

Standard Priority (default for all tasks)

PRIO_LOWEST 

Low priority.

Function Documentation

◆ fsBegin()

bool ustd::fsBegin ( )

This function initializes the choosen file system. The Usually it is not needed to call this function explicitely since all file system abstration functions check that the file system has been initialized and in case invoke it.

Returns
true on success

◆ fsDelete()

bool ustd::fsDelete ( String  filename)

This function deletes the spcified file from the filesystem.

Parameters
filenameAbsolute filename of the file to be deleted
Returns
true on sucess

◆ fsOpen()

fs::File ustd::fsOpen ( String  filename,
String  mode 
)

This function opens the specified file and returns a file object.

Parameters
filenameAbsolute filename of the file to be opened
modeFile access mode (r, r+, w, w+, a, a+)
Returns
File object of the speicified file. To check whether the file was opened successfully, use the boolean operator.

◆ fsOpenDir()

fs::Dir ustd::fsOpenDir ( String  path)

This function opens a directory given its absolute path.

Parameters
pathAbsolute path to open
Returns
Dir object of the specified directory.

◆ shift()

String ustd::shift ( String &  src,
char  delimiter = ' ',
String  defValue = "" 
)

Extract the first argument from the supplied string using a given delimiter

Parameters
srcThe string object from which to shift out an argument
delimiter(optional, default whitespace) The delimiter character used for separating arguments
defValue(optional, default empty string) Default value to return if no more arguments available in the source string
Returns
The extracted arg

◆ split()

void ustd::split ( String &  src,
char  delimiter,
array< String > &  result 
)

Split a String into an array of segamnts using a specified delimiter.

Parameters
srcSource String.
delimiterDelimiter for splitting the string.
resultArray if strings holding the result of the operation.

◆ timeDiff()

unsigned long ustd::timeDiff ( unsigned long  first,
unsigned long  second 
)

Calculate time difference between two time values

This function calculates the difference between two time values honouring overflow conditions. This always works under the assumption that:

  1. the first value represents an earlier time as the second value
  2. the difference between the first and second value is lesser that the maximum value that unsigned long can hold.
Parameters
firstfirst time value
secondsecond time value
Returns
the time difference between the two values