Overview
Reads and writes the memory of a single tag asynchronously, using srfidReadTagAsync and srfidWriteTagAsync.
Async Tag Read
Read tag asynchronous. This method has following parameters.
- tagID: Selected tag ID.
- tagData: TagData object.
- memoryBankID: Selected memory bank.
- offset: Offset for the read operation.
- length: Length of the data to read.
- password: Password for the read operation.
- statusMessage: Status message to return.
-(SRFID_RESULT)readTagAsync:(NSString*)tagID withTagData:(srfidTagData **)tagData withMemoryBankID:(SRFID_MEMORYBANK)memoryBankID withOffset:(short)offset withLength:(short)length withPassword:(long)password aStatusMessage:(NSString**)statusMessage{
if (apiInstance != nil)
{
return [apiInstance srfidReadTagAsync:readerID aTagID:tagID aAccessTagData:tagData aMemoryBank:memoryBankID aOffset:offset aLength:length aPassword:password aStatusMessage:statusMessage];
}
return SRFID_RESULT_FAILURE;
}
When the async read method is called, abort the running inventory operation:
SRFID_RESULT rfid_res = SRFID_RESULT_FAILURE;
rfid_res = [apiInstance srfidStopInventory:readerID aStatusMessage:nil];
Async Tag Write
Write tag asynchronous. This method has following parameters.
- tagID: Selected tag ID.
- tagData: TagData object.
- memoryBankID: Selected memory bank.
- offset: Offset for the write operation.
- data: Data to write.
- password: Password for the write operation.
- blockWrite: Block write access for write operation.
- statusMessage: Status message to return.
-(SRFID_RESULT)writeTagAsync:(NSString*)tagID withTagData:(srfidTagData **)tagData withMemoryBankID:(SRFID_MEMORYBANK)memoryBankID withOffset:(short)offset withData:(NSString*)data withPassword:(long)password doBlockWrite:(BOOL)blockWrite aStatusMessage:(NSString**)statusMessage{
if (apiInstance != nil)
{
return [apiInstance srfidWriteTagAsync:readerID aTagID:tagID aAccessTagData:tagData aMemoryBank:memoryBankID aOffset:offset aData:data aPassword:password aDoBlockWrite:blockWrite aStatusMessage:statusMessage];
}
return SRFID_RESULT_FAILURE;
}