Classes | Defines | Typedefs | Functions | Variables
tm_reader.c File Reference

Mercury API - top level implementation. More...

#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "tm_reader.h"
#include "serial_reader_imp.h"
#include "tmr_utils.h"
Include dependency graph for tm_reader.c:

Go to the source code of this file.

Classes

struct  TMR_SerialTransportDispatchTable
struct  TMR_SerialTransportDispatchTableData

Defines

#define EAPI_PREFIX   "eapi://"
#define EAPI_PREFIX_LEN   (sizeof(EAPI_PREFIX)-1)
#define LLRP_EAPI_PREFIX   "llrp+eapi://"
#define LLRP_EAPI_PREFIX_LEN   (sizeof(LLRP_EAPI_PREFIX)-1)
#define LLRP_PREFIX   "llrp://"
#define LLRP_PREFIX_LEN   (sizeof(LLRP_PREFIX)-1)
#define TMR_PREFIX   "tmr://"
#define TMR_PREFIX_LEN   (sizeof(TMR_PREFIX)-1)

Typedefs

typedef struct
TMR_SerialTransportDispatchTable 
TMR_SerialTransportDispatchTable
typedef struct
TMR_SerialTransportDispatchTableData 
TMR_SerialTransportDispatchTableData

Functions

void * do_background_receiveAutonomousReading (void *arg)
void TMR__notifyTransportListeners (TMR_Reader *reader, bool tx, uint32_t dataLen, uint8_t *data, int timeout)
TMR_Status TMR_addTransportListener (TMR_Reader *reader, TMR_TransportListenerBlock *b)
TMR_Status TMR_create (TMR_Reader *reader, const char *deviceUri)
TMR_Status TMR_create_alloc (TMR_Reader **reader, const char *deviceUri)
TMR_Status TMR_GEN2_init_BapParams (TMR_GEN2_Bap *bapVal, int32_t powerUpDelayUs, int32_t freqHopOfftimeUs)
TMR_Status TMR_GPITR_init_enable (TMR_GPITriggerRead *triggerRead, bool enable)
static void TMR_initSerialTransportTable ()
bool TMR_memoryProvider (void *cookie, uint16_t *size, uint8_t *data)
TMR_Status TMR_paramGet (struct TMR_Reader *reader, TMR_Param key, void *value)
TMR_Status TMR_paramList (struct TMR_Reader *reader, TMR_Param *keys, uint32_t *len)
void TMR_paramProbe (struct TMR_Reader *reader, TMR_Param key)
TMR_Status TMR_paramSet (struct TMR_Reader *reader, TMR_Param key, const void *value)
TMR_Status TMR_reader_init_internal (struct TMR_Reader *reader)
TMR_Status TMR_readIntoArray (struct TMR_Reader *reader, uint32_t timeoutMs, int32_t *tagCount, TMR_TagReadData *result[])
TMR_Status TMR_receiveAutonomousReading (struct TMR_Reader *reader, TMR_TagReadData *trd, TMR_Reader_StatsValues *stats)
TMR_Status TMR_removeTransportListener (TMR_Reader *reader, TMR_TransportListenerBlock *b)
TMR_Status TMR_RP_init_multi (TMR_ReadPlan *plan, TMR_ReadPlan **plans, uint8_t planCount, uint32_t weight)
TMR_Status TMR_RP_init_simple (TMR_ReadPlan *plan, uint8_t antennaCount, uint8_t *antennaList, TMR_TagProtocol protocol, uint32_t weight)
TMR_Status TMR_RP_set_enableAutonomousRead (TMR_ReadPlan *plan, bool autonomousRead)
TMR_Status TMR_RP_set_enableTriggerRead (TMR_ReadPlan *plan, TMR_GPITriggerRead *triggerRead)
TMR_Status TMR_RP_set_filter (TMR_ReadPlan *plan, TMR_TagFilter *filter)
TMR_Status TMR_RP_set_stopTrigger (TMR_ReadPlan *plan, uint32_t nCount)
TMR_Status TMR_RP_set_tagop (TMR_ReadPlan *plan, TMR_TagOp *tagop)
TMR_Status TMR_RP_set_useFastSearch (TMR_ReadPlan *plan, bool useFastSearch)
TMR_Status TMR_setSerialTransport (char *scheme, TMR_TransportNativeInit nativeInit)
TMR_Status TMR_STATS_init (TMR_Reader_StatsValues *stats)
TMR_Status TMR_TA_init_gen2 (TMR_TagAuthentication *auth, TMR_GEN2_Password password)
TMR_Status TMR_TA_init_gen2_Denatran_IAV_writeCredentials (TMR_TagAuthentication *auth, uint8_t idLength, uint8_t *tagId, uint8_t len, uint8_t *data)
TMR_Status TMR_TA_init_gen2_Denatran_IAV_writeSecCredentials (TMR_TagAuthentication *auth, uint8_t length, uint8_t *data, uint8_t len, uint8_t *credentials)
TMR_Status TMR_TagOp_init_GEN2_BlockErase (TMR_TagOp *tagop, TMR_GEN2_Bank bank, uint32_t wordPtr, uint8_t wordCount)
TMR_Status TMR_TagOp_init_GEN2_BlockPermaLock (TMR_TagOp *tagop, uint8_t readLock, TMR_GEN2_Bank bank, uint32_t blockPtr, TMR_uint16List *mask)
TMR_Status TMR_TagOp_init_GEN2_BlockWrite (TMR_TagOp *tagop, TMR_GEN2_Bank bank, uint32_t wordPtr, TMR_uint16List *data)
TMR_Status TMR_TagOp_init_GEN2_Kill (TMR_TagOp *tagop, TMR_GEN2_Password killPassword)
TMR_Status TMR_TagOp_init_GEN2_Lock (TMR_TagOp *tagop, uint16_t mask, uint16_t action, TMR_GEN2_Password accessPassword)
TMR_Status TMR_TagOp_init_GEN2_ReadData (TMR_TagOp *tagop, TMR_GEN2_Bank bank, uint32_t wordAddress, uint8_t len)
TMR_Status TMR_TagOp_init_GEN2_SecurePassWord (TMR_TagOp *tagop, uint8_t passwordType, uint32_t gen2PassWord, uint8_t addressLength, uint8_t addressOffset, uint16_t flashOffset)
TMR_Status TMR_TagOp_init_GEN2_SecureReadData (TMR_TagOp *tagop, TMR_GEN2_Bank bank, uint32_t wordAddress, uint8_t len, uint8_t tagtype, uint8_t passwordType)
TMR_Status TMR_TagOp_init_GEN2_WriteData (TMR_TagOp *tagop, TMR_GEN2_Bank bank, uint32_t wordAddress, TMR_uint16List *data)
TMR_Status TMR_TagOp_init_GEN2_WriteTag (TMR_TagOp *tagop, TMR_TagData *epc)
TMR_Status TMR_TagOp_init_ISO180006B_Lock (TMR_TagOp *tagop, uint8_t address)
TMR_Status TMR_TagOp_init_ISO180006B_ReadData (TMR_TagOp *tagop, uint8_t byteAddress, uint8_t len)
TMR_Status TMR_TagOp_init_ISO180006B_WriteData (TMR_TagOp *tagop, uint8_t byteAddress, TMR_uint8List *data)
TMR_Status TMR_TF_init_gen2_select (TMR_TagFilter *filter, bool invert, TMR_GEN2_Bank bank, uint32_t bitPointer, uint16_t maskBitLength, uint8_t *mask)
TMR_Status TMR_TF_init_tag (TMR_TagFilter *filter, TMR_TagData *tag)
bool TMR_TF_match (TMR_TagFilter *filter, TMR_TagData *tag)
TMR_Status TMR_TLA_init_gen2 (TMR_TagLockAction *lockAction, uint16_t mask, uint16_t action)
TMR_Status TMR_TRD_init (TMR_TagReadData *trd)
TMR_Status TMR_TRD_init_data (TMR_TagReadData *trd, uint16_t size, uint8_t *buf)
TMR_Status TMR_TRD_MEMBANK_init_data (TMR_uint8List *data, uint16_t size, uint8_t *buf)
TMR_Status validateReadPlan (TMR_Reader *reader, TMR_ReadPlan *plan, TMR_AntennaMapList *txRxMap, uint32_t protocols)

Variables

static
TMR_SerialTransportDispatchTable 
tdTable
static
TMR_SerialTransportDispatchTableData 
tdTableData [10]
static bool transportTableInitialized = false

Detailed Description

Mercury API - top level implementation.

Author:
Nathan Williams
Date:
10/28/2009

Definition in file tm_reader.c.


Define Documentation

#define EAPI_PREFIX   "eapi://"

Definition at line 39 of file tm_reader.c.

#define EAPI_PREFIX_LEN   (sizeof(EAPI_PREFIX)-1)

Definition at line 40 of file tm_reader.c.

#define LLRP_EAPI_PREFIX   "llrp+eapi://"

Definition at line 45 of file tm_reader.c.

#define LLRP_EAPI_PREFIX_LEN   (sizeof(LLRP_EAPI_PREFIX)-1)

Definition at line 46 of file tm_reader.c.

#define LLRP_PREFIX   "llrp://"

Definition at line 48 of file tm_reader.c.

#define LLRP_PREFIX_LEN   (sizeof(LLRP_PREFIX)-1)

Definition at line 49 of file tm_reader.c.

#define TMR_PREFIX   "tmr://"

Definition at line 42 of file tm_reader.c.

#define TMR_PREFIX_LEN   (sizeof(TMR_PREFIX)-1)

Definition at line 43 of file tm_reader.c.


Typedef Documentation


Function Documentation

void TMR__notifyTransportListeners ( TMR_Reader reader,
bool  tx,
uint32_t  dataLen,
uint8_t *  data,
int  timeout 
)

Definition at line 767 of file tm_reader.c.

TMR_Status TMR_GEN2_init_BapParams ( TMR_GEN2_Bap bapVal,
int32_t  powerUpDelayUs,
int32_t  freqHopOfftimeUs 
)

Initialize a TMR_GEN2_Bap with the provided parameters

Parameters:
bapValpointer to the TMR_GEN2_Bap structure
powerUpDelayUsthe power up delay time
freqHopOfftimeUsthe offtime for frequencyHop

Definition at line 929 of file tm_reader.c.

static void TMR_initSerialTransportTable ( ) [static]

Private: Should not be used by user level application. structure containing the transport scheme name and the pointer to the factory init function.

We did not get a chance to initialize the transport table. Initialize it now.

Definition at line 78 of file tm_reader.c.

bool TMR_memoryProvider ( void *  cookie,
uint16_t *  size,
uint8_t *  data 
)

This function can be used as a callback to TMR_firmwareLoad when the firmware image exists in system memory. The cookie is a pointer to a TMR_memoryCookie that is initialized with the start of the firmware image in memory and its size.

Parameters:
cookieTMR_memoryCookie value.
[in]sizeThe number of bytes requested.
[out]sizeThe number of bytes returned.
dataPointer to buffer to fill.
Returns:
true if there is more firmware data to return.

Definition at line 782 of file tm_reader.c.

void TMR_paramProbe ( struct TMR_Reader reader,
TMR_Param  key 
)

Initialize a TMR_TagOp as a Higgs2 Partial Load Image operation with the provided parameters.

Parameters:
tagopPointer to the tagop structure to initialize.
killPasswordkill password
accessPasswordaccess password
epcEPC to write

Definition at line 3530 of file tm_reader.c.

Definition at line 296 of file tm_reader.c.

Definition at line 3613 of file tm_reader.c.

Initialize a TMR_TagAuthentication structure as a Gen2 password.

Parameters:
authPointer to the structure to initialize.
passwordThe password 32-bit Gen2 password value.

Definition at line 1085 of file tm_reader.c.

TMR_Status TMR_TA_init_gen2_Denatran_IAV_writeCredentials ( TMR_TagAuthentication auth,
uint8_t  idLength,
uint8_t *  tagId,
uint8_t  len,
uint8_t *  data 
)

Initialize a TMR_TagAuthentication structure as Denatran IAV write credential

Parameters:
authPointer to the structure to initialize.
dataGen2 Denatran IAV write credential

Definition at line 1101 of file tm_reader.c.

TMR_Status TMR_TA_init_gen2_Denatran_IAV_writeSecCredentials ( TMR_TagAuthentication auth,
uint8_t  length,
uint8_t *  data,
uint8_t  len,
uint8_t *  credentials 
)

Initialize a TMR_TagAuthentication structure as Denatran IAV write credential

Parameters:
authPointer to the structure to initialize.
dataGen2 Denatran IAV write credential

Definition at line 1142 of file tm_reader.c.

TMR_Status TMR_TagOp_init_GEN2_BlockErase ( TMR_TagOp tagop,
TMR_GEN2_Bank  bank,
uint32_t  wordPtr,
uint8_t  wordCount 
)

Initialize a TMR_TagOp as a GEN2 BlockErase operation with the provided parameters.

Parameters:
tagopPointer to the tagop structure to initialize.
bankbank
wordPtrThe starting word address to erase
wordCountNumber of words to erase

Definition at line 1672 of file tm_reader.c.

TMR_Status TMR_TagOp_init_GEN2_BlockPermaLock ( TMR_TagOp tagop,
uint8_t  readLock,
TMR_GEN2_Bank  bank,
uint32_t  blockPtr,
TMR_uint16List mask 
)

Initialize a TMR_TagOp as a GEN2 BlockPermaLock operation with the provided parameters.

Parameters:
tagopPointer to the tagop structure to initialize.
readLockreadLock
bankbank
blockPtrblock pointer
maskmask (The length of the mask specifies the block range)

Definition at line 1651 of file tm_reader.c.

TMR_Status TMR_TagOp_init_GEN2_BlockWrite ( TMR_TagOp tagop,
TMR_GEN2_Bank  bank,
uint32_t  wordPtr,
TMR_uint16List data 
)

Initialize a TMR_TagOp as a GEN2 BlockWrite operation with the provided parameters.

Parameters:
tagopPointer to the tagop structure to initialize.
bankbank
wordPtrword pointer
datadata (The length of the data specifies the word count)

Definition at line 1631 of file tm_reader.c.

Initialize a TMR_TagOp as a GEN2 kill operation with the provided parameters.

Parameters:
tagopPointer to the tagop structure to initialize.
killPasswordtag kill password

Definition at line 1613 of file tm_reader.c.

TMR_Status TMR_TagOp_init_GEN2_Lock ( TMR_TagOp tagop,
uint16_t  mask,
uint16_t  action,
TMR_GEN2_Password  accessPassword 
)

Initialize a TMR_TagOp as a GEN2 lock operation with the provided parameters.

Parameters:
tagopPointer to the tagop structure to initialize.
maskmask
actionaction
accessPasswordThe password to use to lock the tag.

Definition at line 1581 of file tm_reader.c.

TMR_Status TMR_TagOp_init_GEN2_ReadData ( TMR_TagOp tagop,
TMR_GEN2_Bank  bank,
uint32_t  wordAddress,
uint8_t  len 
)

Initialize a TMR_TagOp as a GEN2 data read operation with the provided parameters.

Parameters:
tagopPointer to the tagop structure to initialize.
bankMemory bank from which to read
wordAddressWord address of location in bank from which to read
lenNumber of words to read

Definition at line 1453 of file tm_reader.c.

TMR_Status TMR_TagOp_init_GEN2_SecurePassWord ( TMR_TagOp tagop,
uint8_t  passwordType,
uint32_t  gen2PassWord,
uint8_t  addressLength,
uint8_t  addressOffset,
uint16_t  flashOffset 
)

Initialize a TMR_TagOp as a Gen2 Secure Password with the provided parameters.

Parameters:
tagopPointer to the tagop structure to initialize
passwordTypespecifying the mode of password
gen2PassWordGen2 access password
addressLengthNumber of bits used to address the AP list
addressOffsetEPC word offset
flashOffsetUser flash offset

Definition at line 1502 of file tm_reader.c.

TMR_Status TMR_TagOp_init_GEN2_SecureReadData ( TMR_TagOp tagop,
TMR_GEN2_Bank  bank,
uint32_t  wordAddress,
uint8_t  len,
uint8_t  tagtype,
uint8_t  passwordType 
)

Initialize a TMR_TagOp as a GEN2 Secure data read operation with the provided parameters.

Parameters:
tagopPointer to the tagop structure to initialize.
bankMemory bank from which to read
wordAddressWord address of location in bank from which to read
lenNumber of words to read
tagtypeto select Alien Higgs 3 secure access and Monza 4 secure access
passwordTypespecifying the mode of password

Definition at line 1477 of file tm_reader.c.

TMR_Status TMR_TagOp_init_GEN2_WriteData ( TMR_TagOp tagop,
TMR_GEN2_Bank  bank,
uint32_t  wordAddress,
TMR_uint16List data 
)

Initialize a TMR_TagOp as a GEN2 data write operation with the provided parameters.

Parameters:
tagopPointer to the tagop structure to initialize.
bankMemory bank to write into
wordAddressWord address of location to begin write
dataData to write

Definition at line 1545 of file tm_reader.c.

Initialize a TMR_TagOp as a GEN2 EPC write operation with the provided parameters.

Parameters:
tagopPointer to the tagop structure to initialize.
epcEPC to write

Definition at line 1435 of file tm_reader.c.

TMR_Status TMR_TagOp_init_ISO180006B_Lock ( TMR_TagOp tagop,
uint8_t  address 
)

Initialize a TMR_TagOp as a ISO180006B lock operation with the provided parameters.

Parameters:
tagopPointer to the tagop structure to initialize.
addressThe memory address of the byte to lock.

Definition at line 1598 of file tm_reader.c.

TMR_Status TMR_TagOp_init_ISO180006B_ReadData ( TMR_TagOp tagop,
uint8_t  byteAddress,
uint8_t  len 
)

Initialize a TMR_TagOp as a ISO18000B data read operation with the provided parameters.

Parameters:
tagopPointer to the tagop structure to initialize.
byteAddressAddress of location in bank from which to read
lenNumber of bytes to read

Definition at line 1524 of file tm_reader.c.

TMR_Status TMR_TagOp_init_ISO180006B_WriteData ( TMR_TagOp tagop,
uint8_t  byteAddress,
TMR_uint8List data 
)

Initialize a TMR_TagOp as a ISO180006B data write operation with the provided parameters.

Parameters:
tagopPointer to the tagop structure to initialize.
byteAddressaddress of location to begin write
dataData to write

Definition at line 1565 of file tm_reader.c.

TMR_Status TMR_TF_init_gen2_select ( TMR_TagFilter filter,
bool  invert,
TMR_GEN2_Bank  bank,
uint32_t  bitPointer,
uint16_t  maskBitLength,
uint8_t *  mask 
)

Initialize a TMR_Filter structure as a Gen2 select filter with the provided parameters.

Parameters:
filterPointer to the filter structure to initialize
invertWhether to invert the result of the select
bankThe memory bank on the tag to compare with the data
bitPointerThe bit address of the tag data to compare
maskBitLengthThe length of the data to compare
maskThe data to compare

Definition at line 967 of file tm_reader.c.

Initialize a TMR_Filter structure as tag data (EPC) filter with the provided tag (which is copied).

Parameters:
filterPointer to the filter structure to initialize
tagTMR_TagData to use as the filter value

Definition at line 946 of file tm_reader.c.

bool TMR_TF_match ( TMR_TagFilter filter,
TMR_TagData tag 
)

Test if a tag matches this filter. Only applies to selects based on the EPC.

Parameters:
filterThe filter to test with.
tagThe tag to test.
Returns:
true if the tag matches the filter.

Definition at line 1014 of file tm_reader.c.

TMR_Status TMR_TLA_init_gen2 ( TMR_TagLockAction lockAction,
uint16_t  mask,
uint16_t  action 
)

Initialize a TMR_TagLockAction as a Gen2 lock action with the provided parameters.

Parameters:
lockActionPointer to the structure to initialize.
maskmask
actionaction

Definition at line 1395 of file tm_reader.c.

Initialize TMR_TagReadData with default values. The tagData buffer will be initialized to TMR_MAX_EMBEDDED_DATA_LENGTH which can be found in tm_config.h. If this value is zero, then the buffer is pointed to NULL.

Parameters:
trdPointer to the TMR_TagReadData structure to initialize

Definition at line 837 of file tm_reader.c.

TMR_Status TMR_TRD_init_data ( TMR_TagReadData trd,
uint16_t  size,
uint8_t *  buf 
)

Initialize a TMR_TagReadData with the provided data storage area.

Parameters:
trdPointer to the TMR_TagReadData structure to initialize
sizeThe number of bytes pointed to
bufPointer to the uint8_t storage area

Definition at line 895 of file tm_reader.c.

TMR_Status TMR_TRD_MEMBANK_init_data ( TMR_uint8List data,
uint16_t  size,
uint8_t *  buf 
)

Initialize a TMR_TagReadDataMemBank with provided data storage area

Parameters:
datato the TMR_uint8List structure to initialize
sizeThe nuber of bytes pointed to
bufpointer to the uint8_t storage area

Definition at line 912 of file tm_reader.c.

TMR_Status validateReadPlan ( TMR_Reader reader,
TMR_ReadPlan plan,
TMR_AntennaMapList txRxMap,
uint32_t  protocols 
)

Definition at line 606 of file tm_reader.c.


Variable Documentation

Definition at line 76 of file tm_reader.c.

Definition at line 75 of file tm_reader.c.

bool transportTableInitialized = false [static]

Definition at line 74 of file tm_reader.c.



thingmagic_rfid
Author(s): Brian Bingham
autogenerated on Thu May 16 2019 03:01:25