/***************************************************************************
                          remote.h  -  description
                             -------------------
    begin                : Tue Jun 13 2000
    copyright            : (C) 2000 by Calvin Harrigan
    email                : charrig@viaccess.net
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef __REMOTE_H__
#define __REMOTE_H__

#include <stdio.h>
#include <iostream.h>
#include <serial.h>
#include "queue.h"

class Remote
{
public:
	Remote(){};
	Remote(const char *);   // constructor called with serial port to open
	~Remote();
	int Fail()const{return fFlag;};  // returns true on failure to initialize the serial port
	int GetKey()const;               // returns the next available character in the queue 0 other wise
	int GetFileDescriptor()const;    // returns the file descriptor of the serial port
// When data arrives from the remote control it is checked in
// the multiple switch statement below to be deciphered.  After which
// the result is put in the queue. Returns 0 on success, -1 on error.
 	int Event();
private:
	char buffer[10];
	int fFlag;             // fail flag
	Queue *q;              // pointer to internal objects
	linSerial *serPort;
	int sfd;               // file descriptor of serial port
	FILE * fPort;          // file stream of serial port

};
	

#endif // __REMOTE_H__
//============END OF FILE=====================

