OOKwiz
on/off-keying for ESP32 and a variety of supported radio modules
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
Device Class Reference

#include <Device.h>

Public Member Functions

virtual bool receive (const RawTimings &raw, const Pulsetrain &train, const Meaning &meaning)
 virtual, to be overridden in de individual plugins More...
 
virtual bool transmit (const String &toTransmit)
 virtual, to be overridden in de individual plugins More...
 

Static Public Member Functions

static bool setup ()
 
static bool add (const char *name, Device *pointer)
 Registers an instance of Device, i.e. a devuce plugin in the static store More...
 
static String list (String separator=", ")
 Returns a String with alist of registered device plugins, appending " [disabled]" if needed. More...
 
static bool new_packet (RawTimings &raw, Pulsetrain &train, Meaning &meaning)
 Static, passes all 3 forms of an incoming packet to each non-disabled device plugin. More...
 
static bool transmit (const String &plugin_name, const String &toTransmit)
 static, passes a String to a named device's tx() function More...
 

Static Public Attributes

struct {
   Device *   pointer
 
   char   name [MAX_DEVICE_NAME_LEN]
 
store [MAX_DEVICES]
 
static int len = 0
 

Detailed Description

Definition at line 32 of file Device.h.

Member Function Documentation

◆ setup()

bool Device::setup ( )
static

Definition at line 12 of file Device.cpp.

◆ add()

bool Device::add ( const char *  name,
Device pointer 
)
static

Registers an instance of Device, i.e. a devuce plugin in the static store

Parameters
name(char*) Name of plugin, maximum MAX_DEVICE_NAME_LEN characters
pointerPointer to the plugin instance
Returns
false if store already holds info on MAX_DEVICES plugins

Definition at line 40 of file Device.cpp.

◆ list()

String Device::list ( String  separator = ", ")
static

Returns a String with alist of registered device plugins, appending " [disabled]" if needed.

Parameters
separatorBetween the names, e.g. ", "
Returns
The list

Definition at line 56 of file Device.cpp.

◆ new_packet()

bool Device::new_packet ( RawTimings raw,
Pulsetrain train,
Meaning meaning 
)
static

Static, passes all 3 forms of an incoming packet to each non-disabled device plugin.

Parameters
rawincoming packet
trainincoming packet
meaningincoming packet
Returns
true as soon as one of the plugin rx functions returns true, false otherwise

Definition at line 22 of file Device.cpp.

◆ transmit() [1/2]

bool Device::transmit ( const String &  plugin_name,
const String &  toTransmit 
)
static

static, passes a String to a named device's tx() function

Parameters
plugin_namename of plugin
toTransmitString to be passed to tx()
Returns

Definition at line 76 of file Device.cpp.

◆ receive()

bool Device::receive ( const RawTimings raw,
const Pulsetrain train,
const Meaning meaning 
)
virtual

virtual, to be overridden in de individual plugins

Parameters
rawincoming packet
trainincoming packet
meaningincoming packet
Returns
false if not overridden

Definition at line 92 of file Device.cpp.

◆ transmit() [2/2]

bool Device::transmit ( const String &  toTransmit)
virtual

virtual, to be overridden in de individual plugins

Parameters
toTransmitString for plugin to make sense of and be transmitted
Returns
false if not overridden

Definition at line 99 of file Device.cpp.

Member Data Documentation

◆ pointer

Device* Device::pointer

Definition at line 35 of file Device.h.

◆ name

char Device::name[MAX_DEVICE_NAME_LEN]

Definition at line 36 of file Device.h.

◆ 

struct { ... } Device::store[MAX_DEVICES]

◆ len

int Device::len = 0
static

Definition at line 38 of file Device.h.


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