
/*============================================================================
 Name        : zkfpi.h
 Author      :
 Date  	     : 2015.11
 Copyright   : ZKSoftware Inc.
 Description : Linux C
 ============================================================================*/
#ifndef __ZKFPI_H__
#define __ZKFPI_H__

#include <errno.h>
#define ETRANSFER_TIMEDOUT	116		//´«Êä³¬Ê±

//#pragma pack(push)
//#pragma pack(1)
//typedef struct _RSHeader_{
//	char Startcode;
//	char Command;
//	int Param;
//	int Size;
//	char Flag;
//	char CheckSum;
//	char Endcode;
//}TRSHeader, *PRSHeader;
//#pragma pack(pop)

#define START_CODE 0x70
#define END_CODE 0x0A

#ifdef __cplusplus
extern "C"
{
#endif

#if 0
	int ZKFPI_Init(unsigned short VID, unsigned short PID);
	int ZKFPI_Send(unsigned char *buffer, int len);
	int ZKFPI_Read(unsigned char *buffer, int len);
//	int ZKFPI_Write(unsigned char *buffer, int len);
#endif
int ZKFPI_Open(int index);
int ZKFPI_Close(void);

typedef int (*usb_init_t)(unsigned short, unsigned short);
typedef int (*usb_send_t)(unsigned char *, int);
typedef int (*usb_read_t)(unsigned char *, int, int);

typedef struct
{
	usb_init_t init;
	usb_send_t send;
	usb_read_t read;
}usb_dervice_t;
extern usb_dervice_t usb;
extern unsigned char *DataPackage;
#ifdef __cplusplus
}
#endif


#endif
