/*****************************************************************************************
*  Copyright (c) 2004, Beijing Senselock Data Security Centre
*  All rights reserved.
*
*  Filename£ºsample_3.c
*          
*  Briefs£º  The purpose of this snippet is to demonstrate how to reset SenseLock EL device
*            
*            
*  History:        
*  --------------------------------------------------------        
*            11/08/2004 v1.0.0.0 Lihua created
*            
*            
*******************************************************************************************/

#include <stdio.h>
#include <conio.h>
#include <assert.h>

#include "..\..\inc\win32\sense4.h"
#include "..\..\common\common.h"

int main(int argc, char* argv[])
{
	SENSE4_CONTEXT stS4Ctx = {0};
	unsigned long dwResult = 0;
		
    if (!(dwResult = OpenS4ByIndex(FIRST_S4_INDEX,&stS4Ctx)))
	{
		return 1;
	} 
	printf("Success!\n");
	

	printf("Reset SenseLock EL device  ...\n");
	dwResult = S4Control(&stS4Ctx, S4_RESET_DEVICE, NULL, 0, NULL, 0, NULL);
	if (dwResult != S4_SUCCESS) 
	{
		printf("Reset SenseLock EL device failed! <error code: 0x%08x>\n", dwResult);
		S4Close(&stS4Ctx);
		return 1;
	}
	printf("Success! \n");
	
	S4Close(&stS4Ctx);
    getch(); 
	return dwResult;
}





















