The text of a manual · part 6 of 11
HT Series/PA Series/RH Series Programming Manual, pages 47 to 56
Pages 47 to 56 of 98
The original document is the PDF (1.2 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Unitech HT660 and Unitech HT680
Page 47
Function Description: Turn on / off LCD screen Function call: void PowerOnColorLCD(BOOL fON) Parameters(Input) fON: BOOL: TRUE = Power on LCD screen FALSE = Power off LCD screen
5
Dynamic Load DLL Compiler would not load the DLL while use dynamic load DLL, it help user to load the DLL if it exists while the application executed. The follow is the example. Note: Even user does not need include the header and lib file but need to know the function definition. ////////////////////////////////////////////////////////////////////////////////////////// //C++ HINSTANCE g_hUSIDLL; typedef BOOL (*lpfnUSI_GetScannerVersion)(LPTSTR model, LPTSTR firmware, LPTSTR sdk, int blen); lpfnUSI_GetScannerVersion USI_GetScannerVersion; g_hUSIDLL = LoadLibrary(L"\\Windows\\USI.dll"); if (g_hUSIDLL != NULL) { USI_GetScannerVersion = (lpfnUSI_GetScannerVersion)GetProcAddress(g_hUSIDLL, TEXT("USI_GetScannerVersion")); } else { MessageBox(_T("Load library USI.dll fail"), NULL, MB_OK); return; } TCHAR lstrmodel[50], lstrfirmware[50], lstrsdk[50]; if (USI_GetScannerVersion != NULL) rc = USI_GetScannerVersion(lstrmodel, lstrfirmware, lstrsdk, sizeof(lstrmodel) + sizeof(lstrfirmware) + sizeof(lstrsdk)); else MessageBox(_T("USI_GetScanerVersion does not find"), NULL, MB_OK); if (g_hUSIDLL != NULL) FreeLibrary(g_hUSIDLL); ////////////////////////////////////////////////////////////////////////////////////////// //C# [DllImport("SysIOAPI.dll", EntryPoint = "VibrationOn")] public static extern void VibrationOn(bool bEnable);
47 -
Page 48
6
RFID HF Reader To programming RFID HF reader, it needs C++ library. Please get it and sample code from below URL. http://w3.tw.ute.com/pub/cs/SDK/RFID/RFID_SDK.zip 6.1 General Function 6.1.1 Get library version Function Description: To get the library version. Function Call: INT32 RDINTsys_GetAPIVersionString (LPWSTR strVersion); Parameter: strVersion: Get the library version. Return code: Please refer to section 6.5.
6.1.2 Connect to RFID reader Function Description: To create a connection with the reader before control it. Function Call: INT32 RDINTsys_OpenReader (BYTE u8COMPort,UINT32 u32Baudrate,CONST LPTSTR strAccessCode,BYTE u1SecurityMode,UINT32 u32OpenDelayMs,PUINT32 pu32Baudrate) Parameter: u8COMPort: u32Baudrate: strAccessCode: u1SecurityMode:
u32OpenDelayMs: pu32Baudrate:
The reader’s COM port number (1 – 255) The reader’s baud rate and the defualt is 19200.It supports 9600, 19200, 38400 and 115200. The reader’s access code, default is “00000000” To set use security mode or not. TURN_ON : Open. TURN_OFF : Close. The delay time for wait reader initial, we suggest this value is 700. Receive the current reader’s baud rate, if it is NULL then it will not receive the value.
Return code: Please refer to section 6.5.
6.1.3 Close Reader Function Description: To finish controlling the reader. Function Call: INT32 RDINTsys_CloseReader (BYTE u8COMPort); Parameter: u8COMPort:
The reader’s COM port number (1 – 255)
Return code: Please refer to section 6.5. 48 -
Page 49
6.1.4 Select Card type Function Description: This API change the reader working type with different card type and this should be called before read the card. Function Call: INT32 RDINT_WorkingType (BYTE u8COMPort, BYTE u8Type); Parameter: u8COMPort: u8Type:
The reader’s COM port number (1 – 255) WT_ISO14443_TypeA WT_ISO14443_TypeB WT_ISO15693 WT_SR176_SRIX4K
Return code: Please refer to section 6.5.
6.1.5 Get Reader Information Function Description: Get the reader’s serial number and firmware version. Function Call: INT32 RDINTv2_ReaderInfo (BYTE u8COMPort, LPBYTE pu8SerialNum, LPBYTE pu8FirmwareVer); Parameter: u8COMPort: pu8SerialNum: pu8FirmwareVer:
The reader’s COM port number (1 – 255) Get reader’s serial number (Length: READER_SERIAL_LEN) Get reader’s firmware version (Length: FIRMWARE_VER_LEN)
Return code: Please refer to section 6.5.
6.1.6 Antenna Control Function Description: Enable/Disable antenna to save power. Function Call: INT32 RDINTv2_AntennaControl (BYTE u8COMPort, BYTE u8Select); Parameter: u8COMPort: u8Select:
The reader’s COM port number (1 – 255) ANTENNA_SELECT_ON ANTENNA_SELECT_OFF ANTENNA_SELECT_AUTO_POWER_LOW ANTENNA_SELECT_POWER_LOW
Return code: Please refer to section 6.5.
49 -
Open the antenna Close the antenna Auto turn to low power mode. Manually turn to low power mode.
Page 50
6.2 ISO-15693 6.2.1 Inventory Function Description: Set the card to StayQuiet mode and return the card ID. Function Call: INT32 RDINT_ISO15693Inventory(BYTE u8COMPort, BYTE u8Flag, BYTE u8Afi, BYTE u8MaskLen, LPBYTE pu8Mask, LPBYTE pu8Dsfid, LPBYTE pu8Uid); Parameter: u8COMPort: u8Flag: u8Afi: u8MaskLen:
pu8Mask: pu8Dsfid: pu8Uid:
The reader’s COM port number (1 – 255) It specifies the actions to be performed by the VICC and whether corresponding fields are present or not. Application Family Identifier parameter, please refer to ISO15693 document The mask length indicates the number of significant bits of the mask value. It can have any value between 0 and 60 when 16 slots are used and any value between 0 and 64 when 1 slot is used. LSB shall be transmitted first. The mask value is contained in an integer number of bytes. LSB shall be transmitted first. The Data Storage Format Identifier parameter, please refer to ISO15693 document. The point of the buffer which to receive the tag ID.
Return code: Please refer to section 6.5.
6.2.2 Set StayQuiet Mode Function Description: Set the card to StayQuiet mode. Function Call: INT32 RDINT_ISO15693StayQuiet(BYTE u8COMPort, BYTE u8Flag, LPBYTE pu8Uid); Parameter: u8COMPort: u8Flag: pu8Uid:
The reader’s COM port number (1 – 255) It specifies the actions to be performed by the VICC and whether corresponding fields are present or not. The point of the buffer which contain the tag ID.
Return code: Please refer to section 6.5.
6.2.3 Set Select Mode Function Description: Set the card to Select mode. Function Call: INT32 RDINT_ISO15693Select(BYTE u8COMPort, BYTE u8Flag, LPBYTE pu8Uid); Parameter: u8COMPort: u8Flag: pu8Uid:
The reader’s COM port number (1 – 255) It specifies the actions to be performed by the VICC and whether corresponding fields are present or not. The point of the buffer which contains the tag ID.
Return code: Please refer to section 6.5. 50 -
Page 51
6.2.4 Set Ready Mode Function Description: Set the card to Ready mode for StayQuiet or Select mode. Function Call: INT32 RDINT_ISO15693Reset2Ready(BYTE u8COMPort, BYTE u8Flag, LPBYTE pu8Uid); Parameter: u8COMPort: u8Flag: pu8Uid:
The reader’s COM port number (1 – 255) It specifies the actions to be performed by the VICC and whether corresponding fields are present or not. The point of the buffer which contains the tag ID.
Return code: Please refer to section 6.5.
6.2.5 Read The Block Data form ISO15693 Tag Function Description: Read the block data from the specific ISO15693 tag. Function Call: INT32 RDINT_ISO15693Read(BYTE u8COMPort, BYTE u8Flag, LPBYTE pu8Uid, BYTE u8BlockStart, BYTE u8BlockCount, LPBYTE pu8Data); Parameter: u8COMPort: u8Flag: pu8Uid: u8BlockStart: u8BlockCount: pu8Data:
The reader’s COM port number (1 – 255) It specifies the actions to be performed by the VICC and whether corresponding fields are present or not. The point of the buffer which contains the tag ID. The first block which you want to read(ex : 0, 1, 2…). The number of blocks which you want to read. The point of the buffer which receive the block data.
Return code: Please refer to section 6.5.
6.2.6 Write The Block Data to ISO15693 Tag Function Description: Write the block data to the specific ISO15693 tag. Function Call: INT32 RDINT_ISO15693Write(BYTE u8COMPort, BYTE u8Flag, LPBYTE pu8Uid, BYTE u8Block, LPBYTE pu8Data); Parameter: u8COMPort: u8Flag: pu8Uid: u8Block: pu8Data:
The reader’s COM port number (1 – 255) It specifies the actions to be performed by the VICC and whether corresponding fields are present or not. The point of the buffer which contains the tag ID. The block which you want to write(ex : 0, 1, 2…). The point of the buffer which contains the data.
Return code: Please refer to section 6.5.
51 -
Page 52
6.2.7 ISO15693 Lock Block Function Description: Lock the block on ISO15693 tag. Function Call: INT32 RDINT_ISO15693LockBlock(BYTE u8COMPort, BYTE u8Flag, LPBYTE pu8Uid, BYTE u8Block); Parameter: u8COMPort: u8Flag: pu8Uid: u8Block:
The reader’s COM port number (1 – 255) It specifies the actions to be performed by the VICC and whether corresponding fields are present or not. The point of the buffer which contains the tag ID. The block which you want to write(ex : 0, 1, 2…).
Return code: Please refer to section 6.5.
6.2.8 Write AFI to ISO15693 Tag Function Description: Write AFI to the specific ISO15693 tag. Function Call: INT32 RDINT_ISO15693WriteAfi(BYTE u8COMPort, BYTE u8Flag, LPBYTE pu8Uid, BYTE u8AfiValue); Parameter: u8COMPort: u8Flag: pu8Uid: u8AfiValue:
The reader’s COM port number (1 – 255) It specifies the actions to be performed by the VICC and whether corresponding fields are present or not. The point of the buffer which contains the tag ID. The value of AFI and about this value please refer to ISO15693 document.
Return code: Please refer to section 6.5.
6.2.9 ISO15693 Lock AFI Function Description: Lock the AFI on ISO15693 tag. Function Call: INT32 RDINT_ISO15693LockAfi(BYTE u8COMPort, BYTE u8Flag, LPBYTE pu8Uid); Parameter: u8COMPort: u8Flag: pu8Uid:
The reader’s COM port number (1 – 255) It specifies the actions to be performed by the VICC and whether corresponding fields are present or not. The point of the buffer which contains the tag ID.
Return code: Please refer to section 6.5.
52 -
Page 53
6.2.10 Write DSFID to ISO15693 Tag Function Description: Write DSFID to the specific ISO15693 tag. Function Call: INT32 RDINT_ISO15693WriteDsfid(BYTE u8COMPort, BYTE u8Flag, LPBYTE pu8Uid, BYTE u8DsfidValue); Parameter: u8COMPort: u8Flag: pu8Uid: u8DsfidValue:
The reader’s COM port number (1 – 255) It specifies the actions to be performed by the VICC and whether corresponding fields are present or not. The point of the buffer which contains the tag ID. The value of DSFID and about this value please refer to ISO15693 document.
Return code: Please refer to section 6.5.
6.2.11 ISO15693 Lock DSFID Function Description: Lock the DSFID on ISO15693 tag. Function Call: INT32 RDINT_ISO15693LockDsfid(BYTE u8COMPort, BYTE u8Flag, LPBYTE pu8Uid); Parameter: u8COMPort: u8Flag: pu8Uid:
The reader’s COM port number (1 – 255) It specifies the actions to be performed by the VICC and whether corresponding fields are present or not. The point of the buffer which contains the tag ID.
Return code: Please refer to section 6.5.
6.2.12 Get Data From Reader Function Description: Get the data from the reader’s buffer. Function Call: INT32 RDINT_GetReturnDataArray (BYTE u8COMPort, BYTE u8Indx, BYTE u8Offset, LPBYTE pu8Data); Parameter: u8COMPort: u8Indx: u8Offset: pu8Data:
The reader’s COM port number (1 – 255) The start index of pu8Data. The data’s length which get from ISO15693AutoInventory4Antennas The point which will receive the data from reader. The front four bytes mean which antenna get how many tags, the others are the data.
Return code: Please refer to section 6.5.
53 -
Page 54
6.3 ISO-14443A 6.3.1 Write Default Key Function Description: Write the default key to reader. Function Call: INT32 RDINT_WriteDefaultKey(BYTE u8COMPort, BYTE u8DefaultKeyIndx, LPBYTE pu8DefaultKey); Parameter: u8COMPort: u8DefaultKeyIndx: pu8DefaultKey:
The reader’s COM port number (1 – 255) The default key index in the reader The point of the buffer which contain key.
Return code: Please refer to section 6.5.
6.3.2 ISO-14443A Open Card Function Description: Lock the ISO-14443A tag and get the tag ID. After select card type, user should call this API before control the ISO-14443A tag. Function Call: INT32 RDINT_OpenCard(BYTE u8COMPort, BYTE u1AutoFind, LPBYTE pu8Uid, LPBYTE pu8Atqa, LPBYTE pu8Sak); Parameter: u8COMPort: u1AutoFind:
pu8Uid: pu8Atqa:
pu8Sak:
The reader’s COM port number (1 – 255) Auto search card. TURN_ON TURN_OFF Receive the tag ID. Return the ATQA card type. ATQA_MIFAER_S50 ATQA_MIFAER_S70 ATQA_ULTRA_LIGHT Return the SAK card type. SAK_ISO14443_3 SAK_ISO14443_4
Return code: Please refer to section 6.5.
54 -
Page 55
6.3.3 ISO-14443A Close Card Function Description: Unlock the ISO-14443A tag. After control the ISO-14443A tag, user should call this API to unlock the tag. Function Call: INT32 RDINT_CloseCard(BYTE u8COMPort); Parameter: u8COMPort:
The reader’s COM port number (1 – 255)
Return code: Please refer to section 6.5.
6.3.4 ISO-14443A Read Block Data Function Description: Read the specify block data. Function Call: INT32 RDINT_ReadMifareOneBlock(BYTE u8COMPort, BYTE u1KeyType, BYTE u1DefaultKey, BYTE u8DefaultKeyIndx, BYTE u8Block, LPBYTE pu8Key, LPBYTE pu8Data); Parameter: u8COMPort: u1KeyType:
u1DefaultKey:
u8DefaultKeyIndx: u8Block: pu8Key: pu8Data:
The reader’s COM port number (1 – 255) The private key type. CARD_KEY_A CARD_KEY_B Use the default password in the reader. TURN_ON TURN_OFF The index of the default key which in the reader. The block which you want to read (Ex : 0, 1, 2…). The user defines key value. Receive the data.
Return code: Please refer to section 6.5.
55 -
Page 56
6.3.5 ISO-14443A Read Sector Data Function Description: Read the specify sector data. Function Call: INT32 RDINT_ReadMifareOneSector(BYTE u8COMPort, BYTE u1KeyType, BYTE u1DefaultKey, BYTE u8DefaultKeyIndx, BYTE u8Sector, LPBYTE pu8Key, LPBYTE pu8Data); Parameter: u8COMPort: u1KeyType:
u1DefaultKey:
u8DefaultKeyIndx: u8Sector: pu8Key: pu8Data:
The reader’s COM port number (1 – 255) The private key type. CARD_KEY_A CARD_KEY_B Use the default password in the reader. TURN_ON TURN_OFF The index of the default key which in the reader. The sector which you want to read (Ex: 0, 1, 2…). The user defines key value. Receive the data.
Return code: Please refer to section 6.5.
6.3.6 ISO-14443A Write Block Data Function Description: Write data to the specify block. Function Call: INT32 RDINT_WriteMifareOneBlock(BYTE u8COMPort, BYTE u1KeyType, BYTE u1DefaultKey, BYTE u8DefaultKeyIndx, BYTE u8Block, LPBYTE pu8Key, LPBYTE pu8Data); Parameter: u8COMPort: u1KeyType:
u1DefaultKey:
u8DefaultKeyIndx: u8Block: pu8Key: pu8Data:
The reader’s COM port number (1 – 255) The private key type. CARD_KEY_A CARD_KEY_B Use the default password in the reader. TURN_ON TURN_OFF The index of the default key which in the reader. The block which you want to read (Ex: 0, 1, 2…). The user defines key value. The data which user wants to write.
Return code: Please refer to section 6.5.
56 -