summaryrefslogtreecommitdiff
path: root/rcu.h
blob: be5c64afddd95f59fdc06ceab26acc8528ab1651 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
 * rcu.h: RCU remote control
 *
 * See the main source file 'vdr.c' for copyright information and
 * how to reach the author.
 *
 * $Id: rcu.h 1.4 2005/07/31 10:18:00 kls Exp $
 */

#ifndef __RCU_H
#define __RCU_H

#include "remote.h"
#include "status.h"
#include "thread.h"

class cRcuRemote : public cRemote, private cThread, private cStatus {
private:
  enum { modeH = 'h', modeB = 'b', modeS = 's' };
  int f;
  unsigned char dp, code, mode;
  int numberToSend;
  int lastNumber;
  bool receivedCommand;
  bool SendCommand(unsigned char Cmd);
  int ReceiveByte(int TimeoutMs = 0);
  bool SendByteHandshake(unsigned char c);
  bool SendByte(unsigned char c);
  bool Digit(int n, int v);
  bool SetCode(unsigned char Code);
  bool SetMode(unsigned char Mode);
  bool Number(int n, bool Hex = false);
  void SetPoints(unsigned char Dp, bool On);
  bool String(char *s);
  bool DetectCode(unsigned char *Code);
  virtual void Action(void);
  virtual void ChannelSwitch(const cDevice *Device, int ChannelNumber);
  virtual void Recording(const cDevice *Device, const char *Name);
public:
  cRcuRemote(const char *DeviceName);
  virtual ~cRcuRemote();
  virtual bool Ready(void);
  virtual bool Initialize(void);
  };

#endif //__RCU_H