2000-02-19 13:36:48 +01:00
|
|
|
/*
|
|
|
|
* remote.h: Interface to the Remote Control Unit
|
|
|
|
*
|
2000-04-24 09:46:05 +02:00
|
|
|
* See the main source file 'vdr.c' for copyright information and
|
2000-02-19 13:36:48 +01:00
|
|
|
* how to reach the author.
|
|
|
|
*
|
2000-05-07 09:28:39 +02:00
|
|
|
* $Id: remote.h 1.5 2000/05/07 09:27:54 kls Exp $
|
2000-02-19 13:36:48 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __REMOTE_H
|
|
|
|
#define __REMOTE_H
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <time.h>
|
|
|
|
|
|
|
|
class cRcIo {
|
|
|
|
private:
|
|
|
|
int f;
|
|
|
|
unsigned char dp, code, mode;
|
|
|
|
unsigned short address;
|
|
|
|
time_t t;
|
2000-04-16 13:54:16 +02:00
|
|
|
int firstTime, lastTime;
|
2000-02-19 13:36:48 +01:00
|
|
|
unsigned int lastCommand;
|
2000-05-07 09:28:39 +02:00
|
|
|
int lastNumber;
|
2000-02-19 13:36:48 +01:00
|
|
|
bool SendCommand(unsigned char Cmd);
|
|
|
|
int ReceiveByte(bool Wait = true);
|
|
|
|
bool SendByteHandshake(unsigned char c);
|
|
|
|
bool SendByte(unsigned char c);
|
2000-05-07 09:28:39 +02:00
|
|
|
bool Digit(int n, int v);
|
2000-02-19 13:36:48 +01:00
|
|
|
public:
|
|
|
|
enum { modeH = 'h', modeB = 'b', modeS = 's' };
|
|
|
|
cRcIo(char *DeviceName);
|
|
|
|
~cRcIo();
|
2000-04-23 15:38:16 +02:00
|
|
|
bool InputAvailable(bool Wait = false);
|
2000-02-19 13:36:48 +01:00
|
|
|
void Flush(int WaitSeconds = 0);
|
|
|
|
bool SetCode(unsigned char Code, unsigned short Address);
|
|
|
|
bool SetMode(unsigned char Mode);
|
|
|
|
bool GetCommand(unsigned int *Command, unsigned short *Address = NULL);
|
|
|
|
bool Number(int n, bool Hex = false);
|
2000-05-07 09:28:39 +02:00
|
|
|
void SetPoints(unsigned char Dp, bool On);
|
2000-02-19 13:36:48 +01:00
|
|
|
bool String(char *s);
|
|
|
|
bool DetectCode(unsigned char *Code, unsigned short *Address);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif //__REMOTE_H
|