GlobalCovfefe
GlobalCovfefeLearner.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2018 Bengt Martensson.
3 
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or (at
7 your option) any later version.
8 
9 This program is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
13 
14 You should have received a copy of the GNU General Public License along with
15 this program. If not, see http://www.gnu.org/licenses/.
16 */
17 
18 #pragma once
19 
20 #include <GlobalCovfefe.h>
21 #include <IrReader.h>
22 
28 public:
37  GlobalCovfefeLearner(IrSender *irSender, IrReader *irReader,
38  int commandLed = invalidPin, int learnLed = invalidPin, int transmitLed = invalidPin);
39 
44  virtual ~GlobalCovfefeLearner();
45 
46  virtual void processCommand(Stream &stream, char* buf) const;
47  virtual void blink(unsigned int count = blinkCount, milliseconds_t delay = blinkDelay) const;
48 
53  void getIRL(Stream &stream) const;
54 
55 private:
56  IrReader *irReader;
57  int learnLed;
58 };
static const int invalidPin
Definition: GlobalCovfefe.h:91
static const milliseconds_t blinkDelay
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)
This class emulates the IR sending of a GlobalCache device.
Definition: GlobalCovfefe.h:27
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.
static const unsigned int blinkCount
Definition: GlobalCovfefe.h:98