|
GlobalCovfefe
|
This class emulates the IR sending of a GlobalCache device. More...
#include <GlobalCovfefe.h>

Public Member Functions | |
| GlobalCovfefe (IrSender *irSender, int commandLed=invalidPin, int transmitLed=invalidPin) | |
| Main constructor. More... | |
| GlobalCovfefe (const GlobalCovfefe &orig) | |
| Copy constructor. More... | |
| virtual | ~GlobalCovfefe () |
| void | readProcessCommand (Stream &stream) const |
| Reads and processes one command from the supplied Stream argument. More... | |
| void | getdevices (Stream &stream) const |
| Implements the getdevices command. More... | |
| void | getversion (Stream &stream) const |
| Implements the getversion command. More... | |
| void | sendir (Stream &stream, char *buf) const |
| Implements the sendir command. More... | |
| virtual void | blink (unsigned int count=blinkCount, milliseconds_t delay=blinkDelay) const |
| Implements the blink command (found in GC-100) More... | |
Static Public Attributes | |
| static const char * | version = VERSION |
| Version of the present program. More... | |
| static const uint16_t | tcpPort = 4998U |
| The GlobalCache standard TCP command port. More... | |
| static const char | eolChar = '\r' |
| GlobalCache uses CR as line terminator. More... | |
| static const int | invalidPin = -1 |
| static const size_t | bufSize = 300U |
| Max length on input line. More... | |
| static const unsigned int | blinkCount = 3 |
| static const milliseconds_t | blinkDelay = 200 |
Protected Member Functions | |
| virtual void | processCommand (Stream &stream, char *buf) const |
| Processes one command from the supplied Stream argument. More... | |
| void | initLed (int pin) const |
| void | turnOnLed (int pin) const |
| void | turnOffLed (int pin) const |
| void | turnOnOffLed (int pin, milliseconds_t delay) const |
| Turns on the pin as the first argument, waits delay milli seconds, then turns off the pin. More... | |
This class emulates the IR sending of a GlobalCache device.
It does not know about Ethernet, only reads from (and writes to) a Stream, given as argument to a few of the member functions.
Definition at line 27 of file GlobalCovfefe.h.
| GlobalCovfefe::GlobalCovfefe | ( | IrSender * | irSender, |
| int | commandLed = invalidPin, |
||
| int | transmitLed = invalidPin |
||
| ) |
Main constructor.
| irSender | Pointer to an IrSender from Infrared4Arduino. |
| commandLed | Pin number of command LED, if present. |
| transmitLed | Pin number of transmit LED, if present. |
Definition at line 61 of file GlobalCovfefe.cpp.
| GlobalCovfefe::GlobalCovfefe | ( | const GlobalCovfefe & | orig | ) |
|
virtual |
Definition at line 71 of file GlobalCovfefe.cpp.
|
virtual |
Implements the blink command (found in GC-100)
| count | Number of times to flash. |
| delay | Delay in milli seconds |
Reimplemented in GlobalCovfefeLearner.
Definition at line 97 of file GlobalCovfefe.cpp.
| void GlobalCovfefe::getdevices | ( | Stream & | stream | ) | const |
Implements the getdevices command.
| stream | where the output is written. |
Definition at line 173 of file GlobalCovfefe.cpp.
| void GlobalCovfefe::getversion | ( | Stream & | stream | ) | const |
Implements the getversion command.
| stream | where the output is written. |
Definition at line 180 of file GlobalCovfefe.cpp.
|
protected |
Definition at line 74 of file GlobalCovfefe.cpp.
|
protectedvirtual |
Processes one command from the supplied Stream argument.
To be overridden in derived classes that are implementing more commands.
| stream | where possible output is written. |
| buf | Command line, to be interpreted. |
Reimplemented in GlobalCovfefeLearner.
Definition at line 121 of file GlobalCovfefe.cpp.
| void GlobalCovfefe::readProcessCommand | ( | Stream & | stream | ) | const |
Reads and processes one command from the supplied Stream argument.
| stream | where the output is written. |
Definition at line 104 of file GlobalCovfefe.cpp.
| void GlobalCovfefe::sendir | ( | Stream & | stream, |
| char * | buf | ||
| ) | const |
Implements the sendir command.
The command line, by writing on the supplied argument.
| stream | where the output (completeir) is written. |
| buf | Supposed to hold the complete command line. Is destroyed, thereby not const. |
Definition at line 150 of file GlobalCovfefe.cpp.
|
protected |
Definition at line 84 of file GlobalCovfefe.cpp.
|
protected |
Definition at line 79 of file GlobalCovfefe.cpp.
|
protected |
Turns on the pin as the first argument, waits delay milli seconds, then turns off the pin.
| pin | |
| delay |
Definition at line 89 of file GlobalCovfefe.cpp.
|
static |
Definition at line 98 of file GlobalCovfefe.h.
|
static |
Definition at line 100 of file GlobalCovfefe.h.
|
static |
Max length on input line.
Definition at line 96 of file GlobalCovfefe.h.
|
static |
|
static |
Definition at line 91 of file GlobalCovfefe.h.
|
static |
The GlobalCache standard TCP command port.
Definition at line 84 of file GlobalCovfefe.h.
|
static |
Version of the present program.
Definition at line 79 of file GlobalCovfefe.h.
1.8.14