#ifndef __sample_24_H__
#define __sample_24_H__

//By default, program compiled at IBM-compatible PC	has the address alignment issues which don't exist 
//in C51 environment. For convenience of data-handling,we use the compact-pack mode for storing the
//exchanging data-buffer used between PC and SenseLock EL device.For more ,pls refer to sample 17.

#ifdef _WIN32
#pragma pack(push, 1)
#endif 

#define IO_PACKAGE_HEADER_SIZE 2 //IO package header length:tag+len
#define MAX_IO_DATA_SIZE	0xf8 // maximum IO data size

/* command group definition */
#define CMD_DBL_ADD 0x00   // double add
#define CMD_DBL_SUB 0x01   // double sub
#define CMD_DBL_MLT 0x02   // double multiply
#define CMD_DBL_DIV 0x03   // double divide

/* common error code. */
#define ERR_SUCCESS				0x00	// success
#define ERR_SES					0x80	// SES function execution error
#define ERR_INVALID_PARAMETER	0x81	// invalid parameter

/* user-specific data block */
typedef struct _DATA_BLOCK
{
	unsigned char cmd;
    DOUBLE_T op1;
    DOUBLE_T op2;
} DATA_BLOCK;

/* IO package */
typedef struct _IO_PACKAGE
{	
	unsigned char tag;	
	unsigned char len;
	unsigned char buff[MAX_IO_DATA_SIZE];
} IO_PACKAGE;

#ifdef _WIN32
#pragma pack(pop)
#endif


#endif //__sample_24_H__