21 int commandLed_,
int learnLed_,
int transmitLed_)
22 :
GlobalCovfefe(irSender_, commandLed_, transmitLed_),irReader(irReader_),learnLed(learnLed_) {
34 for (
unsigned int i = 0; i < count; i++) {
41 if (strncmp(buf,
"get_IRL", 7) == 0)
48 stream.println(F(
"IR Learner Enabled"));
53 if (!irReader->isEmpty()) {
54 stream.print(F(
"sendir,1:1,1,"));
55 frequency_t freq = irReader->getFrequency();
58 for (
unsigned int i = 0; i < irReader->getDataLength(); i++) {
60 stream.print(((uint32_t) irReader->getDuration(i) * freq)/1000000UL);
void initLed(int pin) const
void getIRL(Stream &stream) const
Invoke the configured learner, and deliver the result in sendir format.
virtual void processCommand(Stream &stream, char *buf) const
Processes one command from the supplied Stream argument.
virtual void blink(unsigned int count=blinkCount, milliseconds_t delay=blinkDelay) const
Implements the blink command (found in GC-100)
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...
void turnOnLed(int pin) const
virtual ~GlobalCovfefeLearner()
This class emulates the IR sending of a GlobalCache device.
This class is derived from GlobalCovfefe, and adds the get_IRL command, invoking a learner...
GlobalCovfefeLearner(IrSender *irSender, IrReader *irReader, int commandLed=invalidPin, int learnLed=invalidPin, int transmitLed=invalidPin)
Main constructor.
virtual void processCommand(Stream &stream, char *buf) const
Processes one command from the supplied Stream argument.
void turnOffLed(int pin) const
virtual void blink(unsigned int count=blinkCount, milliseconds_t delay=blinkDelay) const
Implements the blink command (found in GC-100)