SWNetServerApi - DLL UserGuideV1.0
SWNetServerApi - DLL UserGuideV1.0
SWNetServerApi - DLL UserGuideV1.0
dll
User’s Guide V1.0
1
SWNetServerApi.DLL is a dynamic link library designed to facilitate RFID application
software development.
1. Function List:
SWNetServerApi.DLL includes the following functions:
1.1 General Function:
1) BOOL SWNet_Listening(unsigned short iPort) ;
2) BOOL SWNet_CloseDevice(void);
3) BOOL SWNet_GetDeviceSystemInfo(int iSocket,unsigned char *pucSystemInfo);
4) BOOL SWNet_ReadDeviceOneParam(int iSocket,unsigned char
pucDevParamAddr,unsigned char *pValue);
5) BOOL SWNet_SetDeviceOneParam(int iSocket,unsigned char
pucDevParamAddr,unsigned char bValue);
6) BOOL SWNet_StopRead(int iSocket);
7) BOOL SWNet_StartRead(int iSocket);
8) void ( * FUNPTR_ACTIVE_CALLBACK)(int msg, int param1, unsigned char *param2,
int param3,unsigned char *param4);
9) int SWNet_SetCallback(FUNPTR_ACTIVE_CALLBACK pfAddr);
10) BOOL SWNet_InventoryG2(int iSocket, unsigned char *pBuffer, unsigned short *
Totallen, unsigned short *CardNum);
11) BOOL SWNet_WriteEPCG2(int iSocket, unsigned char * Password, unsigned char *
WriteEPC, unsigned char WriteEPClen);
12) BOOL SWNet_ReadCardG2 (int iSocket, unsigned char * Password ,unsigned char
Mem, unsigned char WordPtr, unsigned char ReadEPClen, unsigned char * Data);
13) BOOL SWNet_WriteCardG2(int iSocket, unsigned char * Password, unsigned char
Mem, unsigned char WordPtr,unsigned char Writelen, unsigned char * Writedata);
14) BOOL SWNet_RelayOn(int iSocket);
15) BOOL SWNet_RelayOff(int iSocket);
2. Function Explanation:
1
Return:Success return 1, failed return 0
2.1.4)BOOL SWNet_ReadDeviceOneParam(int iSocket,unsigned char
pucDevParamAddr,unsigned char *pValue)
Get Device One Param
Param: iSocket: Socket
pucDevParamAddr: Param Addr
pValue:Return Param Value
Return:Success return 1, failed return 0
2.1.5)BOOL SWNet_SetDeviceOneParam(int iSocket,unsigned char
pucDevParamAddr,unsigned char bValue)
Set Device One Param
Param: iSocket: Socket
pucDevParamAddr: Param Addr
bValue:Param
Return:Success return 1, failed return 0
2.1.6)BOOL SWNet_StopRead(int iSocket)
Stop all RF reading
Param: iSocket: Socket
Return:Success return 1, failed return 0
2.1.7)BOOL SWNet_StartRead(int iSocket)
Start all RF reading
Param: iSocket: Socket
Return:Success return 1, failed return 0
2.1.8)typedef void ( * FUNPTR_ACTIVE_CALLBACK)(int msg, int param1, unsigned char
*param2, int param3,unsigned char *param4)
Callback function prototype
msg == 0: Device Insert
msg == 1: Device Out
msg == 2: param1 means tag number, param2 means tagdata, param3 means
tagdata length,param4 means DevSN
2.1.9)int SWNet_SetCallback(FUNPTR_ACTIVE_CALLBACK pfAddr)
pfAddr: Callback function
2.1.10)BOOL SWNet_InventoryG2(int iSocket, unsigned char *pBuffer, unsigned short *
Totallen, unsigned short *CardNum)
Inventory EPC
Param: iSocket: Socket
pBuffer: Get Buffer
Totallen: Get Buffer Length
CardNum: Tag Number
Return: Success return 1, failed return 0
2.1.11)BOOL SWNet_WriteEPCG2(int iSocket, unsigned char * Password, unsigned char
* WriteEPC, unsigned char WriteEPClen)
Write EPC
Param: iSocket: Socket
Password: Password (4 bytes)
2
WriteEPC: Write Data
WriteEPClen: Write Length
Return:Success return 1, failed return 0
2.1.12)BOOL SWNet_ReadCardG2 (int iSocket, unsigned char * Password ,unsigned char
Mem, unsigned char WordPtr, unsigned char ReadEPClen, unsigned char * Data)
Read Card
Param: iSocket: Socket
Password: Password (4 bytes)
Mem: 0:Reserved 1:EPC 2:TID 3:USER
WordPtr: Start Address
ReadEPClen: Read Length
Data: Read Data
Return:Success return 1, failed return 0
2.1.13)BOOL SWNet_WriteCardG2(int iSocket, unsigned char * Password, unsigned char
Mem, unsigned char WordPtr,unsigned char Writelen, unsigned char * Writedata)
Write Card
Param: iSocket: Socket
Password: Password (4 bytes)
Mem: 0:Reserved 1:EPC 2:TID 3:USER
WordPtr: Start Address
WriteEPC: Write Data
WriteEPClen: Write Length
Return:Success return 1, failed return 0
2.1.14) BOOL SWNet_RelayOn(int iSocket)
RelayOn
Param: iSocket: Socket
Return:Success return 1, failed return 0
2.1.15) BOOL SWNet_RelayOff(int iSocket)
RelayOff
Param: iSocket: Socket
Return:Success return 1, failed return 0