// fcT2DO.cpp : AvP[Vp̃Gg |Cg̒`
//

#include "stdafx.h"
#include "fcsrasapi.h"

//------------------------------------------------------------------------------
//	萔`
//------------------------------------------------------------------------------

//	RASc[@\A[BIT
#define	FCSRAS_ENABLE_TEMP		(0x0004)

int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow )
{
 	// TODO: ̈ʒuɃR[hLqĂB
	DWORD dwRet ;
	int	intAlarmBit, intWaringBit;				// ۑpϐ

	// ̕16if[^Ƃĕϊ
	sscanf(lpCmdLine,"%x %x",&intAlarmBit,&intWaringBit);

	// RASc[I[v
	dwRet = fcsoftrasOpen();

	// xA[̃`FbN
	if((intAlarmBit&FCSRAS_ENABLE_TEMP) != 0) {
		// [qT2DOON
		dwRet = fcsoftrasDigitalOut(0x01);
	}
	else {
		// [qT2DOOFF
		dwRet = fcsoftrasDigitalOut(0x00);
	}

	// RASc[N[Y
	dwRet = fcsoftrasClose();

	return 0;
}
