/*
 * btrcu plugin for VDR
 *
 * btrcu.h - PowerMate control class
 *
 * Copyright (C) 2004 Roland Praml < pram @ gmx . de >
 *
 * This code is distributed under the terms and conditions of the
 * GNU GENERAL PUBLIC LICENSE. See the file COPYING for details.
 */

#ifndef _BTRCU_H_
#define _BTRCU_H_

#include <vdr/keys.h>
#include <vdr/status.h>
#include <vdr/thread.h>
#include <vdr/remote.h>
#define BUFFER_SIZE 2048
class cBtRCU : public cThread, cStatus, cRemote
{
private:
	int fd;
	
	char key[16];
	int keylock;
	int creg;
	int type;
	char clipnr[255];
	int cliptype;
	
	int smsidx;
	int smsstat;
	char smsmem[8];
	char smstext[255];
	
	int pdulen;
	char buf[BUFFER_SIZE];
	int bufpos;

	int active;

	char rfdevice[256];
	char ctrlScript[256];
	
	virtual void Action();
	int yylex();
	int accept();
	int send(char * ATCmd );
	bool ctrl(const char * action, const char * param);
	bool ctrl(const char * action, const int param);

public:
	cBtRCU(const char * dev, const char * script);
	virtual ~cBtRCU();
};

extern cBtRCU * BtRCU;

#endif

