Knowledge Base Nr: 00057 LIRCSupport.cpp - http://www.swe-kaiser.de

Downloads:

Frei konfigurierbarer WinLIRC-Client

  
// CLIRCSupport ist ein WinLIRC client der getriggert durch LIRC
// kommandos ausführt die in einem ini-file konfiguriert werden können.
// die sections werden nach der remote control und der taste benannt - getrennt
// durch einen underscore. es gibt verschiedene arten von kommandos: http, run, key

// [sony2_1]
// action=http
// repeat=no
// link="http://pentiumpro/kaiserreich/cgi-bin/k_kaiser.pl?page=eMail"
//
// [sony2_1]
// action=run
// repeat=no
// cmd1=C:\winnt\system32\notepad.exe
// param1=
// timeout1=10000
// show1=SW_NORMAL
//
// [sony_plus]
// action=key
// repeat=yes
// key=shift+a#

#ifndef LIRCSUPPORT_H
#define LIRCSUPPORT_H

#include "SocketSupport.h"
#include "ProcessSupport.h"
#include "logger.h"

#define LS_OK 0
#define LS_NOT_FOUND -1
#define LS_EXECUTE_ERROR -2
#define LS_ILLEGAL_ACTION -3
#define LS_ILLEGAL_KEY -4
#define LS_HTTP_ERROR -5


class CLIRCSupport : public CSocketSupport
{
public:
CLIRCSupport(CLog* pLog = 0, const char* lpszConfFile = 0);
virtual ~CLIRCSupport();

virtual void OnLogMessage(const char* lpszMsg);
virtual void OnSocketReceive(const char* lpszData, int nDataLen);

int ProcessIniSection(const char* lpszSection);

protected:
void WriteLog(char nLogType, const char* szFormat, ...);

private:
CLog* m_pLog;
CProcessSupport* m_pProc;
};

#endif //LIRCSUPPORT_H