/*
 * 
 * SerLEDDeviceConsole.H header file for class SerLEDDevice
 *
 */

#ifndef SERLEDDEVICECONSOLE_H
#define SERLEDDEVICECONSOLE_H
 
//c - c++
#include "vector"
#include "string"

//vdr
#include "vdr/thread.h"
 
//this
#include "SerLEDDevice.H"
 
 
/**  @class SerLEDDeviceConsole 
     handles a sreial device 
     @author felix@rauscher-muenchen.de
     @date May 2006
*/

class SerLEDDeviceConsole : public SerLEDDevice
	{
	private:
//==========================private data members================================
	//! file descriptor for the device file
		int _file_d;
	public:
//=========================static constants=====================================
	//! led numbers
		static const int NUM_LOCK=0,
					  CAPS_LOCK=1,
					  SCROLL_LOCK=2,
					  BEEP=3;
//=========================constructor==========================================
	/** default constructor */
		inline SerLEDDeviceConsole() : _file_d(-1)
				      
		{}
	/** initializing constructor
	@param items line in config file broken up in strings
	    
	*/
		inline SerLEDDeviceConsole(const std::vector<std::string> &items) :
							_file_d(-1)
			{
			Initialize(items);
			}
//=========================public member fuctions===============================
	/** Initialize 
	@param items line in config file broken up in strings
	*/
		void Initialize(const std::vector<std::string> &items);
	/** Get a led number - return -1 if led is invalid
	@param items line in config file broken up in strings
	
	*/
		int GetLEDNumber(const std::vector<std::string> & items);
	/** Turn on LED 
	    @param led 
	*/
		void On(int led);
	/** Turn off LED 
	    @param led 
	*/
		void Off(int led);
	};
     
#endif
