Вы находитесь на странице: 1из 99

RECOGNITION SYSTEMS, INC.

ID3D Hand Reader Software Development Kit

2.5.8

Version

I D 3 D H A N D R E A D E R S O F T WA R E D E V E LO P M E N T K I T

Copyright 1996-2002 Recognition Systems, Inc. All rights reserved.

Recognition Systems, Inc. Campbell, CA 95008 Phone 408.341.4100 Fax 408.341.4101

Table of Contents
Introduction____________________________________5 Overview_______________________________________9 Level 0 API____________________________________11

rsiInstallChannel______________11 rsiOpenDirectChannel_________11 rsiSetModemInitString_________12 rsiOpenModemChannel________13 rsiOpenCustomChannel________13 rsiSetHandReader_____________14 rsiGetHandReader_____________15 rsiCloseChannel_______________15 rsiCOMDtr_____________________16 rsiCOMRts_____________________16 rsiCOMCts_____________________16 rsiCOMDsr_____________________17 rsiCOMRing___________________17 rsiCOMCarrier_________________17 rsiCOMLineBreak______________18 rsiCOMHardwareOverrun______18 rsiCOMBaudRate______________18 rsiCOMDataLength____________19 rsiCOMParity__________________19 rsiCOMStopBits________________20 rsiCOMRXFlush________________20 rsiCOMTXFlush________________21 rsiCOMRXCount_______________21 rsiCOMTXCount_______________21 rsiCOMGetChar________________22 rsiCOMGetBuffer______________22 rsiCOMGetString______________23 rsiCOMPutChar________________23 rsiCOMPutBuffer_______________24 rsiCancelPendingIO____________24 rsiStartupWsock_______________25 rsiCleanupWsock______________26 rsiInitWsock___________________26 rsiCloseWsock_________________27 rsiPing________________________27 rsiSetPings____________________28

rsiSendMessage_______________30 rsiGetResponse_______________31 rsiParseResponse______________32 rsiLookupCommandInfo________33 rsiLookupCommandDataSize_ _33 _ rsiLookupResponseInfo________34

Level 2 API________________35
rsiResume____________________35 rsiAbortCommand_____________35 rsiHereIsUserRecord___________35 rsiSendUserRecord____________35 rsiHereIsSetupData____________36 rsiRemoveUserRecord_________36 rsiCalibrate____________________36 rsiClearUserDataBase_________36 rsiSendCalibrationData________36 rsiSendLastUserRecord________36 rsiHereIsTime_________________37 rsiGetTime____________________37 rsiSendResults________________37 rsiSendStatusCRC_____________37 rsiEnterIdleMode______________37 rsiEnterIdleMode2_____________37 rsiBeep_______________________38 rsiHereIsBankNumber_________38 rsiHereIsDataBank_____________38 rsiSendDataBank______________38 rsiEnrollUser__________________38 rsiVerifyOnExternalData_______38 rsiSendTemplate______________39 rsiUpdateNVRam______________39 rsiSendDataLog_______________39 rsiSendPreviousDataLog_______39 rsiSendSetupData_____________39 rsiOutputControl_______________39 rsiHereIsDisplayMessage______40 rsiPrinterPassThrough_________40 rsiVerifyOnInternalData________40 rsiNextMessageIsTimeZone____40 rsiHereAreTimeZones__________40

Level 1 API________________30

rsiDisplayCodedMessage______41 rsiNextMessageIsBellScheduleTable 41 rsiHereIsBellScheduleTable____41

Level 3 API________________42
rsiGetUserRecord 42 rsiGetLastUserRecord__________42 rsiGetStatus___________________43 rsiSetBellSchedule_____________43 rsiSetTimeZoneTable__________44 rsiGetSetupData_______________44 rsiGetDataLogElement_________44 rsiGetCalibrationData__________45 rsiGetLastTemplate____________45 rsiGetResults__________________46 rsiGetDataBank_______________46 rsiSetDataBank________________47

RSI_BELL_SCHEDULE__________65 RSI_TIME_ZONE_INTERVAL_____65 RSI_TIME_ZONE_ELEMENT_____66 RSI_HOLIDAY_ELEMENT________66 RSI_TIME_ZONE_TABLE________66 RSI_DATA_LOG_ELEMENT______67 RSI_DATA_LOG_1______________68 RSI_DATA_LOG_2______________69 RSI_TA_7______________________70

Level 2 API________________82
rsiAddUserMessage____________82 rsiClearUserMessages_________83 rsiHereIsExtSetupData_________83 rsiHereIsExtUserRecord________84 rsiLoadFkeyFromFile___________84 rsiHereIsFkeyData_____________85 rsiRemoveUserMessage_______85 rsiSendExtSetupData__________86 rsiSetExtUserData_____________86 rsiSetUserData________________87

Data Conversion API_____48


rsiUserRecordToData__________48 rsiDataToUserRecord__________48 rsiSetupDataToData___________49 rsiDataToSetupData___________49 rsiTimeToData________________50 rsiDataToTime________________50 rsiDataToStatus_______________50 rsiTextToID____________________51 rsiIDToText____________________51 rsiTextToMessage_____________52 rsiTimeZoneTableToData______52 rsiBellScheduleToData_________52 rsiDisplayMessageToData______53 rsiDataToDataLog_____________53 rsiTextToTemplate____________54 rsiTemplateToText____________54

Level 3 API________________88
rsiGetExtSetupData___________88 rsiAllocResponseBuffer________88 rsiDeAllocResponseBuffer______88 rsiReadResponseBuffer________89 rsiGetExtUserRecord__________89 rsiGetOemCode_______________90 rsiGetReaderInfo______________90 rsiMemoryIs___________________91 rsiMemoryIs128K, rsiMemoryIs256K, rsiMemoryIs640K______________91 rsiModelIs_____________________91 rsiModelIsHK, rsiModelIsHKCR, rsiModelIsHKII, rsiModelIsHP, rsiModelIsHP2K, rsiModelIsHP3K, rsiModelIsHP4K, rsiModelIsSpecial 92

Miscellaneous Functions_ 5 5
rsiGetDataError_______________55 rsiGetComError________________56 rsiSleep_______________________56 rsiSetICD______________________57 rsiGetICD_____________________57

Data Conversion API_____93


rsiDataToExtSetupData________93 rsiDataToExtUserRecord_______93 rsiDataToReaderInfo___________94 rsiExtSetupDataToData________94 rsiExtUserDataToData_________94 rsiExtUserRecordToData_______95 rsiPackTI______________________95 rsiUnpackTI___________________96

Data Types & Sizes______58


RSI_RESPONSE________________58 RSI_USER_RECORD____________60 RSI_DISPLAY_MESSAGE________61 RSI_SETUP_DATA______________61 RSI_STATUS___________________63 RSI_CALIBRATION_DATA_______63 RSI_RESULTS__________________64 RSI_LAST_TEMPLATE___________64 RSI_BELL_SCHEDULE_ELEMENT_ 4 6

DLL Functions and Reader Commands Cross Reference ____________________________97

Chapter

Introduction
About RSI DLL

RSI DLL is a Windows Dynamic Linking Library which provides an interface for Windows applications to interact with RSI ID3D hand readers. RSI DLL supports communication with hand readers through direct serial links, Hayes compatible modems, Ethernet connection, or any serial port device. RSI DLL contains an API set that simplifies hand reader communication by providing both low and high level routines. There are actually two versions of RSI DLL, a 16-bit version and a 32-bit version. The physical DLL files are named RSIDLL16.DLL and RSIDLL32.DLL, respectively. The two versions support the exact same API. Thus source code written for one platform can be ported to the other simply by re-linking. Note that for serial link connections under Windows, the RSI DLL can support RS-232 direct connection, 4-wire RS-422 network configuration, or 2-wire RS-485 network configuration connected to an RSI DC103 Data Converter.

Whats New
2.4.2 Includes miscellaneous functions. See readme.txt for details. NOTE for modem connection only: It has been observed that failure (when calling rsiLoadFkeyFromFile, rsiHereIsFkeyData or rsiSetDataBank with a big data block of 4K) may occur in some modem models. To resolve this problem, disable data compression. For Hayes compatible modem, the command is %C0. Check your modem manual for proper command to disable data compression and use rsiSetModemInitString() to send the initialization string.

2.4.1 Includes module file RSIDLL32.BAS containing the RSIDLL32 function declarations for

Visual Basic and a VB test program called WHVB.EXE. 2.4 Includes new commands for new readers models HP2K, HP3K, HP4K, HKCR and HKII. 2.3.1 Pending DLL operations can now be canceled (rsiCancelPendingIO). Block output (rsiCOMPutbuffer()) is now done as single I/O operation rather than character-at-a-time to improve throughput. The main handreader message reception function (rsiGetResponse()) now does reads using block input rather than character-at-a-time input to improve efficiency. 2.2 Add Ethernet connection. 2.0 RSI DLL now supports simultaneous multiple channels: applications can open and use multiple communication ports at the same time. RSI DLL is now also thread-safe. This means multi-threaded applications can call the API from different threads. Applications can pass channel handles between threads to allow multiple threads to access the same channel. However, it is the applications responsibility to ensure more than one thread does not use the same channel at the same time. This can be done by using the Win32 synchronization functions to protect the channel handle. RSI DLL can now be used from any programming language that supports Windows DLLs, including Visual C++, Visual Basic, Visual Basic for Applications, Delphi, and many more. This manual and the header file RSI_CMD.H are written assuming C or C+ + will be the programming language used. To use RSI DLL with another language, you will need to convert RSI_CMD.H to that language. Because of the new functionality, there have been some changes in the API. The most significant is that most of the functions now take a channel handle as their first parameter. rsiInstallChannel returns this channel handle instead of a RSI_RESULT. The data conversion functions also now return a RSI_DATA_ERROR instead of a RSI_RESULT, eliminating the need for using rsiGetDataError when working with the data conversion routines. A file called RSI_OLD.H is provided to ease the transition from previous versions of the DLL. The include file contains overloaded C++ functions

that minimize the number of code changes necessary to successfully compile your program with the new RSI DLL. Include RSI_OLD.H after including RSI_CMD.H. See RSI_OLD.H for more details.

Chapter

Overview
Getting Started
The first step to using RSI DLL is including it in your project. The procedure for this is different for each compiler. RSI_CMD.H contains the API declarations and must be included for the compiler. You may also need to use the RSI DLL export library with your linker. Before you can communicate with the hand reader, you must initialize RSI DLL. This is done by calling several Level 0 API functions in the following order: 1. rsiInstallChannel (the returned handle must be saved and used with the rest of the API) 2. rsiOpenChannel (use one of the three available variations of this function) 3. rsiSetHandReader Once these three functions have been called, in that order, the DLL API is ready for use. You cannot use the API until these three functions have been called successfully. Note, however, that after the first call to rsiSetHandReader, it may be called any number of additional timeswith different reader addresseswithout re-installing or re-opening the channel. This is how you access different readers in a single session. After you are done using the API, you must de-initialize the DLL. This is usually done in the applications clean up or exit procedure by calling: rsiCloseChannel See the documentation for each of these functions for more information.

Getting Help
Aside from this reference manual which describes and prototypes each API function, you will probably also need the ID3D Hand Reader Software Manual and ID3D-R Operating and Installation Manual. A program called WinHand is provided as an example application. You should thoroughly study this program before starting your own project. It illustrates the usage of nearly all the RSI DLL API and is a good starting point. WinHand comes in 16-bit and 32-bit versions named WinHand16 and WinHand32, respectively. It is also very beneficial, and sometimes necessary, to look at RSI_CMD.H. This include file contains the declarations for the entire RSI DLL API. A test program written in Visual Basic called WHVB is also provided to illustrate the calls to the functions declared in module RSIDLL32.BAS. Refer to RSIDLLVB.DOC for a complete description of this program. For developing your real VB application, simply add module RSIDLL32.BAS to your project.

Highlights on Establishing Different Connections


Following is a summary on how to use Ethernet functions, in comparision to Direct or Modem connection: Ethernet Direct Modem rsiInstallChannel

1. rsiStartupWsockrsiInstallChannel

rsiInitWsock rsiOpenDirectChannel rsiOpenModemChannel 2. Once a Direct, Modem or Ethernet connection is established, other related communication functions can be called exactly the same way in these three types of connections. 3. rsiCloseWsock rsiCloseChannel rsiCloseChannel

Chapter

rsiCleanupWsock

Level 0 API
Initialization and Communication
The following functions are used to initialize and setup the DLL. Some must be called before and after using the DLL. Others provide the application an interface to the underlying communications channel (serial port).

rsiInstallChannel
P R O T O T YP E A R G U M E N T S

RSI_CHANNEL rsiInstallChannel (int com); int com Communications port number to use minus 1. For example, 0 for COM1 and 1 for COM2. Initializes the DLL for use with the specified COM port. As such, it must be called before any of the other routines. The handle it returns must be saved and passed to the other RSI DLL functions. A handle to the opened channel if successful. NULL if the channel could not be opened. No logic, except for NULL checking, should be performed on the returned handle as the definition of RSI_CHANNEL may change in future versions of the DLL.

D E S C R I P T I O N

R E T U R N S

N O T E S

rsiOpenDirectChannel
P R O T O T YP E

RSI_RESULT rsiOpenDirectChannel (RSI_CHANNEL chnl,

11

long baud);
A R G U M E N T S

RSI_CHANNEL chnl The handle returned by rsiInstallChannel. long baud Baud rate between 10 and 115200 to connect at.

D E S C R I P T I O N

Configures the DLL to communicate through a direct serial link to the hand reader at the specified baud rate. This function should be called immediately after rsiInstallChannel. Until this, or one of the other rsiOpenChannel functions, is called, NONE of the other routines can be used. RSI_SUCCESS if successful. RSI_INVALID_CHANNEL if the channel handle is not valid. RSI_ERROR_COM if unsuccessful. The specified baud rate should be the same as what the hand reader is configured for.

R E T U R N S

N O T E S

rsiSetModemInitString
P R O T O T YP E

RSI_RESULT rsiSetModemInitString (RSI_CHANNEL chnl, LPTSTR init_string); RSI_CHANNEL chnl The handle returned by rsiInstallChannel. LPTSTR init_string A pointer to the buffer holding the modem init. string to send.

A R G U M E N T S

D E S C R I P T I O N

Send the init. string to the modem.

R E T U R N S

RSI_SUCCESS if successful. RSI_INVALID_CHANNEL if the channel handle is not valid. rsiSetModemInitString is optional. If you wish to customize the rsiSetModemInitString should modem init. be called string, before

N O T E S

rsiOpenModemChannel. If rsiSetModemInitString is not called, a default, Hayes-compatible modem init string is used.

rsiOpenModemChannel
P R O T O T YP E

RSI_RESULT rsiOpenModemChannel (RSI_CHANNEL chnl, long baud, LPTSTR number, BOOL speaker); RSI_CHANNEL chnl The handle returned by rsiInstallChannel. long baud Baud rate between 10 and 115200 to connect at. LPTSTR number The phone number to dial. BOOL speaker TRUE to turn the speaker on while dialing or FALSE to turn the speaker off while dialing.

A R G U M E N T S

D E S C R I P T I O N

Configures the DLL to communicate through a standard Hayes compatible modem. The DLL configures the modem and dials out to establish the connection. This function should be called immediately after rsiInstallChannel. Until this, or one of the other rsiOpenChannel functions, is called, NONE of the other routines can be used. RSI_SUCCESS if successful. RSI_INVALID_CHANNEL if the channel handle is not valid. RSI_ERROR_COM if unsuccessful. The specified baud rate should be the same as what the hand reader modem is configured for.

R E T U R N S

N O T E S

rsiOpenCustomChannel
P R O T O T YP E A R G U M E N T S

RSI_RESULT rsiOpenCustomChannel (RSI_CHANNEL chnl); RSI_CHANNEL chnl

13

The handle returned by rsiInstallChannel.


D E S C R I P T I O N

Configures the DLL to communicate through a non-standard modem. The DLL does not configure the modem or dial out. Until this, or one of the other rsiOpenChannel functions, is called, NONE of the other routines can be used. RSI_SUCCESS if successful. RSI_INVALID_CHANNEL if the channel handle is not valid. RSI_ERROR_COM if unsuccessful. Call rsiInstallChannel first, then use the rsiCOM functions listed later in the chapter to configure the modem and dial out. After a connection has been established, call this function to enable the hand reader routines in the DLL. It is the applications responsibility to ensure a valid connection.

R E T U R N S

N O T E S

rsiSetHandReader
P R O T O T YP E

RSI_RESULT rsiSetHandReader (RSI_CHANNEL chnl, BYTE addr, RSI_STATUS FAR* status); RSI_CHANNEL chnl The handle returned by rsiInstallChannel. BYTE addr A reader address between 0x00 and 0xFE, but not 0xAA. RSI_STATUS FAR* status A pointer to a buffer to hold the status of the reader; this can be NULL.

A R G U M E N T S

D E S C R I P T I O N

Directs all further hand reader messages to be sent to the hand reader at this address. It also sets the hand reader in CRC mode. This function should be called immediately after one of the rsiOpenChannel routines. RSI_SUCCESS if successful. RSI_INVALID_CHANNEL if the channel handle is not valid. RSI_ERROR_DATA if the reader address is invalid. RSI_ERROR_COM if there is no hand reader at the address. By default, address 0x01 is used. But if this function is not called,

R E T U R N S

N O T E S

the reader at address 0x01 may or may not be in CRC mode and messages between the host and the reader may not work.

rsiGetHandReader
P R O T O T YP E A R G U M E N T S

BYTE rsiGetHandReader (RSI_CHANNEL chnl); RSI_CHANNEL chnl The handle returned by rsiInstallChannel. Gets the hand reader address messages are being sent to. The current hand reader address. By default, the address 0x01 rsiSetHandReader. is used until changed by

D E S C R I P T I O N R E T U R N S N O T E S

rsiCloseChannel
P R O T O T YP E A R G U M E N T S

RSI_RESULT rsiCloseChannel (RSI_CHANNEL chnl); RSI_CHANNEL chnl The handle returned by rsiInstallChannel. Closes the currently open channel. This function should be called in the applications clean-up or exit procedure. It may also be used to close the channel and open a new one. After this function has been called, NONE the other routines will work. RSI_SUCCESS if successful. RSI_INVALID_CHANNEL if the channel handle is not valid. If rsiOpenDirectChannel was used to open the channel, serial port is closed. If rsiOpenModemChannel was used, the modem is hung up the port is closed. If rsiOpenCustomChannel was used, the serial port is closed. the applications responsibility to hang up and disconnect modem before calling this function. the and It is the

D E S C R I P T I O N

R E T U R N S

N O T E S

15

rsiCOMDtr
P R O T O T YP E A R G U M E N T S

BOOL rsiCOMDtr (RSI_CHANNEL chnl, BOOL val); RSI_CHANNEL chnl The handle returned by rsiInstallChannel. BOOL val The new setting (TRUE = on or FALSE = off) or -1 to retrieve the current setting.

D E S C R I P T I O N R E T U R N S N O T E S

Gets or sets the state of the DTR signal. The current value or the new value (if successful). This function should rsiOpenCustomChannel. only be called when using

rsiCOMRts
P R O T O T YP E A R G U M E N T S

BOOL rsiCOMRts (RSI_CHANNEL chnl, BOOL val); RSI_CHANNEL chnl The handle returned by rsiInstallChannel. BOOL val The new setting (TRUE = on or FALSE = off) or -1 to retrieve the current setting.

D E S C R I P T I O N R E T U R N S N O T E S

Gets or sets the state of the RTS signal. The current value or the new value (if successful). This function should rsiOpenCustomChannel. only be called when using

rsiCOMCts
P R O T O T YP E A R G U M E N T S

BOOL rsiCOMCts (RSI_CHANNEL chnl); RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

D E S C R I P T I O N R E T U R N S N O T E S

Gets the state of the CTS signal. The current value. This function should rsiOpenCustomChannel. only be called when using

rsiCOMDsr
P R O T O T YP E A R G U M E N T S

BOOL rsiCOMDsr (RSI_CHANNEL chnl); RSI_CHANNEL chnl The handle returned by rsiInstallChannel. Gets the state of the DSR signal. The current value. This function should rsiOpenCustomChannel. only be called when using

D E S C R I P T I O N R E T U R N S N O T E S

rsiCOMRing
P R O T O T YP E A R G U M E N T S

BOOL rsiCOMRing (RSI_CHANNEL chnl); RSI_CHANNEL chnl The handle returned by rsiInstallChannel. Gets the state of the RI signal. The current value. This function should rsiOpenCustomChannel. only be called when using

D E S C R I P T I O N R E T U R N S N O T E S

rsiCOMCarrier
P R O T O T YP E A R G U M E N T S

BOOL rsiCOMCarrier (RSI_CHANNEL chnl); RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

17

D E S C R I P T I O N R E T U R N S N O T E S

Gets or sets the state of the CD signal. The current value. This function should rsiOpenCustomChannel. only be called when using

rsiCOMLineBreak
P R O T O T YP E A R G U M E N T S

BOOL rsiCOMLineBreak (RSI_CHANNEL chnl, BOOL val); RSI_CHANNEL chnl The handle returned by rsiInstallChannel. BOOL val The new setting (TRUE = on or FALSE = off) or -1 to retrieve the current setting.

D E S C R I P T I O N R E T U R N S N O T E S

Gets or sets the state of the break signal. The current value or the new value (if successful). This function should rsiOpenCustomChannel. only be called when using

rsiCOMHardwareOverrun
P R O T O T YP E A R G U M E N T S

BOOL rsiCOMHardwareOverrun (RSI_CHANNEL chnl); RSI_CHANNEL chnl The handle returned by rsiInstallChannel. Gets the state of the receiver overrun flag in the port. The current value. This function should rsiOpenCustomChannel. only be called when using

D E S C R I P T I O N R E T U R N S N O T E S

rsiCOMBaudRate
P R O T O T YP E

long rsiCOMBaudRate (RSI_CHANNEL chnl, long baud);

A R G U M E N T S

RSI_CHANNEL chnl The handle returned by rsiInstallChannel. long baud Baud rate between 10 and 115200 or -1 to retrieve the current baud rate.

D E S C R I P T I O N R E T U R N S N O T E S

Gets or sets the baud rate. The current or new baud rate or a negative value if unsuccessful. This function should rsiOpenCustomChannel. only be called when using

rsiCOMDataLength
P R O T O T YP E A R G U M E N T S

int rsiCOMDataLength (RSI_CHANNEL chnl, int dlen); RSI_CHANNEL chnl The handle returned by rsiInstallChannel. int dlen Data length between 5 and 8 or -1 to retrieve the current data length.

D E S C R I P T I O N R E T U R N S N O T E S

Gets or sets the data length. The current or new data length or a negative value if unsuccessful. This function should rsiOpenCustomChannel. only be called when using

rsiCOMParity
P R O T O T YP E A R G U M E N T S

char rsiCOMParity (RSI_CHANNEL chnl, char parity); RSI_CHANNEL chnl The handle returned by rsiInstallChannel. char parity Parity setting: N (no parity), O (odd parity), E (even parity), S (space parity), M (mark parity).

19

D E S C R I P T I O N R E T U R N S

Gets or sets the parity settings. The current or new parity setting or a negative value if unsuccessful. This function should rsiOpenCustomChannel. only be called when using

N O T E S

rsiCOMStopBits
P R O T O T YP E A R G U M E N T S

int rsiCOMStopBits (RSI_CHANNEL chnl, int sbits); RSI_CHANNEL chnl The handle returned by rsiInstallChannel. int sbits Number of stop bits: 1 or 2.

D E S C R I P T I O N R E T U R N S

Gets or sets the number of stop bits. The current or new number of stop bits or a negative value if unsuccessful. This function should rsiOpenCustomChannel. only be called when using

N O T E S

rsiCOMRXFlush
P R O T O T YP E A R G U M E N T S

int rsiCOMRXFlush (RSI_CHANNEL chnl, unsigned count); RSI_CHANNEL chnl The handle returned by rsiInstallChannel. unsigned count Number of bytes to flush or 0 to flush the entire buffer.

D E S C R I P T I O N R E T U R N S

Flushes all or some of the receive buffer 0 if successful. A negative value if unsuccessful. This function should rsiOpenCustomChannel. only be called when using

N O T E S

rsiCOMTXFlush
P R O T O T YP E A R G U M E N T S

void rsiCOMTXFlush (RSI_CHANNEL chnl); RSI_CHANNEL chnl The handle returned by rsiInstallChannel. Flushes output buffer NONE
rsiPing, 22 rsiSetPings, 23

D E S C R I P T I O N R E T U R N S

N O T E S

This function should rsiOpenCustomChannel.

only

be

called

when

using

rsiCOMRXCount
P R O T O T YP E A R G U M E N T S

unsigned rsiCOMRXCount (RSI_CHANNEL chnl); RSI_CHANNEL chnl The handle returned by rsiInstallChannel. Gets the number of characters in the receive buffer. The number of bytes in the receive buffer. This function should rsiOpenCustomChannel. only be called when using

D E S C R I P T I O N R E T U R N S N O T E S

rsiCOMTXCount
P R O T O T YP E A R G U M E N T S D E S C R I P T I O N R E T U R N S N O T E S

unsigned rsiCOMTXCount (RSI_CHANNEL chnl); NONE Gets the number of characters in the transmit buffer. The number of bytes in the transmit buffer. This function should rsiOpenCustomChannel. only be called when using

21

rsiCOMGetChar
P R O T O T YP E A R G U M E N T S

int rsiCOMGetChar (RSI_CHANNEL chnl, unsigned msecs); RSI_CHANNEL chnl The handle returned by rsiInstallChannel. unsigned msecs Number of milliseconds to wait for a character.

D E S C R I P T I O N R E T U R N S N O T E S

Attempts to retrieve a character from the receive queue. The character or a negative value if unsuccessful. This function should rsiOpenCustomChannel. only be called when using

rsiCOMGetBuffer
P R O T O T YP E

long rsiCOMGetBuffer (RSI_CHANNEL chnl, LPBYTE buffer, unsigned count, unsigned msecs); RSI_CHANNEL chnl The handle returned by rsiInstallChannel. LPBYTE buffer Pointer to the buffer to receive the characters. unsigned count Maximum number of characters to read. unsigned msecs Number of milliseconds to wait for a character.

A R G U M E N T S

D E S C R I P T I O N

Attempts to read characters from the input queue. The buffer will be null terminated. The number of characters read. This function should rsiOpenCustomChannel. only be called when using

R E T U R N S N O T E S

rsiCOMGetString
P R O T O T YP E

long rsiCOMGetString (RSI_CHANNEL chnl, LPBYTE buffer, unsigned count, int delim, long msecs); RSI_CHANNEL chnl The handle returned by rsiInstallChannel. LPBYTE buffer Pointer to the buffer to receive the string. unsigned count Maximum number of characters to read. int delim Delimiting character or -1 to function like rsiCOMGetBuffer. unsigned msecs Number of milliseconds to wait for a character.

A R G U M E N T S

D E S C R I P T I O N

Attempts to read characters from the input queue until the delimiting character is read. The buffer will be null terminated. The number of characters read. This function should rsiOpenCustomChannel. only be called when using

R E T U R N S N O T E S

rsiCOMPutChar
P R O T O T YP E A R G U M E N T S

int rsiCOMPutChar (RSI_CHANNEL chnl, BYTE outc); RSI_CHANNEL chnl The handle returned by rsiInstallChannel. BYTE outc Character to output.

D E S C R I P T I O N R E T U R N S

Writes a single character to the serial port. 0 if successful. A negative value if unsuccessful. This function should only be called when using

N O T E S

23

rsiOpenCustomChannel.

rsiCOMPutBuffer
P R O T O T YP E

unsigned rsiCOMPutBuffer (RSI_CHANNEL chnl, LPBYTE buf, unsigned count); RSI_CHANNEL chnl The handle returned by rsiInstallChannel. LPBYTE buf Pointer to the buffer that contains the data to be sent. unsigned count Number of bytes to send.

A R G U M E N T S

D E S C R I P T I O N R E T U R N S

Writes bytes to the serial port. Value of count if successful. Some other number if unsuccessful. This function should rsiOpenCustomChannel. only be called when using

N O T E S

rsiCancelPendingIO
P R O T O T YP E

void rsiCancelPendingIO(RSI_CHANNEL chnl, BOOL State ); RSI_CHANNEL chnl The handle returned by rsiInstallChannel. BOOL State Flag indicating the state of cancellation. To cancel all current and future operations, pass TRUE. To stop canceling operations, pass FALSE..

A R G U M E N T S

D E S C R I P T I O N R E T U R N S

Cancels and pending I/O operations or cancels a pending cancel. None

N O T E S

Call this function at anytime after rsiInstallChannel has successfully returned with a TRUE value to cancel pending I/O operations and FALSE to cancel the cancel. Typically, this function is called by a separate thread from the one controlling the I/O channel (since the channels thread is usually in the DLL if a cancel operation needs to be done). A typical use of this function might be: Main thread: CancelNeeded = TRUE; rsiCancelPendingIO( chnl, TRUE ); // wait until worker sees cancel While(CancelNeeded == TRUE ) ; Worker Thread: if( CancelNeeded == TRUE ) { // cancel pending cancel rsiCancelPendingIO( chnl, FALSE ); CancelNeeded = TRUE; // signal main thread }

rsiStartupWsock
P R O T O T YP E

RSI_RESULT rsiStartupWsock (void); None Calls the WSAStartup function which initiates the use of the Windows Sockets WS2_32.DLL RSI_SOCKET_ERROR if unsuccessful. RSI_SUCCESS if successful.

A R G U M E N T S D E S C R I P T I O N

R E T U R N S

N O T E S

This function should be called at the start-up procedure and once per process. RSIDLL32 supports up to Winsock version 2.2

25

rsiCleanupWsock
P R O T O T YP E

RSI_RESULT rsiCleanupWsock (void); None Calls the WSACleanup function which terminates the use of the Windows Sockets WS2_32.DLL RSI_SOCKET_ERROR if unsuccessful. RSI_SUCCESS if successful.

A R G U M E N T S D E S C R I P T I O N

R E T U R N S

N O T E S

This function should be called once rsiStartupWsock.

for

each successful

rsiInitWsock
P R O T O T YP E A R G U M E N T S

RSI_CHANNEL rsiInitWsock (char* hostname, WORD port); Char* hostname: a null-terminated character string representing a number expressed in the Internet standard . (dotted) notation. Ie. 111.112.113.114. WOR port: IP port, should be 3001. Initializes the DLL for use with the specified socket. As such, it must be called before any of the other routines. The handle it returns must be saved and passed to the other RSI DLL functions. A handle to the opened channel if successful. NULL if the channel could not be opened. This function must be called before using the API. The returned channel handle must be saved and passed to the other RSIDLL32 functions.

D E S C R I P T I O N

R E T U R N S

N O T E S

rsiCloseWsock
P R O T O T YP E

RSI_RESULT rsiCloseWsock (RSI_CHANNEL chnl); RSI_CHANNEL chnl The handle of the channel returned by rsiInitWsock.

A R G U M E N T S

D E S C R I P T I O N

Calls Winsock shutdown and closesocket functions. RSI_SUCCESS if successful. RSI_INVALID_CHANNEL if channel handle RSI_NO_CONNECTION if there was no connection. is invalid.

R E T U R N S

N O T E S

This function must be called in the applicationss clean-up procedure. After calling this function, none of the commands to the hand reader will work.

rsiPing
P R O T O T YP E

RSI_RESULT rsiPing (char * pingaddr, int pings); char * pingaddr Pointer to a null-terminated string in the form of an IP address. int pings Number of times to ping before giving up.

A R G U M E N T S

D E S C R I P T I O N

Issues one or more pings to see if entity at given IP address is ready. RSI_SUCCESS if the value of pings is zero or if the function is successful in pinging the given address within a number of attempts given by the argument pings. RSI_SOCKET_ERROR otherwise.

R E T U R N S

N O T E S

rsiStartupWsock() needs to have been called first. This function

27

is independent of any channels which may or may not have been opened. This function should not be called if your version of Windows is earlier than Windows 98.

rsiSetPings
P R O T O T YP E

void rsiSetPings (int pings); int pings Number of times rsiInitWsock() is to ping before giving up.

A R G U M E N T S

D E S C R I P T I O N

The function rsiInitWsock() calls rsiPing() before attempting to establish communications with the given IP address given by its hostname argument. There is a global variable which gives the value to be passed as the second argument to rsiPing(). This global variable has a default value of zero. rsiSetPing() sets this global variable to the value given in its argument. This function does not return a value. It cannot fail.

R E T U R N S

N O T E S

This function should not be called if your version of Windows is earlier than Windows 98. If rsiSetPings() has been called with a nonzero value, then rsiInitWsock() will, to all intents and purposes, attempt to ping the IP address given by its hostname argument prior to attempting to establish communications with it, and if it is unsuccessful in pinging it within the number of attempts previously set via a nonzero argument to rsiSetPings(), then it will not attempt to extablish communications with it, but will return an error code. This can sometimes prevent rsiInitWsock() from waiting an excessively long time before returning an error value, should it be the case that the given host is not in fact available. As a general rule, a value of 2 is recommended as the argument to

rsiSetPings(), but experimentation may be required. The term ping means to send a message to a possible remote IP address in the hope that the target entity will echo it back if the target entity exists.

29

Chapter

Level 1 API
Hand Reader Messaging

These functions send messages to and receive messages from hand readers. These functions are not usually used by applications. The routines deal with raw, packed hand reader data (as described in the ID3D Software Manual) and unless you are thoroughly familiar with the hand reader data formats, these functions should not be used unless there is a specific reason to do so. Instead use the higher level functions that deal with more programmer friendly data formats.

rsiSendMessage
P R O T O T YP E

RSI_RESULT rsiSendMessage (RSI_CHANNEL chnl, RSI_COMMAND_TYPE type, LPBYTE data, WORD length); RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

A R G U M E N T S

RSI_COMMAND_TYPE type The hand reader message to send. Valid messages are: RSI_CMD_RESUME RSI_CMD_ABORT RSI_CMD_HERE_IS_USER_RECORD RSI_CMD_SEND_USER_RECORD RSI_CMD_HERE_IS_SETUP_DATA RSI_CMD_REMOVE_USER_RECORD RSI_CMD_CALIBRATE RSI_CMD_CLEAR_USER_DATABASE RSI_CMD_SEND_CALIBRATION_DATA RSI_CMD_SEND_LAST_USER_RECORD RSI_CMD_HERE_IS_TIME RSI_CMD_SEND_RESULTS RSI_CMD_SEND_STATUS_CRC RSI_CMD_ENTER_IDLE_MODE RSI_CMD_HERE_IS_BANK_NUMBER RSI_CMD_HERE_IS_DATA_BANK RSI_CMD_SEND_DATA_BANK RSI_CMD_ENROLL_USER

RSI_CMD_VERIFY_USER_EXTERNAL RSI_CMD_SEND_TEMPLATE RSI_CMD_UPDATE_NV_RAM RSI_CMD_SEND_DATA_LOG RSI_CMD_SEND_PREV_DATA_LOG RSI_CMD_SEND_SETUP_DATA RSI_CMD_OUTPUT_CONTROL RSI_CMD_HERE_IS_DISPLAY_MESSAGE RSI_CMD_VERIFY_USER_INTERNAL RSI_CMD_NEXT_MESSAGE_TIME_ZONE RSI_CMD_HERE_ARE_TIME_ZONES RSI_CMD_DISPLAY_CODED_MESSAGE RSI_CMD_NEXT_MESSAGE_BELL_SCHEDULE RSI_CMD_HERE_IS_BELL_SCHEDULE LPBYTE data Raw, packed hand reader data. WORD length Length of the data.
D E S C R I P T I O N R E T U R N S

Sends a command to the hand reader.

RSI_SUCCESS if successful. RSI_INVALID_CHANNEL if the channel handle is not valid. RSI_NO_CONNECTION if the Level 0 API was not used correctly. RSI_COM_TIMEOUT if a time-out occurred before the entire message was sent.
N O T E S

The receive buffer is flushed before the message is sent.

No data checking or translation is performed. The data sent must be raw, packed hand reader data. Therefore the data format (as specified in the ID3D Software Manual) must be adhered to exactly. The rsiLookupCommandInfo and/or rsiLookupCommandDataSize functions should be used to ensure data and length are valid for type. See rsi_cmd.h for a complete commands list.

rsiGetResponse
P R O T O T YP E

RSI_RESULT rsiGetResponse (RSI_CHANNEL chnl, RSI_RESPONSE FAR* resp);

31

A R G U M E N T S

RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

RSI_RESPONSE FAR* resp A pointer to a RSI_RESPONSE structure that will receive the hand readers response.
D E S C R I P T I O N R E T U R N S

Attempts to read a response from the hand reader.

RSI_SUCCESS if successful. RSI_INVALID_CHANNEL if the channel handle is not valid. RSI_NO_CONNECTION if the Level 0 API was not used correctly. RSI_COM_TIMEOUT if a time-out occurred before the entire response was received. RSI_BAD_CRC if the message was received with a bad CRC. RSI_ERROR_COM if an unknown error occurred. It is the applications responsibility to set the buffer member of resp to point to valid buffer of sufficient size. The buflen member must be set to the length of the buffer. Use the rsiLookupResponseInfo function to determine the size of the buffer needed for the expected response. The function will not accept responses with a data size other than buflen.
N O T E S

The buffer member will contain raw, packed hand reader data if successful. This allows application can copy buffer to a data file in a compact form.

rsiParseResponse
P R O T O T YP E

RSI_RESULT rsiParseResponse (RSI_CHANNEL chnl, RSI_RESPONSE FAR* resp); RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

A R G U M E N T S

RSI_RESPONSE FAR* resp A pointer to a RSI_RESPONSE structure that was filled by rsiGetResponse.
D E S C R I P T I O N

Converts the raw, packed hand reader data in the response structure into programmer friendly structures according to the response type.

RSI_SUCCESS if successful. RSI_INVALID_CHANNEL if the channel handle is not valid. RSI_PARSE_OVERFLOW if the buflen member is larger than the data size for the type member. RSI_PARSE_UNDERFLOW if the buflen member is smaller than the data size for the
R E T U R N S

type member. RSI_DATA_ERROR if the buffer or data members are not valid pointers. It is the applications responsibility to ensure the buffer member of resp is a valid buffer. It is also the applications responsibility to set one of the data union members to point to a valid structure. The dataSize member must also be set by the applications.
N O T E S

While buflen is the size of the raw, packed hand reader data, dataSize is the size of the programmer friendly structure.

rsiLookupCommandInfo
P R O T O T YP E

WORD rsiLookupCommandInfo (RSI_COMMAND_TYPE type, RSI_RESPONSE_TYPE& resp); RSI_COMMAND_TYPE type The hand reader command message to retrieve information for.

A R G U M E N T S

RSI_RESPONSE_TYPE& resp Variable to store the expected hand reader response message to the command message.
D E S C R I P T I O N

Retrieves information about the various hand reader command messages.

The size of the expected data for the command message is returned. The data size is for the raw, packed hand reader data and not the programmer friendly structures.
R E T U R N S N O T E S

Use this function to determine which hand reader response to expect and allocate the appropriate buffers for rsiSendMessage.

rsiLookupCommandDataSize
P R O T O T YP E A R G U M E N T S

WORD rsiLookupCommandDataSize (RSI_COMMAND_TYPE type); RSI_COMMAND_TYPE type The hand reader command message to retrieve information for. Retrieves the length of the expected data for the various hand reader command messages.

D E S C R I P T I O N

33

The size of the expected data for the command message is returned. The data size is for the raw, packed hand reader data and not the programmer friendly structures.
R E T U R N S N O T E S

This function is basically rsiLookupCommandInfo, but it doesnt provide the response message to expect.

Use this function or rsiLookupCommandInfo to allocate the appropriate buffers and structures for rsiSendMessage.

rsiLookupResponseInfo
P R O T O T YP E A R G U M E N T S

WORD rsiLookupResponseInfo (RSI_RESPONSE_TYPE resp); RSI_RESPONSE_TYPE resp The hand reader response message to retrieve information for. Retrieves information about the various hand reader response messages.

D E S C R I P T I O N

The size of the expected data for the response message is returned. The data size is for the raw, packed hand reader data and not the programmer friendly structures.
R E T U R N S N O T E S

Use this function to set the buflen member and allocate the buffer member of the RSI_RESPONSE structure passed to rsiGetResponse.

Chapter

Level 2 API
Hand Reader Commands

These functions provide a wrapper around the hand reader commands listed in the Software Manual. As such they will simply be listed here unless there is something that needs to be explained.
A R G U M E N T S

RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

If successful, RSI_SUCCESS is returned. RSI_INVALID_CHANNEL is returned if the channel handle is not valid. Validation is performed on all data and RSI_ERROR_DATA may be returned.
R E T U R N S

rsiResume
P R O T O T YP E

RSI_RESULT rsiResume (RSI_CHANNEL chnl);

rsiAbortCommand
P R O T O T YP E

RSI_RESULT rsiAbortCommand (RSI_CHANNEL chnl);

rsiHereIsUserRecord
P R O T O T YP E

RSI_RESULT rsiHereIsUserRecord (RSI_CHANNEL chnl, RSI_USER_RECORD FAR* ur); The user record structure this function uses is not the format the hand reader uses.

N O T E S

rsiSendUserRecord
P R O T O T YP E

RSI_RESULT rsiSendUserRecord (RSI_CHANNEL chnl, RSI_ID id);

35

rsiHereIsSetupData
P R O T O T YP E

RSI_RESULT rsiHereIsSetupData (RSI_CHANNEL chnl, RSI_SETUP_DATA FAR* setup); The setup data structure this function uses is not the format the hand reader uses.

N O T E S

This function retrieves the existing setup data from the reader, updates it with the new setup data, and then sends it back to the reader. This is the correct procedure for updating reader setup data, as described in the Software Manual. The function rsiUpdateNVRam must be called after this command to transfer the readers current setup information to non-volatile RAM.

rsiRemoveUserRecord
P R O T O T YP E

RSI_RESULT rsiRemoveUserRecord (RSI_CHANNEL chnl, RSI_ID id);

rsiCalibrate
P R O T O T YP E

RSI_RESULT rsiCalibrate (RSI_CHANNEL chnl);

rsiClearUserDataBase
P R O T O T YP E

RSI_RESULT rsiClearUserDataBase (RSI_CHANNEL chnl);

rsiSendCalibrationData
P R O T O T YP E

RSI_RESULT rsiSendCalibrationData (RSI_CHANNEL chnl);

rsiSendLastUserRecord
P R O T O T YP E

RSI_RESULT rsiSendLastUserRecord (RSI_CHANNEL chnl);

rsiHereIsTime
P R O T O T YP E

RSI_RESULT rsiHereIsTime (RSI_CHANNEL chnl, RSI_TIME_DATE FAR* time);

The wDayOfWeek and wMilliseconds members are not used. The wYear member must be number between 0 and 99 and not a number like 1996.
N O T E S

The time structure this function uses is not the format the hand reader uses.

rsiGetTime
P R O T O T YP E

RSI_RESULT rsiGetTime (RSI_CHANNEL chnl, RSI_TIME_DATE FAR* time); Read the time and date from the hand reader.

N O T E S

rsiSendResults
P R O T O T YP E

RSI_RESULT rsiSendResults (RSI_CHANNEL chnl);

rsiSendStatusCRC
P R O T O T YP E

RSI_RESULT rsiSendStatusCRC (RSI_CHANNEL chnl);

rsiEnterIdleMode
P R O T O T YP E

RSI_RESULT rsiEnterIdleMode (RSI_CHANNEL chnl);

rsiEnterIdleMode2
P R O T O T YP E

RSI_RESULT rsiEnterIdleMode2 (RSI_CHANNEL chnl);

37

rsiBeep
P R O T O T YP E

RSI_DLL RSI_RESULT RSI_API rsiBeep(RSI_CHANNEL chnl, BYTE duration, BYTE count); Causes reader to beep a given number of times for a given duration.

N O T E S

rsiHereIsBankNumber
P R O T O T YP E

RSI_RESULT rsiHereIsBankNumber (RSI_CHANNEL chnl, RSI_BANK_NUMBER bnk);

rsiHereIsDataBank
P R O T O T YP E

RSI_RESULT rsiHereIsDataBank (RSI_CHANNEL chnl, RSI_DATA_BANK FAR* dbnk);

rsiSendDataBank
P R O T O T YP E

RSI_RESULT rsiSendDataBank (RSI_CHANNEL chnl, RSI_BANK_NUMBER bnk);

rsiEnrollUser
P R O T O T YP E

RSI_RESULT rsiEnrollUser (RSI_CHANNEL chnl, RSI_PROMPT prm); Valid values for prm are:

N O T E S

RSI_RIGHT RSI_LEFT RSI_BLANK

rsiVerifyOnExternalData
P R O T O T YP E

RSI_RESULT rsiVerifyOnExternalData (RSI_CHANNEL chnl, RSI_PROMPT prm, RSI_TEMPLATE tmpl);

N O T E S

Valid values for prm are:

RSI_RIGHT RSI_LEFT RSI_BLANK

rsiSendTemplate
P R O T O T YP E

RSI_RESULT rsiSendTemplate (RSI_CHANNEL chnl);

rsiUpdateNVRam
P R O T O T YP E

RSI_RESULT rsiUpdateNVRam (RSI_CHANNEL chnl); Use this function after sending setup information with the function rsiHereIsSetupData.

N O T E S

rsiSendDataLog
P R O T O T YP E

RSI_RESULT rsiSendDataLog (RSI_CHANNEL chnl);

rsiSendPreviousDataLog
P R O T O T YP E

RSI_RESULT rsiSendPreviousDataLog (RSI_CHANNEL chnl);

rsiSendSetupData
P R O T O T YP E

RSI_RESULT rsiSendSetupData (RSI_CHANNEL chnl);

rsiOutputControl
P R O T O T YP E

RSI_RESULT rsiOutputControl (RSI_CHANNEL chnl, RSI_OUTPUT_STATE out); Valid values for out are:

N O T E S

39

RSI_TIMED_UNLOCK RSI_INDEFINATE_UNLOCK RSI_RELOCK_NOW RSI_AUX_ON RSI_AUX_OFF RSI_DISABLE_LOCK RSI_AUX1_ON RSI_AUX1_OFF RSI_AUX2_ON RSI_AUX2_OFF

rsiHereIsDisplayMessage
P R O T O T YP E

RSI_RESULT rsiHereIsDisplayMessage (RSI_CHANNEL chnl, RSI_DISPLAY_MESSAGE FAR* msg); The display message structure this function uses is not the format the hand reader uses.

N O T E S

rsiPrinterPassThrough
P R O T O T YP E

RSI_RESULT rsiPrinterPassThrough (RSI_CHANNEL chnl, LPBYTE out, BYTE len);

rsiVerifyOnInternalData
P R O T O T YP E

RSI_RESULT rsiVerifyOnInternalData (RSI_CHANNEL chnl, RSI_ID id);

rsiNextMessageIsTimeZone
P R O T O T YP E

RSI_RESULT rsiNextMessageIsTimeZone (RSI_CHANNEL chnl);

rsiHereAreTimeZones
P R O T O T YP E

RSI_RESULT rsiHereAreTimeZones (RSI_CHANNEL chnl, RSI_TIME_ZONE_TABLE FAR* tz); The time zone structure this function uses is not the format the hand

N O T E S

reader uses.

rsiDisplayCodedMessage
P R O T O T YP E

RSI_RESULT rsiDisplayCodedMessage (RSI_CHANNEL chnl, RSI_MESSAGE_CODE msg, BYTE halfsecs); Valid values for msg are:

N O T E S

RSI_ACCESS_GRANTED RSI_WRONG_TIME_PLACE RSI_HAND_NOT_CLEARED

rsiNextMessageIsBellScheduleTable
P R O T O T YP E

RSI_RESULT rsiNextMessageIsBellScheduleTable (RSI_CHANNEL chnl);

rsiHereIsBellScheduleTable
P R O T O T YP E

RSI_RESULT rsiHereIsBellScheduleTable (RSI_CHANNEL chnl, RSI_BELL_SCHEDULE FAR* schedule); The bell schedule structure this function uses is not the format the hand reader uses.

N O T E S

41

Chapter

Level 3 API
High Level Functions

These are the functions most applications will use. They perform useful tasks such as retrieving and updating user records through one function call. They also handle memory management for RSI_RESPONSE members.

rsiGetUserRecord
P R O T O T YP E

RSI_RESULT rsiGetUserRecord (RSI_CHANNEL chnl, RSI_ID id, RSI_USER_RECORD FAR* ur); RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

A R G U M E N T S

RSI_ID id The ID of the user to retrieve. RSI_USER_RECORD FAR* ur A pointer to the structure for the user record.
D E S C R I P T I O N R E T U R N S

Retrieves a user record from the hand reader.

RSI_SUCCESS if successful. Any error value returned by rsiSendUserRecord, rsiGetResponse, and/or rsiParseResponse if unsuccessful.
Returns value other than RSI_SUCCESS only if there is a communication problem. If the record given by "id" does not exist, then the reader sends a record with all-zero User ID field.

rsiGetLastUserRecord
P R O T O T YP E

RSI_RESULT rsiGetLastUserRecord (RSI_CHANNEL chnl, RSI_USER_RECORD FAR* ur);

A R G U M E N T S

RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

RSI_USER_RECORD FAR* ur A pointer to the structure for the user record.


D E S C R I P T I O N R E T U R N S

Retrieves the user record for the most recent hand reading.

RSI_SUCCESS if successful. Any error value returned by rsiSendLastUserRecord, rsiGetResponse, and/or rsiParseResponse if unsuccessful.

rsiGetStatus
P R O T O T YP E

RSI_RESULT rsiGetStatus (RSI_CHANNEL chnl, RSI_STATUS FAR* status); RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

A R G U M E N T S

RSI_STATUS FAR* status A pointer to the structure for the status.


D E S C R I P T I O N R E T U R N S

Retrieves the status of the hand reader.

RSI_SUCCESS if successful. Any error value returned by rsiSendStatusCRC, rsiGetResponse, and/or rsiParseResponse if unsuccessful.

rsiSetBellSchedule
P R O T O T YP E

RSI_RESULT rsiSetBellSchedule (RSI_CHANNEL chnl, RSI_BELL_SCHEDULE FAR* schedule); RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

A R G U M E N T S

RSI_BELL SCHEDULE FAR* schedule A pointer to the structure with the bell schedule for the hand reader.
D E S C R I P T I O N R E T U R N S

Sets the bell schedule for the hand reader. RSI_SUCCESS if successful.

43

Any error value returned by rsiNextMessageIsBellScheduleTable, rsiHereIsBellScheduleTable if unsuccessful.

and/or

rsiSetTimeZoneTable
P R O T O T YP E

RSI_RESULT rsiSetTimeZoneTable (RSI_CHANNEL chnl, RSI_TIME_ZONE_TABLE FAR* tz); RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

A R G U M E N T S

RSI_TIME_ZONE_TABLE FAR* tz A pointer to the structure with the time zone table for the reader.
D E S C R I P T I O N R E T U R N S

Sets the time zone table for the hand reader.

RSI_SUCCESS if successful. Any error value returned by rsiNextMessageIsTimeZone, and/or rsiHereAreTimeZones if unsuccessful.

rsiGetSetupData
P R O T O T YP E

RSI_RESULT rsiGetSetupData (RSI_CHANNEL chnl, RSI_SETUP_DATA FAR* setup); RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

A R G U M E N T S

RSI_SETUP_DATA FAR* setup A pointer to the structure for the setup data.
D E S C R I P T I O N R E T U R N S

Retrieves the current setup data for the hand reader.

RSI_SUCCESS if successful. Any error value returned by rsiSendSetupData, rsiGetResponse, and/or rsiParseResponse if unsuccessful.

rsiGetDataLogElement
P R O T O T YP E

RSI_RESULT rsiGetDataLogElement (RSI_CHANNEL chnl, RSI_DATA_LOG_ELEMENT FAR* dl, BOOL bPrev);

A R G U M E N T S

RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

RSI_DATA_LOG_ELEMENT FAR* dl A pointer to the structure for the data log. BOOL bPrev TRUE to retrieve the previous data log or FALSE to retrieve the next data log.
D E S C R I P T I O N R E T U R N S

Retrieves a data log element from the hand reader.

RSI_SUCCESS if successful. Any error value returned by rsiSendDataLog, rsiSendPreviousDataLog, rsiGetResponse, and/or rsiParseResponse if unsuccessful.

rsiGetCalibrationData
P R O T O T YP E

RSI_RESULT rsiGetCalibrationData (RSI_CHANNEL chnl, RSI_CALIBRATION_DATA FAR* calib); RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

A R G U M E N T S

RSI_CALIBRATION_DATA FAR* calib A pointer to the structure for the calibration data.
D E S C R I P T I O N R E T U R N S

Retrieves the calibration data for the hand reader.

RSI_SUCCESS if successful. Any error value returned by rsiSendCalibrationData, rsiGetResponse, and/or rsiParseResponse if unsuccessful.

rsiGetLastTemplate
P R O T O T YP E

RSI_RESULT rsiGetLastTemplate (RSI_CHANNEL chnl, RSI_LAST_TEMPLATE FAR* tmpl); RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

A R G U M E N T S

RSI_LAST_TEMPLATE FAR* tmpl

45

A pointer to the structure for the last template and score.


D E S C R I P T I O N

Retrieves the template vector and score for the most recent hand reading.

(But ignore score immediately after an enrollment.) RSI_SUCCESS if successful. Any error value returned by rsiSendTemplate, rsiGetResponse, and/or rsiParseResponse if unsuccessful.
R E T U R N S

rsiGetResults
P R O T O T YP E

RSI_RESULT rsiGetResults (RSI_CHANNEL chnl, RSI_RESULTS FAR* results); RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

A R G U M E N T S

RSI_RESULTS FAR* results A pointer to the structure for the results.


D E S C R I P T I O N R E T U R N S

Retrieves the results for the most recent hand reading.

RSI_SUCCESS if successful. Any error value returned by rsiSendResults, rsiGetResponse, and/or rsiParseResponse if unsuccessful.

rsiGetDataBank
P R O T O T YP E

RSI_RESULT rsiGetDataBank (RSI_CHANNEL chnl, RSI_BANK_NUMBER bnk, RSI_DATA_BANK FAR* dbnk); RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

A R G U M E N T S

RSI_BANK_NUMBER bnk Number of the data bank to retrieve. RSI_DATA_BANK_FAR* dbnk A pointer to the structure for the data bank.
D E S C R I P T I O N

Retrieves a data bank from the hand reader

RSI_SUCCESS if successful. Any error value returned by rsiEnterIdleMode, rsiSendDataBank, rsiGetResponse, and/or rsiParseResponse if unsuccessful.
R E T U R N S

rsiSetDataBank
P R O T O T YP E

RSI_RESULT rsiSetDataBank (RSI_CHANNEL chnl, RSI_BANK_NUMBER bnk, RSI_DATA_BANK FAR* dbnk); RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

A R G U M E N T S

RSI_BANK_NUMBER bnk Number of the data bank to set. RSI_DATA_BANK_FAR* dbnk A pointer to the structure with the data bank to set.
D E S C R I P T I O N R E T U R N S

Sets a data bank in the hand reader.

RSI_SUCCESS if successful. Any error value returned by rsiEnterIdleMode, rsiHereIsBankNumber, and/or rsiHereIsDataBank if unsuccessful.

47

Chapter

Data Conversion API


Raw, Packed Hand Reader Data Programmer Friendly Structures

Although data conversion is performed by the Level 2 API, applications may need to use these functions to manage data efficiently by storing it in raw, packed format and using it in programmer friendly structures. Functions that convert structures to hand reader data perform validation on structure members. But it is the applications responsibility to ensure buffers that are passed to these functions are of sufficient size. These functions will work whether or not the Level 0 API has been called to initialize the DLL/hand reader communication.

rsiUserRecordToData
P R O T O T YP E

RSI_DATA_ERROR rsiUserRecordToData (RSI_USER_RECORD FAR* ur, LPBYTE data); RSI_USER_RECORD FAR* ur A pointer to the structure with the user record.

A R G U M E N T S

LPBYTE data A pointer to the buffer that will receive the user record in raw, packed hand reader format.
D E S C R I P T I O N

Converts a user record structure into the format used by the hand reader. RSI_DATA_OK if successful. One of the values returned by rsiGetDataError if unsuccessful.

R E T U R N S

rsiDataToUserRecord
P R O T O T YP E

RSI_DATA_ERROR rsiDataToUserRecord (LPBYTE data, RSI_USER_RECORD FAR* ur);

A R G U M E N T S

LPBYTE data A pointer to the buffer with the raw, packed hand reader user record.

RSI_USER_RECORD FAR* ur A pointer to the structure that will receive the converted user record.
D E S C R I P T I O N R E T U R N S

Converts raw, packed hand reader data into a user record structure. RSI_DATA_OK if successful. One of the values returned by rsiGetDataError if unsuccessful.

rsiSetupDataToData
P R O T O T YP E

RSI_DATA_ERROR rsiSetupDataToData (RSI_SETUP_DATA FAR* setup, LPBYTE data); RSI_SETUP_DATA FAR* setup A pointer to the structure with the setup data.

A R G U M E N T S

LPBYTE data A pointer to the buffer that will receive the setup data in raw, packed hand reader format.
D E S C R I P T I O N

Convert a setup data structure to the format used by the hand reader. RSI_DATA_OK if successful. One of the values returned by rsiGetDataError if unsuccessful.

R E T U R N S

rsiDataToSetupData
P R O T O T YP E

RSI_DATA_ERROR rsiDataToSetupData (LPBYTE data, RSI_SETUP_DATA FAR* setup); LPBYTE data A pointer to the buffer with the setup data in raw, packed hand reader

A R G U M E N T S

format. RSI_SETUP_DATA FAR* setup A pointer to the structure that will receive the converted setup data.
D E S C R I P T I O N

Converts setup data from raw, packed hand reader format to a setup data structure.

49

R E T U R N S

RSI_DATA_OK if successful. One of the values returned by rsiGetDataError if unsuccessful.

rsiTimeToData
P R O T O T YP E

RSI_DATA_ERROR rsiTimeToData (RSI_TIME_DATE FAR* time, LPBYTE data);

RSI_TIME_DATE FAR* time A pointer to the structure with the time. The wDayOfWeek and wMilliseconds members are not used. The wYear member must be number between 0 and 99 and not a number like 1996.
A R G U M E N T S

LPBYTE data A pointer to the buffer that will receive the time in raw, packed hand reader format.
D E S C R I P T I O N R E T U R N S

Converts a time structure to the hand reader format. RSI_DATA_OK if successful. One of the values returned by rsiGetDataError if unsuccessful.

rsiDataToTime
P R O T O T YP E

RSI_DATA_ERROR rsiDataToTime (LPBYTE data, RSI_TIME_DATE FAR* time); Converts the hand reader time/date format to a time structure.

D E S C R I P T I O N

R E T U R N S

RSI_DATA_OK if successful.

One of the values returned by rsiGetDataError if unsuccessful.

rsiDataToStatus
P R O T O T YP E

RSI_DATA_ERROR rsiDataToStatus (LPBYTE data, RSI_STATUS FAR* status);

LPBYTE data A pointer to the buffer with the status information in raw, packed hand reader format.
A R G U M E N T S

RSI_STATUS FAR* status A pointer to the structure that will receive the converted time.
D E S C R I P T I O N R E T U R N S

Converts hand reader data into a time structure. RSI_DATA_OK if successful. One of the values returned by rsiGetDataError if unsuccessful.

rsiTextToID
P R O T O T YP E A R G U M E N T S

RSI_DATA_ERROR rsiTextToID (LPCTSTR text, RSI_ID id); LPCTSTR text A pointer to the string that contains the ID number.

RSI_ID id The structure that will receive the ID in BCD format.


D E S C R I P T I O N R E T U R N S

Converts a user ID from text to hand reader BCD format. RSI_DATA_OK if successful. One of the values returned by rsiGetDataError if unsuccessful.

rsiIDToText
P R O T O T YP E A R G U M E N T S

RSI_DATA_ERROR rsiIDToText (RSI_ID id, LPTSTR text); RSI_ID id The structure with the user ID in BCD format.

LPTSTR text A pointer to the string that will receive the ID number in text format.
D E S C R I P T I O N R E T U R N S

Converts a user ID in BCD format to text. RSI_DATA_OK if successful. One of the values returned by rsiGetDataError if unsuccessful.

51

rsiTextToMessage
P R O T O T YP E

RSI_DATA_ERROR rsiTextToMessage (LPCTSTR text, RSI_MESSAGE_TEXT FAR* msg); LPCTSTR text A pointer to the string with the message of up to 32 characters.

A R G U M E N T S

RSI_MESSAGE_TEXT FAR* msg A pointer to the structure that will receive the message in hand reader format.
D E S C R I P T I O N

Converts a string to a hand reader string (fixed-length, no null termination). RSI_DATA_OK if successful. One of the values returned by rsiGetDataError if unsuccessful.

R E T U R N S

rsiTimeZoneTableToData
P R O T O T YP E

RSI_DATA_ERROR rsiTimeZoneTableToData (RSI_TIME_ZONE_TABLE FAR* tz, LPBYTE data); RSI_TIME_ZONE_TABLE FAR* tz A pointer to the structure with the time zone table (including holiday

A R G U M E N T S

table). LPBYTE data A pointer to the buffer that will receive the time zone table in hand reader format.
D E S C R I P T I O N R E T U R N S

Converts a time zone table structure to the hand reader data format. RSI_DATA_OK if successful. One of the values returned by rsiGetDataError if unsuccessful.

rsiBellScheduleToData
P R O T O T YP E

RSI_DATA_ERROR rsiBellScheduleToData (RSI_BELL_SCHEDULE FAR* schedule, LPBYTE data); RSI_BELL_SCHEDULE FAR* schedule A pointer to the structure with the bell schedule.

A R G U M E N T S

LPBYTE data A pointer to the buffer that will receive the bell schedule in hand reader format.
D E S C R I P T I O N R E T U R N S

Converts a bell schedule structure to the hand reader data format. RSI_DATA_OK if successful. One of the values returned by rsiGetDataError if unsuccessful.

rsiDisplayMessageToData
P R O T O T YP E

RSI_DATA_ERROR rsiDisplayMessageToData (RSI_DISPLAY_MESSAGE FAR* msg, LPBYTE data); RSI_DISPLAY_MESSAGE FAR* msg A pointer to the structure with the display message information.

A R G U M E N T S

LPBYTE data A pointer to the buffer that will receive the display message information in hand reader format.
D E S C R I P T I O N

Coverts a display message information structure to the hand reader data format. RSI_DATA_OK if successful. One of the values returned by rsiGetDataError if unsuccessful.

R E T U R N S

rsiDataToDataLog
P R O T O T YP E

RSI_DATA_ERROR rsiDataToDataLog (LPBYTE data, RSI_DATA_LOG_ELEMENT FAR* datalog); LPBYTE data A pointer to the buffer with the data log element in raw, packed hand

A R G U M E N T S

reader data. RSI_DATA_LOG_ELEMENT FAR* datalog A pointer to the structure that will receive the converted data log element.
D E S C R I P T I O N R E T U R N S

Converts hand reader data into a data log element. RSI_DATA_OK if successful. One of the values returned by rsiGetDataError if unsuccessful.

53

rsiTextToTemplate
P R O T O T YP E

void rsiTextToTemplate (LPCTSTR text, int length, RSI_TEMPLATE tmpl); LPCTSTR text A pointer to the string that contains the template.

A R G U M E N T S

RSI_TEMPLATE tmpl The structure that will receive the template in hex format.
D E S C R I P T I O N R E T U R N S

Converts a template from text to hex format. None

rsiTemplateToText
P R O T O T YP E A R G U M E N T S

void rsiTemplateToText (RSI_TEMPLATE tmpl, LPTSTR text); RSI_TEMPLATE tmpl The structure with the template in hex format.

LPTSTR text A pointer to the string that will receive the template in text format.
D E S C R I P T I O N R E T U R N S

Converts a template in hex format to text. none

Chapter

Miscellaneous Functions
Other Routines
These functions are useful when used with the rest of the API.

rsiGetDataError
P R O T O T YP E A R G U M E N T S

RSI_DATA_ERROR rsiGetDataError (RSI_CHANNEL chnl); RSI_CHANNEL chnl The handle returned by rsiInstallChannel. Gets the last data related error that occurred. Possible return values are: No data error ID character was not a number Authority level was invalid Rejection threshold out of range (40-200) Time zone out of range (0-61) Year out of range (0-99) Month out of range (1-12) Day out of range (1-31) Hour out of range (0-23) Minute out of range (0-59) Second out of range (0-59) Time out of range (0-20,000) Reader address is invalid

D E S C R I P T I O N R E T U R N S

RSI_DATA_OK RSI_ERROR_ID_CHAR RSI_ERROR_AUTHORITY_LEVEL RSI_ERROR_REJECT_THRESHOLD RSI_ERROR_TIME_ZONE RSI_ERROR_YEAR RSI_ERROR_MONTH RSI_ERROR_DAY RSI_ERROR_HOUR RSI_ERROR_MINUTE RSI_ERROR_SECOND RSI_ERROR_TIME_20K RSI_ERROR_READER_ADDR

55

RSI_ERROR_FACILITY_CODE RSI_ERROR_ID_LENGTH RSI_ERROR_NUM_TRIES RSI_ERROR_DURESS_CHAR RSI_ERROR_MSG_TEXT RSI_ERROR_INTERVAL_TIME RSI_ERROR_BELL_DURATION RSI_ERROR_BUFFER_INVALID

Facility code (0x00-0xFFF)

out

of

range

ID length out of range (1-11) Number of tries out of range (1250) Duress character invalid Message text alphanumeric is not all

Interval time out of range (0239) Bell duration out of range (0-32) One of the passed buffers was NULL

Functions that might return RSI_ERROR_DATA clear the current data error, if any, before proceeding. This means applications need to check for data errors immediately after a function returns RSI_ERROR_DATA.
N O T E S

rsiGetComError
P R O T O T YP E A R G U M E N T S

int rsiGetComError (RSI_CHANNEL chnl, WORD& error); RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

WORD& error The error that occured.


D E S C R I P T I O N

Gets the last communications related error that occurred.

rsiSleep
P R O T O T YP E

RSI_RESULT rsiSleep (RSI_CHANNEL chnl, long msecs);

A R G U M E N T S

RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

long msecs Length of time to wait in milliseconds.


D E S C R I P T I O N R E T U R N S

Waits for the specified amount of time before returning. RSI_SUCCESS if successful. RSI_ERROR_COM if unsuccessful. Idle processing is handled automatically.

N O T E S

rsiSetICD
P R O T O T YP E N O T E S

RSI_RESULT rsiSetICD (RSI_CHANNEL chnl, long delay); Set the ICD to a value possibly different from the default ICD of 4000 ms. ICD is a timeout value that applies when mode is ethernet.

rsiGetICD
P R O T O T YP E N O T E S

RSI_RESULT rsiGetICD (RSI_CHANNEL chnl, long *delay); Get ICD.

57

Chapter

Data Types & Sizes


Programmer Friendly Hand Reader Data

These structures are not the format used by the hand reader. They exist to simplify programming with RSI DLL. For the actual formats the hand reader uses, see the Software Manual. For the most updated structures, see the rsi_cmd.h file.

RSI_RESPONSE
P R O T O T YP E

typedef struct { RSI_RESPONSE_TYPE type; union { RSI_STATUS FAR* RSI_USER_RECORD FAR* RSI_CALIBRATION_DATA FAR* RSI_RESULTS FAR* RSI_DATA_BANK FAR* RSI_LAST_TEMPLATE FAR* RSI_DATA_LOG_ELEMENT FAR* RSI_SETUP_DATA FAR* } data; WORD dataSize; LPBYTE buffer; WORD buflen; RSI_RESPONSE;

status; userRecord;
calibrationData;

results; dataBank; lastTemplate; dataLog; setupData;

RSI_RESPONSE_TYPE type The response message received. This is set by rsiGetResponse. Valid responses are:
M E M B E R S

RSI_RESP_NONE RSI_RESP_HERE_IS_STATUS RSI_RESP_HERE_IS_USER_RECORD RSI_RESP_HERE_IS_CALIBRATION_DATA RSI_RESP_HERE_ARE_RESULTS RSI_RESP_HERE_IS_DATA_BANK RSI_RESP_HERE_IS_TEMPLATE_VECTOR

RSI_RESP_HERE_IS_NEXT_DATA_LOG RSI_RESP_HERE_IS_SETUP_DATA RSI_STATUS FAR* status A pointer to the hand reader status structure for rsiParseResponse. This is handled by rsiGetStatus. RSI_USER_RECORD FAR* userRecord A pointer to the user record structure for rsiParseResponse. This is handled by rsiGetUserRecord and rsiGetLastUserRecord. RSI_CALIBRATION_DATA FAR* calibrationData A pointer to the calibration data structure for rsiParseResponse. This is handled by rsiGetCalibrationData. RSI_RESULTS FAR* results A pointer to the results structure for rsiParseResponse. This is handled by rsiGetResults. RSI_DATA_BANK FAR* dataBank A pointer to the data bank structure for rsiParseResponse. This is handled by rsiGetDataBank. RSI_LAST_TEMPLATE FAR* lastTemplate A pointer to the last template structure for rsiParseResponse. This is handled by rsiGetLastTemplate. RSI_DATA_LOG_ELEMENT FAR* dataLog A pointer to the data log element structure for rsiParseResponse. This is handled by rsiGetDataLogElement. RSI_SETUP_DATA FAR* setupData A pointer to the setup data structure for rsiParseResponse. This is handled by rsiGetSetupData. WORD dataSize The size of the structure being used for data. This is for rsiParseResponse and is handled by the Level 3 API. LPBYTE buffer A pointer to the buffer that will receive the raw, packed hand reader data rsiGetResponse receives. This is handled by the Level 3 API. WORD buflen

59

The size of the buffer for the raw, packed hand reader data. The Level 3 API uses rsiLookupResponseInfo to handle this. Pass this to rsiGetResponse and then to rsiParseResponse. The Level 3 API handles this automatically so most applications will not need to use this structure.
D E S C R I P T I O N

RSI_USER_RECORD
P R O T O T YP E

typedef struct { RSI_ID id; RSI_TEMPLATE templateVector; RSI_AUTHORITY_LEVEL authorityLevel; RSI_REJECT_THRESHOLD rejectThreshold; RSI_TIME_ZONE timeZone; RSI_USER_RECORD; RSI_ID id The user ID.

M E M B E R S

RSI_TEMPLATE templateVector The users hand template. RSI_AUTHORITY_LEVEL authorityLevel The users authority level. Valid authority levels are: RSI_NONE RSI_SERVICE RSI_SETUP RSI_MANAGEMENT RSI_ENROLLMENT RSI_SECURITY RSI_REJECT_THRESHOLD rejectThreshold The users rejection threshold. Valid values are between 40 and 200 or 0 to disable. RSI_TIME_ZONE timeZone The users time zone. Valid values are between 1 and 60 or RSI_TZ_ALWAYS or RSI_TZ_NEVER.

RSI_DISPLAY_MESSAGE
P R O T O T YP E

typedef struct { BOOL userSpecific; union { BYTE halfsecs; RSI_ID id; }; RSI_MESSAGE_TEXT msg; RSI_DISPLAY_MESSAGE;

BOOL userSpecific TRUE to display the message to a specific user or FALSE to display it for a specified amount of time.
M E M B E R S

BYTE halfsecs If userSpecific is FALSE, the number of half seconds (500 milliseconds) to display the message. RSI_ID id If userSpecific is TRUE, the ID of the user to display the message for. RSI_MESSAGE_TEXT msg The text of the message up to 32 characters.

RSI_SETUP_DATA
P R O T O T YP E

typedef struct { RSI_PASSWORD passwords[5]; RSI_REJECT_THRESHOLD threshold; BOOL auxFlag; RSI_TIME_20K auxTimeout; BOOL printFlag; BOOL statusFlag; BOOL auxAlarmFlagD; BOOL auxAlarmFlagA; BOOL auxAlarmFlagI; BOOL auxAlarmFlagT; BOOL auxAlarmFlagP; RSI_TIME_20K lockTime;

61

RSI_TIME_20K RSI_BAUD RSI_BAUD RSI_READER_ADDRESS RSI_FACILITY_CODE RSI_OPERATING_MODE RSI_OUTPUT_MODE BOOL RSI_IDLEN_TYPE RSI_ACCOUNTING_MODE RSI_TIME_ZONE RSI_TIME_ZONE BOOL RSI_DURESS_CHAR RSI_NUM_TRIES_TYPE SYSTEMTIME SYSTEMTIME BOOL RSI_SETUP_DATA;
M E M B E R S

shuntTime; networkBaudIndex; printerBaudIndex; readerAddress; facilityCode; operatingMode; outputMode; beeperFlag; idLength; accountingMode; unlockTimeZone; auxTimeZone; auxDuressFlag; duressCharacter; numberOfTries; dlsOn; dlsOff; display12Hour;

RSI_PASSWORD passwords[5] The passwords 1 through 5 are stored in the array.

RSI_BAUD networkBaudIndex RSI_BAUD printerBaudIndex Valid baud rates are: RSI_38400 RSI_19200 RSI_9600 RSI_4800 RSI_2400 RSI_1200 RSI_600 RSI_300 RSI_OPERATING_MODE operatingMode Valid operating modes are: RSI_STAND_ALONE RSI_MASTER RSI_REMOTE RSI_OUTPUT_MODE outputMode Valid output modes are:

RSI_LOCK RSI_CARD_READER_EMULATION SYSTEMTIME dlsOn SYSTEMTIME dlsOff The wDayOfWeek and wMilliseconds members are not used. The wYear member must be number between 0 and 99 and not a number like 1996.
N O T E S

See the Software Manual for member field descriptions.

RSI_STATUS
P R O T O T YP E

typedef struct { BOOL h_read BOOL led1; BOOL led2; BOOL led3; BOOL led4; BOOL any_key; BOOL res_sys; BOOL verify_rdy; BOOL rslts_rdy; BOOL failed_cmd; BOOL dlog_rdy; BOOL id_nim; BOOL cmd_bsy; BOOL kp_id; BOOL tmpr_st; BOOL aux_st; BOOL door_st; BOOL rex_st; BOOL lock_st; BOOL auxo_st; RSI_STATUS; See the Software Manual for member field descriptions. See rsi_cmd.h for a more complete RSI_STATUS definition.

N O T E S

RSI_CALIBRATION_DATA
P R O T O T YP E

typedef struct

63

{ WORD exposure; WORD row; WORD col; RSI_CALIBRATION_DATA;


N O T E S

See the Software Manual for member field descriptions.

RSI_RESULTS
P R O T O T YP E

typedef struct { RSI_ID id; RSI_SCORE score; RSI_RESULTS; See the Software Manual for member field descriptions.

N O T E S

RSI_LAST_TEMPLATE
P R O T O T YP E

typedef struct { RSI_SCORE score; //Ignore immediately after // an enrollment RSI_TEMPLATE templateVector; RSI_LAST_TEMPLATE; See the Software Manual for member field descriptions.

N O T E S

RSI_BELL_SCHEDULE_ELEMENT
P R O T O T YP E

typedef struct { RSI_MINUTE min; RSI_HOUR hour; RSI_BELL_DURATION dur; RSI_DOW_MASK dowMask; RSI_BELL_SCHEDULE_ELEMENT; RSI_MINUTE min The minute of the time to activate this bell.

M E M B E R S

RSI_HOUR hour The hour of the time to active this bell. RSI_BELL_DURATION dur The duration of the bell activation. RSI_DOW_MASK dowMask The days to activate the bell. A Day Of Week mask can be constructed using bit-wise operators and the following values: RSI_SUNDAY RSI_MONDAY RSI_TUESDAY RSI_WEDNESDAY RSI_THURSDAY RSI_FRIDAY RSI_SATURDAY RSI_HOLIDAY

RSI_BELL_SCHEDULE
P R O T O T YP E

typedef struct { RSI_BELL_SCHEDULE_ELEMENT bells[100]; RSI_BELL_SCHEDULE; RSI_BELL_SCHEDULE_ELEMENT bells[100] There can be up to 100 bell activation times.

M E M B E R S

RSI_TIME_ZONE_INTERVAL
P R O T O T YP E

typedef struct { RSI_TIME_BYTE start; RSI_TIME_BYTE stop; RSI_DOW_MASK dowMask; RSI_TIME_ZONE_INTERVAL;

RSI_TIME_BYTE start The start time for this interval in. Granularity of the time is in 6 minute increments. See the Software Manual for more details.
M E M B E R S

RSI_TIME_BYTE stop

65

The stop time for this interval. Granularity of the time is in 6 minute increments. See the Software Manual for more details. RSI_DOW_MASK dowMask The Day Of Week mask for this interval. This can be constructed using bit-wise operators and the following values: RSI_SUNDAY RSI_MONDAY RSI_TUESDAY RSI_WEDNESDAY RSI_THURSDAY RSI_FRIDAY RSI_SATURDAY RSI_HOLIDAY

RSI_TIME_ZONE_ELEMENT
P R O T O T YP E N O T E S

typedef RSI_TIME_ZONE_INTERVAL RSI_TIME_ZONE_ELEMENT[4]; Each time zone element consists of 4 time intervals.

RSI_HOLIDAY_ELEMENT
P R O T O T YP E N O T E S

typedef BOOL RSI_HOLIDAY_ELEMENT[31]; Each holiday element represents one month. Each BOOL in the array represents one day. Set each day to TRUE for a holiday or FALSE for a

non-holiday.

RSI_TIME_ZONE_TABLE
P R O T O T YP E

typedef struct { RSI_HOLIDAY_ELEMENT holidays[12]; RSI_TIME_ZONE_ELEMENT timeZones[60]; RSI_TIME_ZONE_TABLE; RSI_HOLIDAY_ELEMENT holidays[12] Each holiday element represents one month so this is for one year.

M E M B E R S

RSI_TIME_ZONE_ELEMENT timeZones[60]

There can be up to 60 user defined time zones.

RSI_DATA_LOG_ELEMENT
P R O T O T YP E

typedef struct { RSI_READER_ADDRESS addr; SYSTEMTIME time; RSI_DATA_LOG_FORMAT format; RSI_DATA_LOG_DATA_1 data1; RSI_DATA_LOG_DATA_2 data2; RSI_DATA_LOG_ELEMENT; RSI_READER_ADDRESS addr The hand reader where this data log originated.

M E M B E R S

SYSTEMTIME time The time this data log originated. The wDayOfWeek and wMilliseconds members are not used. The wYear member will be number between 0 and 99 and not a number like 1996. RSI_DATA_LOG_FORMAT format The data log type. Valid formats are: RSI_DLF_BUFFER_EMPTY RSI_DLF_USER_ENROLLED RSI_DLF_NO_HAND_READ RSI_DLF_IDENTITY_UNKNOWN RSI_DLF_EXIT_GRANTED RSI_DLF_SCORE_IS RSI_DLF_ACCESS_DENIED RSI_DLF_IDENTITY_VERIFIED RSI_DLF_USER_REMOVED RSI_DLF_ENTER_COMMAND_MODE RSI_DLF_LEAVE_COMMAND_MODE RSI_DLF_RECALIBRATED RSI_DLF_DOOR_FORCED_OPEN RSI_DLF_TAMPER_ACTIVATED RSI_DLF_SUPERVISOR_OVERRIDE RSI_DLF_USER_ADDED_FROM_CARD RSI_DLF_AUX_INPUT_ON RSI_DLF_REQ_EXIT_ACTIVATED RSI_DLF_AUX_OUTPUT_ON RSI_DLF_BAUD_RATE_CHANGED

67

RSI_DLF_UNIT_ADDRESS_CHANGED RSI_DLF_SITE_CODE_CHANGED RSI_DLF_TIME_AND_DATE_SET RSI_DLF_LOCK_SETUP_CHANGED RSI_DLF_PASSWORDS_CHANGED RSI_DLF_REJECT_THRESHOLD_SET RSI_DLF_AUX_OUT_SETUP_CHANGED RSI_DLF_PRINTER_SETUP_CHANGED RSI_DLF_DOOR_OPEN_TOO_LONG RSI_DLF_USERS_LISTED RSI_DLF_DATA_BASE_SAVED RSI_DLF_DATA_BASE_RESTORED RSI_DLF_REJ_OVERRIDE_CHANGED RSI_DLF_AUTH_LEVEL_CHANGED RSI_DLF_OPER_MODE_CHANGED RSI_DLF_OUTPUT_MODE_CHANGED RSI_DLF_MAX_ID_LEN_CHANGED RSI_DLF_MEMORY_CLEARED RSI_DLF_ACCESS_REFUSED_TZ RSI_DLF_TIME_ZONES_CHANGED RSI_DLF_USER_TIME_ZONE_CHANGED RSI_DLF_DURESS_ALARM RSI_DLF_LOCK_OUTPUT_ON RSI_DLF_LOCK_OUTPUT_OFF RSI_DLF_AUX_OUTPUT_OFF RSI_DLF_SPECIAL_ENROLLMENT RSI_DLF_AUX_UNLOCK_WIEGAND RSI_DLF_TIME_RESTRICTIONS RSI_DATA_LOG_DATA_1 data1 Additional data depending on data log format. See Software Manual for more information. RSI_DATA_LOG_DATA_2 data2 Additional data depending on data log format. See Software Manual for more information.

RSI_DATA_LOG_1
P R O T O T YP E

typedef union { RSI_ID id; BYTE data[5]; RSI_DATA_LOG_DATA_1;

M E M B E R S

RSI_ID id The following data log formats use this field:

RSI_DLF_USER_ENROLLED RSI_DLF_NO_HAND_READ RSI_DLF_IDENTITY_UNKNOWN RSI_DLF_EXIT_GRANTED RSI_DLF_ACCESS_DENIED RSI_DLF_IDENTITY_VERIFIED RSI_DLF_USER_REMOVED RSI_DLF_SUPERVISOR_OVERRIDE RSI_DLF_REJ_OVERRIDE_CHANGED RSI_DLF_AUTH_LEVEL_CHANGED RSI_DLF_ACCESS_REFUSED_TZ RSI_DLF_USER_TIME_ZONE_CHANGED RSI_DLF_DURESS_ALARM RSI_DLF_SPECIAL_ENROLLMENT RSI_DLF_AUX_UNLOCK_WIEGAND RSI_DLF_TIME_RESTRICTIONS BYTE data The other data log formats use this field.

RSI_DATA_LOG_2
P R O T O T YP E

typedef union { RSI_SCORE score; RSI_TA_7 ta_7; RSI_TA_15_1 ta_15_1; RSI_TA_15_2 ta_15_2; RSI_TA_15_3 ta_15_3; RSI_REJECT_THRESHOLD threshold; RSI_ID id; BOOL flag; BYTE data[5]; RSI_DATA_LOG_DATA_2; RSI_SCORE score Used by data log format RSI_DLF_SCORE_IS.

P R O T O T YP E

RSI_TA_7 ta_7 Used by data log format RSI_DLF_IDENTITY_VERIFIED.

69

RSI_TA_15_1 ta_15_1 Unused at this time. RSI_TA_15_2 ta_15_2 Used by data log format RSI_DLF_SUPERVISOR_OVERRIDE. RSI_TA_15_3 ta_15_3 Unused at this time. RSI_REJECT_THRESHOLD threshold Used by data log format RSI_DLF_REJECT_THRESHOLD_SET. RSI_ID id Used by data log format RSI_DLF_SPECIAL_ENROLLMENT. BOOL flag Used by data log format RSI_DLF_TIME_RESTRICTIONS. BYTE data[5] The other data log formats use this field.

RSI_TA_7
P R O T O T YP E

typedef struct { RSI_DATA_LOG_DATA_TYPE type; RSI_BCD_4 department; RSI_TA_7; RSI_DATA_LOG_DATA_TYPE type The data log subtype. Valid subtypes are:

P R O T O T YP E

RSI_NO_DATA_EXPECTED RSI_NO_DATA_ENTERED RSI_DATA_IN RSI_DATA_BACK1 RSI_DATA_OUT RSI_DATA_DEPARTMENT RSI_DATA_BACK2 RSI_DATA_JOB RSI_DATA_BACK3 RSI_BCD_4 department The department code.

N O T E S

See rsi_cmd.h for a complete description of the datalog format.

Structures sizes and their data elements offsets in bytes for 32-bit Windows.
This info. should be used by developers other than VC++, (like VBasic, Delphi, ...) who need to write the translation of rsi_cmd.h into valid statements and data types of the chosen programming language. Module rsidll32.bas is provided for Visual Basic. Note that some padding is required for proper struct member alignment. Datalog structures: RSI_DATA_LOG_ELEMENT offset, size: 28 addr 0, 1 time 1, 6 format 8, 4 data1 12, 6 data1.id 0, 5 data1.data 0, 5 data1.threshold 0, 2 data2 20, 8 data2.dlf17 0, 8 data2.dlf19 0, 8 data2.dlf30 0, 8 data2.dlf48 0, 8 data2.score 0, 2 data2.ta_7 0, 8

71

data2.ta_15_1 0, 8 data2.ta_15_2 0, 8 data2.ta_15_3 0, 8 data2.id 0, 5 data2.flag 0, 4 data2.data 0, 5 RSI_TA_7 offset, size: 8 type 0, 4 department 4, 4 RSI_TA_15_1 offset, size: 8 type 0, 4 category 4, 4 RSI_TA_15_2 offset, size: 8 type 0, 4 data.department 4, 4 data.bulkHours 4, 4 data.bulkDollars 4, 4 RSI_TA_15_3 offset, size: 8 type 0, 4 department 4, 4 RSI_BULK_DOLLARS offset, size: 4 dollars 0, 2 cents 2, 1 deduct 3, 1

RSI_BULK_HOURS offset, size: 4 hours 0, 2 minutes 2, 1 deduct 3, 1 RSI_DLF_19 offset, size: 8 ta 0, 4 data 4, 4 RSI_DLF_30 offset, size: 8 ta 0, 4 data 4, 4 RSI_DLF_48 offset, size: 8 ta 0, 4 data 4, 4

Old readers structures: RSI_BELL_SCHEDULE_ELEMENT offset, size: 4 min 0, 1 hour 1, 1 dur 2, 1 dowMask 3, 1 RSI_BELL_SCHEDULE offset, size: 400 bells 0, 400 RSI_CALIBRATION_DATA offset, size: 6 exposure 0, 2

73

row 2, 2 col 4, 2 RSI_DATA_BANK offset, size: 4096 data 0, 4096 RSI_DISPLAY_MESSAGE offset, size: 44 userSpecific 0, 4 halfsecs 4, 1 id 4, 5 msg 9, 32 RSI_LAST_TEMPLATE offset, size: 12 score 0, 2 templateVector 2, 9 RSI_RESPONSE offset, size: 20 type 0, 4 data 4, 4 dataSize 8, 2 buffer 12, 4 buflen 16, 2 RSI_RESULTS offset, size: 8 id 0, 5 score 6, 2 RSI_SETUP_DATA offset, size: 144 passwords 0, 50 threshold 50, 2

auxFlag 52, 4 auxTimeout 56, 2 printFlag 60, 4 statusFlag 64, 4 auxAlarmFlagD 68, 4 auxAlarmFlagA 72, 4 auxAlarmFlagI 76, 4 auxAlarmFlagT 80, 4 auxAlarmFlagP 84, 4 lockTime 88, 2 shuntTime 90, 2 networkBaudIndex 92, 4 printerBaudIndex 96, 4 readerAddress 100, 1 facilityCode 102, 2 operatingMode 104, 4 outputMode 108, 4 beeperFlag 112, 4 idLength 116, 1 accountingMode 117, 1 unlockTimeZone 118, 1 auxTimeZone 119, 1 auxDuressFlag 120, 4 duressCharacter 124, 1

75

numberOfTries 125, 1 dlsOn 126, 6 dlsOff 132, 6 display12Hour 140, 4 RSI_STATUS offset, size: 96 h_read 0, 4 led1 4, 4 led2 8, 4 led3 12, 4 led4 16, 4 any_key 20, 4 aux_out1 24, 4 aux_out2 28, 4 res_sys 32, 4 verify_rdy 36, 4 rslts_rdy 40, 4 failed_cmd 44, 4 dlog_rdy 48, 4 id_nim 52, 4 cmd_bsy 56, 4 kp_id 60, 4 tmpr_st 64, 4 aux_in2 68, 4 aux_st 72, 4

aux_in1 76, 4 door_st 80, 4 rex_st 84, 4 lock_st 88, 4 aux0_st 92, 4 RSI_TIME_DATE offset, size: 6 second 0, 1 minute 1, 1 hour 2, 1 day 3, 1 month 4, 1 year 5, 1 RSI_TIME_ZONE_INTERVAL offset, size: 3 start 0, 1 stop 1, 1 dowMask 2, 1 RSI_TIME_ZONE_TABLE offset, size: 2208 holidays 0, 1488 timeZones 1488, 720 RSI_USER_RECORD offset, size: 24 id 0, 5 templateVector 5, 9 authorityLevel 16, 4 rejectThreshold 20, 2

77

timeZone 22, 1

New readers structures: RSI_AUX_CLEAR_FLAG offset, size: 4 onverified 0, 4 RSI_AUX_EVENT_FLAG offset, size: 48 tamper 0, 4 tzviol 4, 4 idref 8, 4 duress 12, 4 auxin1 16, 4 auxin2 20, 4 door 24, 4 tryagain 28, 4 f1key 32, 4 f2key 36, 4 power 40, 4 RSI_AUX_OUTPUT_SETUP offset, size: 60 flags 0, 48 time 48, 2 clear 52, 4 tz 56, 1 RSI_COMMAND_STATUS offset, size: 100 incomplete 0, 4

status 4, 96 RSI_EXT_SETUP_DATA offset, size: 195 readyStr 0, 14 serMode 14, 1 flags0 16, 48 aux1 64, 60 aux2 124, 60 hpDlogFlag 184, 4 timeScale 188, 1 auxKpdCtrl 189, 1 langType 190, 1 dateFmt 191, 1 ringCount 192, 1 ringTimeout 193, 1 ringDelay 194, 1 deFKMasks 195, 1 RSI_EXT_TIME_INTERVAL offset, size: 5 hour_beg 0, 1 minute_beg 1, 1 hour_end 2, 1 minute_end 3, 1 dow 4, 1 RSI_EXT_USER_DATA offset, size: 66 ti 0, 15

79

fkmasks 16, 2 name 18, 16 data 34, 24 amnesty 58, 1 reserved 59, 6 RSI_EXT_USER_DATA_FIELD offset, size: 72 id 0, 5 xud 6, 66 RSI_EXT_USER_RECORD offset, size: 92 bur 0, 24 xud 24, 66 RSI_READER_INFO offset, size: 104 model 0, 1 memory 1, 1 promDate 2, 20 promName 22, 17 sn 40, 4 snp 44, 1 userCap 46, 2 dlogCap 48, 2 usersEnrolled 50, 2 dlogsPresent 52, 2 reserved 54, 50 RSI_USER_DATA offset, size: 29

Chapter

id 0, 5 data 5, 24 RSI_USER_MESSAGE offset, size: 37 id 0, 5 msg 5, 32 PACKED_TIME_INTERVAL offset, size: 4 be 0, 3 dow 3, 1 RSI_EXT_TIME_INTERVAL_IN_MINUTE offset, size: 6 beg 0, 2 end 2, 2 dow 4, 1

10

This chapter is applicable to the new hand readers only. It is an addition to the existing DLL and available from V2.3.

81

Note: Any of the new hand reader commands sent to the old readers will result in a timeout. All models include HP2K, HP3K, HP4K, HKII and HKCR New Commands Overview rsiAddUserMessage rsiClearUserMessages rsiGetExtSetupData rsiAllocResponseBuffer rsiDeAllocResponseBuffer rsiReadResponseBuffer rsiGetExtUserRecord rsiGetOemCode rsiGetReaderInfo rsiHereIsExtSetupData rsiHereIsExtUserRecord rsiHereIsFkeyData rsiLoadFkeyFromFile rsiRemoveUserMessage rsiSetExtUserData rsiSetUserData Available in Models HP4K HP4K models models models models HP4K models models models HP4K models and HP+ models and HP+ HP4K HP4K HP4K

All All All All All All All All All

Level 2 API
Hand Reader Commands rsiAddUserMessage
P R O T O T YP E

RSI_RESULT rsiAddUserMessage (RSI_CHANNEL chnl, RSI_USER_MESSAGE FAR* um, RSI_COMMAND_STATUS FAR* cstat); RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

A R G U M E N T S

RSI_USER_MESSAGE FAR* um A pointer to the structure for the user message. RSI_COMMAND_STATUS FAR* cstat

A pointer to the structure for the command status.


D E S C R I P T I O N R E T U R N S

Sends command RSI_CMD_ADD_USER_MESSAGE to the hand reader. rsiUserMessageToData,

RSI_SUCCESS if successful. Any error value returned by rsiSendMessage, or rsiGetCommandStatus if unsuccessful.


N O T E S

rsiClearUserMessages
P R O T O T YP E A R G U M E N T S

RSI_RESULT rsiClearUserMessages (RSI_CHANNEL chnl); RSI_CHANNEL chnl The handle returned by rsiInstallChannel. Sends command RSI_CMD_CLEAR_USER_MESSAGES to the hand reader. by rsiSendMessage, or

D E S C R I P T I O N

RSI_SUCCESS if successful. Any error value returned rsiGetResponseStatus if unsuccessful.


R E T U R N S N O T E S

The message pool in the hand reader is cleared of all messages.

rsiHereIsExtSetupData
P R O T O T YP E

RSI_RESULT rsiHereIsExtSetupData (RSI_CHANNEL chnl, RSI_EXT_SETUP_DATA FAR* setup); RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

A R G U M E N T S

RSI_EXT_SETUP_DATA FAR* setup A pointer to the structure for the extended setup data. This function retrieves the existing extended setup data from the reader, updates it with the new extended setup data, and then sends it back to the reader which will save it to its NV-Ram.
D E S C R I P T I O N R E T U R N S

RSI_SUCCESS if successful. Any error value returned

by

rsiSendExtSetupData,

83

rsiGetResponse, and/or rsiParseResponse if unsuccessful.


N O T E S

The setup data structure this function uses is not the format the hand reader uses.

rsiHereIsExtUserRecord
P R O T O T YP E

RSI_RESULT rsiHereIsExtUserRecord (RSI_CHANNEL chnl, RSI_EXT_USER_RECORD FAR* ur); RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

A R G U M E N T S

RSI_EXT_USER_RECORD FAR* ur A pointer to the structure for the extended user record.
D E S C R I P T I O N

Sends command RSI_CMD_HERE_IS_EXT_USER_RECORD to the hand reader. rsiExtUserRecordToData,

RSI_SUCCESS if successful. Any error value returned by rsiSendMessage, or rsiGetResponseStatus if unsuccessful.


R E T U R N S N O T E S

rsiLoadFkeyFromFile
P R O T O T YP E

RSI_RESULT rsiLoadFkeyFromFile(RSI_CHANNEL chnl, char *filename); RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

A R G U M E N T S

Char *filename Function key data file generated by FKPARSE. Sends command RSI_CMD_HERE_IS_FKEY_DATA to the hand reader. The file is read and validated to ensure its content was generated by FKPARSE before sending it to the hand reader function key data area.
D E S C R I P T I O N R E T U R N S

RSI_SUCCESS if successful.

Any error value returned by rsiSendMessage, or rsiGetResponseStatus if unsuccessful.


N O T E S

It is recommended to use this function as it can validate the function key data before sending it to the hand reader.

rsiHereIsFkeyData
P R O T O T YP E

RSI_RESULT rsiHereIsFkeyData (RSI_CHANNEL chnl, RSI_FKEY_DATA FAR* fkeyData); RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

A R G U M E N T S

RSI_FKEY_DATA FAR* fkeyData A pointer to the structure for the function key data.
D E S C R I P T I O N

Sends command RSI_CMD_HERE_IS_FKEY_DATA to the hand reader. The given data is loaded into the hand reader function key data area. by rsiSendMessage, or

RSI_SUCCESS if successful. Any error value returned rsiGetResponseStatus if unsuccessful.


R E T U R N S N O T E S

It is not recommended to use this function as it cannot validate the function key data before sending it to the hand reader.

rsiRemoveUserMessage
P R O T O T YP E

RSI_RESULT rsiRemoveUserMessage (RSI_CHANNEL chnl, RSI_ID id); RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

A R G U M E N T S

RSI_ID id The id of the target user record.


D E S C R I P T I O N

Sends command RSI_CMD_REMOVE_USER_MESSAGE to the hand reader.

85

RSI_SUCCESS if successful. Any error value returned rsiGetResponseStatus if unsuccessful.


R E T U R N S N O T E S

by

rsiSendMessage,

or

All messages in the message pool with the given ID are removed. The ID does not have to be in the user database.

rsiSendExtSetupData
P R O T O T YP E

RSI_RESULT rsiSendExtSetupData (RSI_CHANNEL chnl);

Sends command RSI_CMD_SEND_EXT_SETUP_DATA to the hand reader.

rsiSetExtUserData
P R O T O T YP E

RSI_RESULT rsiSetExtUserData (RSI_CHANNEL chnl, RSI_EXT_USER_DATA_FIELD FAR* xud, RSI_COMMAND_STATUS FAR* RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

cstat);
A R G U M E N T S

RSI_EXT_USER_DATA_FIELD FAR* xud A pointer to the structure for the extended user data field. RSI_COMMAND_STATUS FAR* cstat A pointer to the structure for the command status.
D E S C R I P T I O N R E T U R N S

Sends command RSI_CMD_SET_EXT_USER_DATA to the hand reader.

RSI_SUCCESS if successful. Any error value returned by rsiExtUserDataToData, rsiSendMessage, or rsiGetCommandStatus if unsuccessful. This command is used to set the extended data fields in an extended user record. If a record matching the given ID is found, the incomplete flag in the RSI_COMMAND_STATUS structure is FALSE, meaning the command has been carried out successfully. If the given ID is not in the database, the incomplete flag is set to TRUE, meaning the command cannot be carried out, even though it is received properly.
N O T E S

rsiSetUserData
P R O T O T YP E

RSI_RESULT rsiSetUserData (RSI_CHANNEL chnl, RSI_USER_DATA FAR* udf, RSI_COMMAND_STATUS FAR* cstat); RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

A R G U M E N T S

RSI_USER_DATA FAR* udf A pointer to the structure for the user-defined field. RSI_COMMAND_STATUS FAR* cstat A pointer to the structure for the command status.
D E S C R I P T I O N R E T U R N S

Sends command RSI_CMD_SET_USER_DATA to the hand reader.

RSI_SUCCESS if successful. Any error value returned by rsiUserDataToData, rsiSendMessage, or rsiGetCommandStatus if unsuccessful. This command is used to set the user-defined field portion of the given record. If the ID is found, the incomplete flag in the RSI_COMMAND_STATUS structure is FALSE, meaning the record has been updated. If the ID is not in the database, the incomplete flag is set to TRUE, meaning the command cannot be carried out, even though it is received properly.
N O T E S

87

Level 3 API
High Level Functions rsiGetExtSetupData
P R O T O T YP E

RSI_RESULT rsiGetExtSetupData (RSI_CHANNEL chnl, RSI_EXT_SETUP_DATA FAR* setup); RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

A R G U M E N T S

RSI_EXT_SETUP_DATA FAR* setup A pointer to the structure for the setup data.
D E S C R I P T I O N R E T U R N S

Retrieves the current setup data for the hand reader.

RSI_SUCCESS if successful. Any error value returned by rsiSendExtSetupData, rsiGetResponse, and/or rsiParseResponse if unsuccessful.

rsiAllocResponseBuffer
P R O T O T YP E A R G U M E N T S

RSI_RESULT rsiAllocResponsebuffer (RSI_CHANNEL chnl); RSI_CHANNEL chnl The handle returned by rsiInstallChannel. Sets up an extra buffer for channel for retrieving response from reader. RSI_SUCCESS if successful.

D E S C R I P T I O N

R E T U R N S

rsiDeAllocResponseBuffer
P R O T O T YP E

RSI_RESULT rsiDeAllocResponseBuffer (RSI_CHANNEL chnl);

A R G U M E N T S

RSI_CHANNEL chnl The handle returned by rsiInstallChannel. Throws away extra buffer for channel for retrieving response from reader. RSI_SUCCESS if successful.

D E S C R I P T I O N

R E T U R N S

rsiReadResponseBuffer
P R O T O T YP E

RSI_RESULT rsiReadResponseBuffer (RSI_CHANNEL chnl, LPBYTE FAR* buffer, WORD FAR* buflen); RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

A R G U M E N T S

LPBYTE FAR* buffer Where to stick pointer to extra buffer for channel for retrieving response from reader. WORD FAR* buflen Where to stick length of current contents of extra buffer for channel which was filled in when last command to reader was executed.
D E S C R I P T I O N

Supplies pointer to and length of current contents of extra buffer for channel which was filled in when last command to reader was RSI_SUCCESS if successful. RSI_ERROR_DATA if extra buffer does not exist.

executed.
R E T U R N S

rsiGetExtUserRecord
P R O T O T YP E

RSI_RESULT rsiGetExtUserRecord (RSI_CHANNEL chnl, RSI_ID id, RSI_EXT_USER_RECORD FAR* ur); RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

A R G U M E N T S

89

RSI_ID id The id of the user record to get. RSI_EXT_USER_RECORD FAR* ur A pointer to the structure for the extended user record.
D E S C R I P T I O N

Retrieves the extended user record of the requested id from the hand reader.

RSI_SUCCESS if successful. Any error value returned by rsiSendExtUserRecord, rsiGetResponse, and/or rsiParseResponse if unsuccessful.
R E T U R N S

rsiGetOemCode
P R O T O T YP E

RSI_RESULT rsiGetOemCode (RSI_CHANNEL chnl, RSI_OEM_CODE FAR* oem); RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

A R G U M E N T S

RSI_OEM_CODE FAR* oem A pointer to the structure for the OEM code.
D E S C R I P T I O N R E T U R N S

Retrieves the OEM code from the hand reader.

RSI_SUCCESS if successful. Any error value returned by rsiSendOemCode, rsiGetResponse, and/or rsiParseResponse if unsuccessful.

rsiGetReaderInfo
P R O T O T YP E

RSI_RESULT rsiGetReaderInfo (RSI_CHANNEL chnl, RSI_READER_INFO FAR* ri); RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

A R G U M E N T S

RSI_READER_INFO FAR* ri A pointer to the structure for the reader info.


D E S C R I P T I O N

Retrieves the reader info from the hand reader.

RSI_SUCCESS if successful. Any error value returned by rsiSendReaderInfo, rsiGetResponse, and/or rsiParseResponse if unsuccessful.
R E T U R N S

rsiMemoryIs
P R O T O T YP E

RSI_MEMORY_OPTIONS RSI_READER_INFO ri);

rsiMemoryIs

(RSI_CHANNEL

chnl,

A R G U M E N T S

RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

RSI_READER_INFO ri A structure for the reader info.


D E S C R I P T I O N R E T U R N S

Returns the memory option based on the given reader info. Any of the RSI_MEMORY_OPTIONS values.

rsiMemoryIs128K, rsiMemoryIs256K, rsiMemoryIs640K


P R O T O T YP E A R G U M E N T S

BOOL rsiMemoryIs128K (RSI_CHANNEL chnl, RSI_READER_INFO ri); RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

RSI_READER_INFO ri A structure for the reader info.


D E S C R I P T I O N

TRUE if the memory option in the reader info is the same as the memory options asked.

R E T U R N S

rsiModelIs
RSI_MODELS rsiModelIs (RSI_CHANNEL chnl, RSI_READER_INFO ri); RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

P R O T O T YP E A R G U M E N T S

RSI_READER_INFO ri A structure for the reader info.

91

D E S C R I P T I O N R E T U R N S

Returns the model value based on the given reader info. Any of the RSI_MODELS values.

rsiModelIsHK, rsiModelIsHKCR, rsiModelIsHKII, rsiModelIsHP, rsiModelIsHP2K, rsiModelIsHP3K, rsiModelIsHP4K, rsiModelIsSpecial


P R O T O T YP E A R G U M E N T S

BOOL rsiModelIsHK (RSI_CHANNEL chnl, RSI_READER_INFO ri); RSI_CHANNEL chnl The handle returned by rsiInstallChannel.

RSI_READER_INFO ri A structure for the reader info.


D E S C R I P T I O N

TRUE if the model in the reader info is the same as the model asked.

R E T U R N S

Data Conversion API


Raw, Packed Hand Reader Data Programmer Friendly Structures rsiDataToExtSetupData
P R O T O T YP E

RSI_DATA_ERROR rsiDataToExtSetupData (LPBYTE data, RSI_EXT_SETUP_DATA FAR* setup); LPBYTE data A pointer to the buffer with the setup data in raw, packed hand reader

A R G U M E N T S

format. RSI_EXT_SETUP_DATA FAR* setup A pointer to the structure that will receive the converted setup data.
D E S C R I P T I O N

Converts setup data from raw, packed hand reader format to a setup data structure. RSI_DATA_OK if successful. One of the values specified in RSI_DATA_ERROR if unsuccessful.

R E T U R N S

rsiDataToExtUserRecord
P R O T O T YP E

RSI_DATA_ERROR rsiDataToExtUserRecord (LPBYTE data, RSI_EXT_USER_RECORD FAR* ur); LPBYTE data A pointer to the buffer with the user record data in raw, packed hand

A R G U M E N T S

reader format. RSI_EXT_USER_RECORD FAR* ur A pointer to the structure that will receive the converted user record data.
D E S C R I P T I O N

Converts user record data from raw, packed hand reader format to an extended user record data structure. RSI_DATA_OK if successful. One of the values specified in RSI_DATA_ERROR if unsuccessful.

R E T U R N S

93

rsiDataToReaderInfo
P R O T O T YP E

RSI_DATA_ERROR rsiDataToReaderInfo (LPBYTE data, RSI_READER_INFO FAR* ri); LPBYTE data A pointer to the buffer with the reader info data in raw, packed hand

A R G U M E N T S

reader format. RSI_READER_INFO FAR* ri A pointer to the structure that will receive the converted reader info data.
D E S C R I P T I O N

Converts reader info data from raw, packed hand reader format to an reader info data structure. RSI_DATA_OK if successful. One of the values specified in RSI_DATA_ERROR if unsuccessful.

R E T U R N S

rsiExtSetupDataToData
P R O T O T YP E

RSI_DATA_ERROR rsiExtSetupDataToData (RSI_EXT_SETUP_DATA FAR* setup, LPBYTE data); RSI_EXT_SETUP_DATA FAR* setup A pointer to the structure with the setup data.

A R G U M E N T S

LPBYTE data A pointer to the buffer that will receive the setup data in raw, packed hand reader format.
D E S C R I P T I O N

Convert a setup data structure to the format used by the hand reader. RSI_DATA_OK if successful. One of the values specified in RSI_DATA_ERROR if unsuccessful.

R E T U R N S

rsiExtUserDataToData
P R O T O T YP E

RSI_DATA_ERROR rsiExtUserDataToData (RSI_EXT_USER_DATA_FIELD FAR* ud, LPBYTE data); RSI_EXT_USER_DATA_FIELD FAR* ud

A R G U M E N T S

A pointer to the structure with the extended user data. LPBYTE data A pointer to the buffer that will receive the extended user data in raw, packed hand reader format.
D E S C R I P T I O N

Convert an extended user data structure to the format used by the hand reader. RSI_DATA_OK if successful. One of the values specified in RSI_DATA_ERROR if unsuccessful.

R E T U R N S

rsiExtUserRecordToData
P R O T O T YP E

RSI_DATA_ERROR rsiExtUserRecordToData (RSI_EXT_USER_RECORD FAR* ur, LPBYTE data); RSI_EXT_USER_RECORD FAR* ur A pointer to the structure with the extended user record.

A R G U M E N T S

LPBYTE data A pointer to the buffer that will receive the extended user record in raw, packed hand reader format.
D E S C R I P T I O N

Convert an extended user record structure to the format used by the hand reader. RSI_DATA_OK if successful. One of the values specified in RSI_DATA_ERROR if unsuccessful.

R E T U R N S

rsiPackTI
P R O T O T YP E

RSI_DATA_ERROR rsiPackTI(RSI_EXT_TIME_INTERVAL ti, PACKED_TIME_INTERVAL FAR*pti); RSI_EXT_TIME_INTERVAL ti A structure for the extended time interval.

A R G U M E N T S

PACKED_TIME_INTERVAL FAR*pti A pointer to the PACKED_TIME_INTERVAL structure that will be used in hand reader.

95

D E S C R I P T I O N

Converts an extended time interval structure to the format used by the hand reader. RSI_DATA_OK if successful. One of the values specified in RSI_DATA_ERROR if unsuccessful.

R E T U R N S

rsiUnpackTI
P R O T O T YP E

RSI_DATA_ERROR rsiUnpackTI(PACKED_TIME_INTERVAL pti, RSI_EXT_TIME_INTERVAL FAR* ti); PACKED_TIME_INTERVAL pti

A R G U M E N T S

A PACKED_TIME_INTERVAL structure that is used in hand reader. RSI_EXT_TIME_INTERVAL FAR* ti A pointer to the structure for the extended time interval.
D E S C R I P T I O N

Converts a packed ti used in the hand reader to an extended time interval structure. RSI_DATA_OK

R E T U R N S

DLL Functions and Reader Commands Cross Reference


Old Models
RSIDLL FUNCTIONS rsiResume(RSI_CHANNEL chnl) rsiAbortCommand(RSI_CHANNEL chnl) rsiHereIsUserRecord(RSI_CHANNEL chnl, RSI_USER_RECORD FAR* ur) rsiSendUserRecord(RSI_CHANNEL chnl, RSI_ID id) rsiGetUserRecord(RSI_CHANNEL chnl, RSI_ID id, RSI_USER_RECORD FAR* ur) rsiSendSetupData(RSI_CHANNEL chnl) rsiHereIsSetupData(RSI_CHANNEL chnl, RSI_SETUP_DATA FAR* setup) rsiRemoveUserRecord(RSI_CHANNEL chnl, RSI_ID id) rsiCalibrate(RSI_CHANNEL chnl) rsiClearUserDataBase(RSI_CHANNEL chnl) rsiSendCalibrationData(RSI_CHANNEL chnl) rsiGetCalibrationData(RSI_CHANNEL chnl, RSI_CALIBRATION_DATA FAR* calib) rsiSendLastUserRecord(chnl) rsiGetLastUserRecord(RSI_CHANNEL chnl, RSI_USER_RECORD FAR* ur) rsiHereIsTime(RSI_CHANNEL chnl, RSI_TIME_DATE FAR* time) rsiSendResults(RSI_CHANNEL chnl) rsiGetResults(RSI_CHANNEL chnl, RSI_RESULTS FAR* results) rsiSendStatusCRC(RSI_CHANNEL chnl, RSI_STATUS FAR* status) READER COMMANDS 1 0x31 2 0x32 7 0x37 8 0x38 8 with response 2 N 0x4e = 0x3d ? 0x3f : 0x3a > 0x3e < 0x3c < with response 3 @ 0x40 @ with response 2 A 0x41 C 0x43 C with response 5 D 0x44

97

rsiEnterIdleMode(RSI_CHANNEL chnl) E 0x45 rsiHereIsBankNumber(RSI_CHANNEL chnl, RSI_BANK_NUMBER bnk) F 0x46 rsiHereIsDataBank(RSI_CHANNEL chnl, RSI_DATA_BANK FAR* dbnk) G 0x47 rsiSendDataBank(RSI_CHANNEL chnl, RSI_BANK_NUMBER bnk) H 0x48 rsiGetDataBank(RSI_CHANNEL chnl, RSI_BANK_NUMBER bnk, RSI_DATA_BANK FAR* dbnk) H with response 6 rsiEnrollUser(RSI_CHANNEL chnl, RSI_PROMPT prm) I 0x49 rsiVerifyOnExternalData(RSI_CHANNEL chnl, RSI_PROMPT prm, RSI_TEMPLATE tmpl) J 0x4a rsiSendTemplate(RSI_CHANNEL chnl) K 0x4b rsiGetLastTemplate(RSI_CHANNEL chnl, RSI_LAST_TEMPLATE FAR* tmpl) K with response 7 rsiUpdateNVRam(RSI_CHANNEL chnl) L 0x4c rsiSendDataLog(RSI_CHANNEL chnl) M 0x4d rsiGetDataLogElement(RSI_CHANNEL chnl, RSI_DATA_LOG_ELEMENT FAR* dl, BOOL bPrev) M with response 8 rsiSendPreviousDataLog(RSI_CHANNEL chnl) m 0x6d rsiSendSetupData(RSI_CHANNEL chnl) N 0x4e rsiGetSetupData(RSI_CHANNEL chnl, RSI_SETUP_DATA FAR* setup) N with response 9 rsiOutputControl(RSI_CHANNEL chnl, RSI_OUTPUT_STATE out) O 0x4f rsiHereIsDisplayMessage(RSI_CHANNEL chnl, RSI_DISPLAY_MESSAGE FAR* msg) P 0x50 rsiVerifyOnInternalData(RSI_CHANNEL chnl, RSI_ID id) Q 0x51 rsiNextMessageIsTimeZone(RSI_CHANNEL chnl) R 0x52 rsiHereAreTimeZones(RSI_CHANNEL chnl, RSI_TIME_ZONE_TABLE FAR* tz) S 0x53 rsiDisplayCodedMessage(RSI_CHANNEL chnl, RSI_MESSAGE_CODE msg, BYTE halfsecs) V 0x56 rsiNextMessageIsBellScheduleTable(RSI_CHANNEL chnl) W 0x57 rsiHereIsBellScheduleTable(RSI_CHANNEL chnl, RSI_BELL_SCHEDULE FAR* schedule) X 0x58 rsiPrinterPassThrough(RSI_CHANNEL chnl, LPBYTE out, BYTE len) p 0x70

New Models
RSIDLL FUNCTIONS READER COMMANDS

rsiHereIsFkeyData(RSI_CHANNEL chnl, RSI_FKEY_DATA FAR* fkeyData) d 0x64 rsiLoadFkeyFromFile(RSI_CHANNEL chnl, char *filename) d with file validation rsiHereIsExtUserRecord(RSI_CHANNEL chnl, RSI_EXT_USER_RECORD FAR* ur) x 0x78 rsiSendExtUserRecord(RSI_CHANNEL chnl, RSI_ID id) t 0x74 rsiGetExtUserRecord(RSI_CHANNEL chnl, RSI_ID id, RSI_EXT_USER_RECORD FAR* ur) t with response 1 rsiSetExtUserData(RSI_CHANNEL chnl, RSI_EXT_USER_DATA_FIELD FAR* xud, RSI_COMMAND_STATUS FAR* cstat) u 0x75 rsiSetUserData(RSI_CHANNEL chnl, RSI_USER_DATA FAR* udf, RSI_COMMAND_STATUS FAR* cstat) f 0x66 rsiAddUserMessage(RSI_CHANNEL chnl, RSI_USER_MESSAGE FAR* um, RSI_COMMAND_STATUS FAR* cstat) v 0x76 rsiRemoveUserMessage(RSI_CHANNEL chnl, RSI_ID id) rsiClearUserMessages(RSI_CHANNEL chnl) rsiSendOemCode(RSI_CHANNEL chnl) rsiGetOemCode(RSI_CHANNEL chnl, RSI_OEM_CODE FAR* oem) rsiSendReaderInfo(RSI_CHANNEL chnl) rsiGetReaderInfo(RSI_CHANNEL chnl, RSI_READER_INFO FAR* ri) rsiHereIsExtSetupData(RSI_CHANNEL chnl, RSI_EXT_SETUP_DATA FAR* setup) rsiSendExtSetupData(RSI_CHANNEL chnl) rsiGetExtSetupData(RSI_CHANNEL chnl, RSI_EXT_SETUP_DATA FAR* setup) w 0x77 0x79 o 0x6f o with response O s 0x73 s with response S 0x2b 0x2c , with response A

+ ,

99

Вам также может понравиться