/*
 * Softcam plugin to VDR (C++)
 *
 * This code 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.
 *
 * This code is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
 */

#ifndef ___SC_H
#define ___SC_H

#include "stdafx.h"

void OpenCOM( void );
void CloseCOM( void );
void ResetCOM(void);
void ReadATR(void);
DWORD ReadCOM(HANDLE idComDev, BYTE* pBuf, DWORD dwBufSize, DWORD dwMustRead,LPOVERLAPPED osRead);
BOOL WriteCOM(HANDLE idComDev, BYTE* pBuf, DWORD dwBufSize,LPOVERLAPPED osWrite);
void SendINS(BYTE* instosend, int len, BYTE* result, bool movx=0);

class cSoftCAM {
friend class cCam;
private:
	static int foundKeys, newKeys;
	//
public:
	static bool Load(const char *cfgdir);
	static void Save(void);
	//
	static void FoundKey(void) { foundKeys++; }
	static void NewKey(void) { newKeys++; }
};

#endif // ___SC_H
