The muwerk namespace.
More...
|
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.
|
|
|
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="") |
|
◆ 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.
◆ 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.
|
◆ 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
-
filename | Absolute 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
-
filename | Absolute filename of the file to be opened |
mode | File 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
-
path | Absolute 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
-
src | The 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
-
src | Source String. |
delimiter | Delimiter for splitting the string. |
result | Array 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:
- the first value represents an earlier time as the second value
- the difference between the first and second value is lesser that the maximum value that
unsigned long
can hold.
- Parameters
-
first | first time value |
second | second time value |
- Returns
- the time difference between the two values