RFID API Documentation  1.0
Reference guide for RFID API
AccessSequence

Functions

RFID_STATUS WINAPI RFID_InitializeAccessSequence (RFID_HANDLE32 readerHandle)
 This function initializes the access sequence such that operations like Read/Write/Kill/Lock/BlockWrite/BlockErase can be performed in a sequence. More...
 
RFID_STATUS WINAPI RFID_AddOperationToAccessSequence (RFID_HANDLE32 readerHandle, LPOP_CODE_PARAMS lpOpCodeParams, UINT32 *pOpCodeIndex)
 This function adds an operation to the Access sequences. More...
 
RFID_STATUS WINAPI RFID_DeleteOperationFromAccessSequence (RFID_HANDLE32 readerHandle, UINT32 opCodeIndex)
 This function removes one or all operation from the Access Sequence. More...
 
RFID_STATUS WINAPI RFID_DeinitializeAccessSequence (RFID_HANDLE32 readerHandle)
 This function removes all Operations added using RFID_AddOperationToAccessSequence and deinitializes the AccessSequence. More...
 
RFID_STATUS WINAPI RFID_PerformAccessSequence (RFID_HANDLE32 readerHandle, LPACCESS_FILTER lpAccessFilter, LPANTENNA_INFO lpAntennaInfo, LPTRIGGER_INFO lpTriggerInfo, LPVOID rsvd)
 This function performs the access operations as specified by Access Operation sequence API. More...
 
RFID_STATUS WINAPI RFID_StopAccessSequence (RFID_HANDLE32 readerHandle)
 This function Stops the Access operation which was started using RFID_PerformAccessSequence API. More...
 
RFID_STATUS WINAPI RFID_GetLastAccessResult (RFID_HANDLE32 readerHandle, UINT32 *pSuccessCount, UINT32 *pFailureCount)
 This function gets the number of Tags on which the last Access operation was performed successfully, and the number of tags on which the operation failed. More...
 

Detailed Description

Function Documentation

◆ RFID_InitializeAccessSequence()

RFID_STATUS WINAPI RFID_InitializeAccessSequence ( RFID_HANDLE32  readerHandle)

This function initializes the access sequence such that operations like Read/Write/Kill/Lock/BlockWrite/BlockErase can be performed in a sequence.

Parameters
[in]readerHandle
Handle to the RFID device.
Returns
If the function succeeds the return value is RFID_API_SUCCESS. If the function fails the return value is one of the following:
  • RFID_API_INVALID_HANDLE Handle provided is invalid
  • RFID_ACCESS_SEQUENCE_IN_USE Access Sequence is already initialized and in use
Remarks
None
See also
RFID_AddOperationToAccessSequence, RFID_DeleteOperationFromAccessSequence, RFID_DeinitializeAccessSequence, RFID_PerformAccessSequence, RFID_StopAccessSequence, RFID_GetLastAccessResult
Remarks
Example: See

◆ RFID_AddOperationToAccessSequence()

RFID_STATUS WINAPI RFID_AddOperationToAccessSequence ( RFID_HANDLE32  readerHandle,
LPOP_CODE_PARAMS  lpOpCodeParams,
UINT32 pOpCodeIndex 
)

This function adds an operation to the Access sequences.

Parameters
[in]readerHandleHandle to the RFID device.
[in]lpOpCodeParamsPointer to OP_CODE_PARAMS.
[out]pOpCodeIndexPointer to the Index to the Op Sequence created if the API succeeds.
Returns
If the function succeeds the return value is RFID_API_SUCCESS. If the function fails the return value is one of the following:
  • RFID_API_INVALID_HANDLE Handle provided is invalid
  • RFID_API_PARAM_ERROR Invalid parameter given
  • RFID_ACCESS_SEQUENCE_NOT_INITIALIZED Access Sequence is not initialized
Remarks
The order of performing the Operations will be the order in which this API is invoked; i.e. the first added Operation will be executed first.
See also
RFID_InitializeAccessSequence, RFID_DeinitializeAccessSequence, RFID_DeleteOperationFromAccessSequence RFID_PerformAccessSequence, RFID_StopAccessSequence, RFID_GetLastAccessResult
Remarks
Example: See

◆ RFID_DeleteOperationFromAccessSequence()

RFID_STATUS WINAPI RFID_DeleteOperationFromAccessSequence ( RFID_HANDLE32  readerHandle,
UINT32  opCodeIndex 
)

This function removes one or all operation from the Access Sequence.

Parameters
[in]readerHandle
Handle to the RFID device.
[in]opCodeIndex
Index to the Op Sequence.
Returns
If the function succeeds the return value is RFID_API_SUCCESS. If the function fails the return value is one of the following:
  • RFID_API_INVALID_HANDLE Handle provided is invalid
  • RFID_FILTER_INVALID_INDEX Invalid tag filter index
  • RFID_ACCESS_SEQUENCE_NOT_INITIALIZED Access Sequence is not initialized
Remarks
If pOpCodeIndex is zero, the whole Operation Sequences will be removed.
See also
RFID_InitializeAccessSequence, RFID_DeinitializeAccessSequence, RFID_AddOperationToAccessSequence, RFID_GetLastAccessResult RFID_PerformAccessSequence, RFID_StopAccessSequence
Remarks
Example: See RFID_PerformAccessSequence

◆ RFID_DeinitializeAccessSequence()

RFID_STATUS WINAPI RFID_DeinitializeAccessSequence ( RFID_HANDLE32  readerHandle)

This function removes all Operations added using RFID_AddOperationToAccessSequence and deinitializes the AccessSequence.

Parameters
[in]readerHandle
Handle to the RFID device.
Returns
If the function succeeds the return value is RFID_API_SUCCESS. If the function fails the return value is one of the following:
  • RFID_API_INVALID_HANDLE Handle provided is invalid
  • RFID_API_PARAM_ERROR Invalid parameter given
  • RFID_ACCESS_SEQUENCE_NOT_INITIALIZED Access Sequence is not initialized
Remarks
See also
RFID_InitializeAccessSequence, RFID_AddOperationToAccessSequence, RFID_DeleteOperationFromAccessSequence, RFID_GetLastAccessResult RFID_PerformAccessSequence, RFID_StopAccessSequence
Remarks
Example: See

◆ RFID_PerformAccessSequence()

RFID_STATUS WINAPI RFID_PerformAccessSequence ( RFID_HANDLE32  readerHandle,
LPACCESS_FILTER  lpAccessFilter,
LPANTENNA_INFO  lpAntennaInfo,
LPTRIGGER_INFO  lpTriggerInfo,
LPVOID  rsvd 
)

This function performs the access operations as specified by Access Operation sequence API.

Parameters
[in]readerHandle
Handle to the RFID device.
[in]lpAccessFilter
Filter Criteria for the Access operation. If this is NULL, there wont be any access filters used for the operation.
[in]lpAntennaInfo
Antenna List on which the access operation is to be performed. If this is NULL, access is performed on ALL antennas.
[in]lpTriggerInfo
Trigger Criteria for the access operation. If this is NULL, access starts right away when this API is called, and stop when RFID_StopAccessSequence is called.
[in]rsvd
Reserved for future use.
Returns
If the function succeeds the return value is RFID_API_SUCCESS. If the function fails the return value is one of the following:
  • RFID_API_INVALID_HANDLE Handle provided is invalid
  • RFID_INVENTORY_IN_PROGRESS Inventory in progress, cannot perform requested operation
  • RFID_ACCESS_IN_PROGRESS Access Operation in progress, cannot perform requested operation
  • RFID_TAG_LOCATING_IN_PROGRESS Tag Locating in progress, cannot perform requested operation
  • RFID_NXP_EAS_SCAN_IN_PROGRESS NXP EAS SCAN in progress, cannot perform requested operation
Remarks
When the start-trigger criteria is met, the event ACCESS_START_EVENT is signalled. Basic Tag-Access can be performed using RFID_xxxx functions to operate on a single-tag or multiple tags instantly i.e. without any explicit triggers.
See also
RFID_InitializeAccessSequence, RFID_DeinitializeAccessSequence RFID_AddOperationToAccessSequence, RFID_DeleteOperationFromAccessSequence, RFID_StopAccessSequence, RFID_GetLastAccessResult
Remarks
Example:
// Example that adds 3 Read operations to the Access-Sequence
RFID_HANDLE32 readerHandle;
READ_ACCESS_PARAMS readAccessParams;
LPTAG_DATA pTagData;
UINT32 accessSuccessCount, accessFailureCount;
OP_CODE_PARAMS opCodeParams;
UINT32 opCode;
TRIGGER_INFO triggerInfo;
HANDLE accessStopEventHandle = CreateEvent(NULL, FALSE, FALSE, NULL);
if(RFID_API_SUCCESS == RFID_Connect(&readerHandle, TEXT("157.235.207.190"), 0, 0, 0))
{
pTagData = RFID_AllocateTag(readerHandle);
if(NULL == pTagData)
{
printf("\n Tag Allocation failed");
}
else
{
rfidStatus = RFID_InitializeAccessSequence(readerHandle);
readAccessParams.byteCount = 4;
readAccessParams.byteOffset = 0;
readAccessParams.accessPassword = 0;
opCodeParams.opParams = &readAccessParams;
// Add Operation to Read TID
readAccessParams.memoryBank = MEMORY_BANK_TID;
rfidStatus = RFID_AddOperationToAccessSequence(readerHandle, &opCodeParams, &opCode);
// Add Operation to Read User Memory
readAccessParams.memoryBank = MEMORY_BANK_USER;
rfidStatus = RFID_AddOperationToAccessSequence(readerHandle, &opCodeParams, &opCode);
// Add Operation to Read Reserved Memory
readAccessParams.memoryBank = MEMORY_BANK_RESERVED;
rfidStatus = RFID_AddOperationToAccessSequence(readerHandle, &opCodeParams, &opCode);
triggerInfo.stopTrigger.value.numAttempts.n = 1; // One round of inventory
triggerInfo.stopTrigger.value.numAttempts.timeoutMilliseconds = 2000; // Max 2 seconds
triggerInfo.tagReportTrigger = 0; // Reader shall send reports when access operation is completed
RFID_RegisterEventNotification(readerHandle, ACCESS_STOP_EVENT, accessStopEventHandle);
NULL, NULL, &triggerInfo, NULL))
{
WaitForSingleObject(accessStopEventHandle, INFINITE);
rfidStatus = RFID_GetLastAccessResult(readerHandle,
&accessSuccessCount, &accessFailureCount);
printf("\n\n Access Sequence: Success = %d, Failed = %d", accessSuccessCount,
accessFailureCount);
while(RFID_API_SUCCESS == RFID_GetReadTag(readerHandle, pTagData))
{
printTagMemoryBankData(pTagData->pTagID, pTagData->tagIDLength,
pTagData->pMemoryBankData, pTagData->memoryBankDataLength, "Bank");
}
}
// Delete All Operations from the Access Sequence
rfidStatus = RFID_DeleteOperationFromAccessSequence(readerHandle, 0);
rfidStatus = RFID_DeinitializeAccessSequence(readerHandle);
}
rfidStatus = RFID_Disconnect(readerHandle);
}
CloseHandle(accessStopEventHandle);

◆ RFID_StopAccessSequence()

RFID_STATUS WINAPI RFID_StopAccessSequence ( RFID_HANDLE32  readerHandle)

This function Stops the Access operation which was started using RFID_PerformAccessSequence API.

If the Stop-trigger criteria was already met, the event ACCESS_STOP_EVENT signalled and hence this function need not be called.

Parameters
[in]readerHandle
Handle to the RFID device.
Returns
If the function succeeds the return value is RFID_API_SUCCESS. If the function fails the return value is one of the following:
  • RFID_API_INVALID_HANDLE Handle provided is invalid
  • RFID_NO_ACCESS_IN_PROGRESS Access operation is not in progress
Remarks
See also
RFID_InitializeAccessSequence, RFID_DeinitializeAccessSequence RFID_AddOperationToAccessSequence, RFID_DeleteOperationFromAccessSequence, RFID_PerformAccessSequence, RFID_GetLastAccessResult
Remarks
Example: See

◆ RFID_GetLastAccessResult()

RFID_STATUS WINAPI RFID_GetLastAccessResult ( RFID_HANDLE32  readerHandle,
UINT32 pSuccessCount,
UINT32 pFailureCount 
)

This function gets the number of Tags on which the last Access operation was performed successfully, and the number of tags on which the operation failed.

Parameters
[in]readerHandle
Handle to the RFID device.
[out]pSuccessCount
Number of tags in last access operation succeeded.
[out]pFailureCount
Number of tags in last access operation failed.
Returns
If the function succeeds the return value is RFID_API_SUCCESS. If the function fails the return value is one of the following:
  • RFID_API_INVALID_HANDLE Handle provided is invalid
Remarks
In case of RFID_PerformAccessSequence, the success-count indicates the number of tags on which ALL the operations succeeded. Tags on which the not all operations succeeded are counted under failure-count.
See also
RFID_PerformAccessSequence, RFID_StopAccessSequence
Remarks
Example: See
STOP_TRIGGER::numAttempts
TRIGGER_WITH_TIMEOUT numAttempts
N attempts to see all tags in the FOV, or timeout if type is STOP_TRIGGER_TYPE_N_ATTEMPTS_WITH_TIMEOU...
Definition: rfidapiStructs.h:774
TRIGGER_WITH_TIMEOUT::n
UINT16 n
N attempts or N Tag-Observations.
Definition: rfidapiStructs.h:724
MEMORY_BANK_TID
@ MEMORY_BANK_TID
TID Memory: Contains 8-bit class identifier and identifying information.
Definition: rfidapiConstants.h:260
RFID_Write
RFID_STATUS WINAPI RFID_Write(RFID_HANDLE32 readerHandle, UINT8 *pTagID, UINT32 tagIDLength, LPWRITE_ACCESS_PARAMS lpWriteAccessParams, LPACCESS_FILTER lpAccessFilter, LPANTENNA_INFO lpAntennaInfo, LPVOID rsvd)
This function writes to a specified memory bank of tag(s).
Definition: rfidapi.cpp:5329
STOP_TRIGGER_TYPE_N_ATTEMPTS_WITH_TIMEOUT
@ STOP_TRIGGER_TYPE_N_ATTEMPTS_WITH_TIMEOUT
Stop after a specified number of attempts.
Definition: rfidapiConstants.h:284
RFID_GetLastAccessResult
RFID_STATUS WINAPI RFID_GetLastAccessResult(RFID_HANDLE32 readerHandle, UINT32 *pSuccessCount, UINT32 *pFailureCount)
This function gets the number of Tags on which the last Access operation was performed successfully,...
Definition: rfidapi.cpp:9104
TRIGGER_INFO::stopTrigger
STOP_TRIGGER stopTrigger
Condition to be met to stop the operation.
Definition: rfidapiStructs.h:862
MEMORY_BANK_USER
@ MEMORY_BANK_USER
User Memory: Contains user-specific data storage.
Definition: rfidapiConstants.h:261
READ_ACCESS_PARAMS::memoryBank
MEMORY_BANK memoryBank
Memory bank from which data is to be read from.
Definition: rfidapiStructs.h:1541
TAG_DATA::memoryBankDataLength
UINT32 memoryBankDataLength
The length of the data(Number of Bytes) .
Definition: rfidapiStructs.h:957
READ_ACCESS_PARAMS::byteCount
UINT16 byteCount
Number of bytes to read.
Definition: rfidapiStructs.h:1544
RFID_RegisterEventNotification
RFID_STATUS WINAPI RFID_RegisterEventNotification(RFID_HANDLE32 readerHandle, RFID_EVENT_TYPE eventType, EVENT_HANDLE notifyObject)
This function is used to enable notification of single Reader event type.
Definition: rfidapi.cpp:2957
START_TRIGGER_TYPE_IMMEDIATE
@ START_TRIGGER_TYPE_IMMEDIATE
Start immediately when RFID_PerformInventory or RFID_PerformAccessSequence is called.
Definition: rfidapiConstants.h:269
RFID_InitializeAccessSequence
RFID_STATUS WINAPI RFID_InitializeAccessSequence(RFID_HANDLE32 readerHandle)
This function initializes the access sequence such that operations like Read/Write/Kill/Lock/BlockWri...
Definition: rfidapi.cpp:8645
RFID_DeleteOperationFromAccessSequence
RFID_STATUS WINAPI RFID_DeleteOperationFromAccessSequence(RFID_HANDLE32 readerHandle, UINT32 opCodeIndex)
This function removes one or all operation from the Access Sequence.
Definition: rfidapi.cpp:8779
TRIGGER_INFO::startTrigger
START_TRIGGER startTrigger
Condition to be met to start the operation.
Definition: rfidapiStructs.h:861
READ_ACCESS_PARAMS
This struct Contains the parameters for Read Access Operation.
Definition: rfidapiStructs.h:1540
TRIGGER_INFO
Contains trigger criteria to be used for an Inventory or Access Sequence operation.
Definition: rfidapiStructs.h:860
RFID_Disconnect
RFID_STATUS WINAPI RFID_Disconnect(RFID_HANDLE32 readerHandle)
This function closes connection to the Reader.
Definition: rfidapi.cpp:1061
RFID_AddOperationToAccessSequence
RFID_STATUS WINAPI RFID_AddOperationToAccessSequence(RFID_HANDLE32 readerHandle, LPOP_CODE_PARAMS lpOpCodeParams, UINT32 *pOpCodeIndex)
This function adds an operation to the Access sequences.
Definition: rfidapi.cpp:8705
MEMORY_BANK_RESERVED
@ MEMORY_BANK_RESERVED
Reserved Memory: contain the kill and access passwords.
Definition: rfidapiConstants.h:258
FALSE
#define FALSE
Definition: rfidapiTypes.h:55
RFID_HANDLE32
void * RFID_HANDLE32
Definition: rfidapiTypes.h:76
ACCESS_OPERATION_READ
@ ACCESS_OPERATION_READ
Read.
Definition: rfidapiConstants.h:480
RFID_PerformAccessSequence
RFID_STATUS WINAPI RFID_PerformAccessSequence(RFID_HANDLE32 readerHandle, LPACCESS_FILTER lpAccessFilter, LPANTENNA_INFO lpAntennaInfo, LPTRIGGER_INFO lpTriggerInfo, LPVOID rsvd)
This function performs the access operations as specified by Access Operation sequence API.
Definition: rfidapi.cpp:8977
START_TRIGGER::type
START_TRIGGER_TYPE type
Start trigger of type START_TRIGGER_TYPE.
Definition: rfidapiStructs.h:751
READ_ACCESS_PARAMS::accessPassword
UINT32 accessPassword
Password to be used for the Access operation.
Definition: rfidapiStructs.h:1546
RFID_API_SUCCESS
@ RFID_API_SUCCESS
Definition: rfidapiErrors.h:27
TAG_DATA::pTagID
UINT8 * pTagID
Tag ID, for C1G2 this field refers EPC Data.
Definition: rfidapiStructs.h:925
UINT32
unsigned int UINT32
Definition: rfidapiTypes.h:30
RFID_Lock
RFID_STATUS WINAPI RFID_Lock(RFID_HANDLE32 readerHandle, UINT8 *pTagID, UINT32 tagIDLength, LPLOCK_ACCESS_PARAMS lpLockParams, LPACCESS_FILTER lpAccessFilter, LPANTENNA_INFO lpAntennaInfo, LPVOID rsvd)
This function locks tag(s).
Definition: rfidapi.cpp:6025
ACCESS_STOP_EVENT
@ ACCESS_STOP_EVENT
Access Operation has stopped.
Definition: rfidapiConstants.h:81
TAG_DATA
Contains Tag related information.
Definition: rfidapiStructs.h:920
RFID_Connect
#define RFID_Connect
Definition: rfidapi.h:51
STOP_TRIGGER::type
STOP_TRIGGER_TYPE type
Stop trigger of type STOP_TRIGGER_TYPE.
Definition: rfidapiStructs.h:768
STOP_TRIGGER::value
union STOP_TRIGGER::@9 value
value corresponding to the stop trigger type.
TAG_DATA::pMemoryBankData
UINT8 * pMemoryBankData
The data read from the specified Bank or Block Permalock Mask Data as specified by opCode.
Definition: rfidapiStructs.h:954
OP_CODE_PARAMS
This struct contains the parameters for Operation Sequence.
Definition: rfidapiStructs.h:1668
OP_CODE_PARAMS::opCode
ACCESS_OPERATION_CODE opCode
C1G2 Access Operation to be performed.
Definition: rfidapiStructs.h:1669
RFID_STATUS
RFID_STATUS
Definition: rfidapiErrors.h:26
TAG_DATA::tagIDLength
UINT32 tagIDLength
Tag ID Length (Number of Bytes).
Definition: rfidapiStructs.h:926
OP_CODE_PARAMS::opParams
STRUCT_HANDLE opParams
Pointer to READ_ACCESS_PARAMS or WRITE_ACCESS_PARAMS or KILL_ACCESS_PARAMS or LOCK_ACCESS_PARAMS or B...
Definition: rfidapiStructs.h:1670
RFID_Kill
RFID_STATUS WINAPI RFID_Kill(RFID_HANDLE32 readerHandle, UINT8 *pTagID, UINT32 tagIDLength, LPKILL_ACCESS_PARAMS lpKillParams, LPACCESS_FILTER lpAccessFilter, LPANTENNA_INFO lpAntennaInfo, LPVOID rsvd)
This function kills tag(s).
Definition: rfidapi.cpp:5858
READ_ACCESS_PARAMS::byteOffset
UINT16 byteOffset
Byte offset; The addresss of the first byte to read from the chosen memory bank.
Definition: rfidapiStructs.h:1542
TRIGGER_INFO::tagReportTrigger
UINT32 tagReportTrigger
Signifies when to get triggered on TAG_READ_EVENT.
Definition: rfidapiStructs.h:863
RFID_AllocateTag
LPTAG_DATA WINAPI RFID_AllocateTag(RFID_HANDLE32 readerHandle)
This function allocates and initializes the TAG_DATA structure for the application.
Definition: rfidapi.cpp:3438
TRIGGER_WITH_TIMEOUT::timeoutMilliseconds
UINT32 timeoutMilliseconds
For specifying a fail-safe timeout when this trigger is used as a stop trigger.
Definition: rfidapiStructs.h:725
RFID_Read
RFID_STATUS WINAPI RFID_Read(RFID_HANDLE32 readerHandle, UINT8 *pTagID, UINT32 tagIDLength, LPREAD_ACCESS_PARAMS lpReadAccessParams, LPACCESS_FILTER lpAccessFilter, LPANTENNA_INFO lpAntennaInfo, LPTAG_DATA lpTagData, LPVOID rsvd)
This function reads a specified memory bank of tag(s).
Definition: rfidapi.cpp:5184
RFID_DeinitializeAccessSequence
RFID_STATUS WINAPI RFID_DeinitializeAccessSequence(RFID_HANDLE32 readerHandle)
This function removes all Operations added using RFID_AddOperationToAccessSequence and deinitializes ...
Definition: rfidapi.cpp:8837
RFID_GetReadTag
RFID_STATUS WINAPI RFID_GetReadTag(RFID_HANDLE32 readerHandle, LPTAG_DATA lpTagData)
This function returns a Tag if available.
Definition: rfidapi.cpp:3651