
#include <stdio.h>

int ConnectRS232(const char* serial_point,int speed,int* fd,int logswitch);
int DisconnectRS232(int fd);
int ConnectTCP(const char* ipAddress,int port,int* fd,int logswitch);
int DisconnectTCP(int fd);
int SetAddress(unsigned char addr, unsigned char newAddr,int fd);
int SetInventoryScanTime( unsigned char addr, unsigned char ScanTime,int fd);
int SetRfPower(unsigned char addr, unsigned char power,int fd);
int SetRegion (unsigned char addr, unsigned char maxfre, unsigned char minfre,int fd);
int SetAntennaMultiplexing(unsigned char addr, unsigned char Ant,int fd);
int SetAntenna(unsigned char addr, unsigned char SetOnce,unsigned char AntCfg1,unsigned char AntCfg2,int fd);
int SetBeepNotification(unsigned char addr, unsigned char BeepEn,int fd);
int SetBaudRate (unsigned char addr, unsigned char fbaud,int fd);
int SetGPIO(unsigned char addr, unsigned char OutPutPin,int fd);
int GetGPIOStatus(unsigned char addr, unsigned char *OutPutPin,int fd);
int GetDeviceSN(unsigned char addr, unsigned char *DevSn,int fd);
int MeasureReturnLoss(unsigned char addr, unsigned char *Freqkhz,unsigned char Ant,unsigned char *retuenloss,int fd);
int SetCfgParam(unsigned char addr, unsigned char flag,unsigned char CFGNo,unsigned char *cfgdata,int len,int fd);
int GetCfgParam(unsigned char addr, unsigned char CFGNo,unsigned char *cfgdata,int *len,int fd);
int GetReaderInformation(unsigned char* addr,
			unsigned char* TVersionInfo,
			unsigned char* ReaderType,
			unsigned char* TrType,
			unsigned char* dmaxfre,
			unsigned char* dminfre,
			unsigned char* powerdBm,
			unsigned char* ScanTime,
			unsigned char* Ant,
			unsigned char* BeepEn,
			unsigned char* OutputRep,
			unsigned char* CheckAnt,int fd);
int SetProfile(unsigned char addr,unsigned char *Profile,int fd);
int SetRelay(unsigned char addr,unsigned char Num,unsigned char status, unsigned char RelayTime,int fd);
int SetCheckAnt(unsigned char addr,unsigned char CheckAnt,int fd);
int WriteRfPower(unsigned char addr,unsigned char PowerDbm,int fd);
int ReadRfPower(unsigned char addr,unsigned char *PowerDbm,int fd);
int RetryTimes(unsigned char addr,unsigned char *Times,int fd);
int SetRfPowerByAnt(unsigned char addr,unsigned char* PowerDbm,int length,int fd);
int GetRfPowerByAnt(unsigned char addr,unsigned char* PowerDbm,int *length,int fd);
int StopImmediately(unsigned char addr,int fd);
int GetReaderTemperature(unsigned char addr,unsigned char* PlusMinus,unsigned char* Temperature,int fd);
int Inventory_G2(unsigned char addr,
			unsigned char QValue,
			unsigned char Session,
			unsigned char AdrTID,
			unsigned char LenTID,
			unsigned char Target,
			unsigned char Ant,
			unsigned char Scantime,
			unsigned char *OutAnt,
			unsigned char * pOUcharIDList,		
			int* pOUcharTagNum,
			int* listLen,int fd);
int InventoryMix_G2(unsigned char addr,
			 unsigned char QValue,
			 unsigned char Session,
			 unsigned char ReadMem,
			 unsigned char *ReadAdr,
			 unsigned char ReadLen,
			 unsigned char *Psd,
			 unsigned char Target,
			 unsigned char InAnt,
			 unsigned char Scantime,
			 unsigned char *pEPCList,
			 unsigned char *Ant,
			 int *Totallen,		
			 int *CardNum,int fd);
int ReadData_G2(unsigned char addr,
			unsigned char ENum,
			unsigned char* EPC,
			unsigned char Mem,
			unsigned char WordPtr,
			unsigned char Num,
			unsigned char* Password,
			unsigned char* Data,
			unsigned char* Errorcode,int fd);
int WriteData_G2(unsigned char addr,
			unsigned char WNum,
			unsigned char ENum, 
			unsigned char* EPC,
			unsigned char Mem,
			unsigned char WordPtr,
			unsigned char* Writedata,
			unsigned char* Password,
			unsigned char* Errorcode,int fd);
			
int ExtReadData_G2(unsigned char address,
							unsigned char *EPC,
							unsigned char ENum,
							unsigned char Mem,
							unsigned char *WordPtr,
							unsigned char Num,
							unsigned char *Password,
							unsigned char MaskMem,
							unsigned char *MaskAdr,
							unsigned char MaskLen,
							unsigned char *MaskData,
							unsigned char *Data,
							unsigned char *Errorcode,int fd);
							
int ExtWriteData_G2(unsigned char address,
							 unsigned char *EPC,
							 unsigned char WNum,
							 unsigned char ENum,
							 unsigned char Mem,
							 unsigned char *WordPtr,
							 unsigned char *Wdt,
							 unsigned char *Password,
							 unsigned char MaskMem,
							 unsigned char *MaskAdr,
							 unsigned char MaskLen,
							 unsigned char *MaskData,
							 unsigned char *Errorcode,int fd);

int WriteEPC_G2(unsigned char addr,
			unsigned char ENum, 
			unsigned char* EPC,
			unsigned char* Password,
			unsigned char* Errorcode,int fd);
int Lock_G2(unsigned char addr,
			unsigned char ENum,
			unsigned char* EPC,
			unsigned char Select,
			unsigned char SetProtect,
			unsigned char* Password,
			unsigned char* Errorcode,int fd);
int KillTag_G2(unsigned char addr,
			unsigned char *EPC,
			unsigned char ENum,
			unsigned char *Killpwd,
			int *Errorcode,int fd);
int SelectCMDByAntenna(unsigned char addr,
			int Antenna,unsigned char portNum,
			unsigned char Session,
			unsigned char Selaction,
			unsigned char MaskMem,
			unsigned char *MaskAdr,
			unsigned char MaskLen,
			unsigned char *MaskData,
			unsigned char Truncate,int fd);






