Mercury API Reader Interface. More...
#include "tm_config.h"
#include "tmr_types.h"
#include "tmr_status.h"
#include "tmr_gpio.h"
#include "tmr_params.h"
#include "tmr_read_plan.h"
#include "tmr_tag_auth.h"
#include "tmr_tag_data.h"
#include "tmr_tag_lock_action.h"
#include "tmr_tag_protocol.h"
#include "tmr_tagop.h"
#include "tmr_serial_reader.h"
Go to the source code of this file.
#define TMR_connect | ( | reader | ) | ((reader)->connect(reader)) |
The fact that these functions are implemented via macros is an implementation detail, not something for the public API documentation.
Definition at line 1251 of file tm_reader.h.
#define TMR_destroy | ( | reader | ) | ((reader)->destroy(reader)) |
Definition at line 1252 of file tm_reader.h.
#define TMR_executeTagOp | ( | reader, | |
tagop, | |||
filter, | |||
data | |||
) | ((reader)->executeTagOp((reader), (tagop), (filter), (data))) |
Definition at line 1263 of file tm_reader.h.
#define TMR_firmwareLoad | ( | reader, | |
cookie, | |||
provider | |||
) | ((reader)->firmwareLoad((reader),(cookie),(provider))) |
Definition at line 1266 of file tm_reader.h.
#define TMR_getNextTag | ( | reader, | |
read | |||
) | ((reader)->getNextTag((reader),(read))) |
Definition at line 1255 of file tm_reader.h.
#define TMR_gpiGet | ( | reader, | |
count, | |||
state | |||
) | ((reader)->gpiGet((reader),(count),(state))) |
Definition at line 1265 of file tm_reader.h.
#define TMR_gpoSet | ( | reader, | |
count, | |||
state | |||
) | ((reader)->gpoSet((reader),(count),(state))) |
Definition at line 1264 of file tm_reader.h.
#define TMR_hasMoreTags | ( | reader | ) | ((reader)->hasMoreTags(reader)) |
Definition at line 1254 of file tm_reader.h.
#define TMR_killTag | ( | reader, | |
filter, | |||
auth | |||
) | ((reader)->killTag((reader),(filter),(auth))) |
Definition at line 1261 of file tm_reader.h.
#define TMR_lockTag | ( | reader, | |
filter, | |||
action | |||
) | ((reader)->lockTag((reader),(filter),(action))) |
Definition at line 1262 of file tm_reader.h.
#define TMR_modifyFlash | ( | reader, | |
sector, | |||
address, | |||
password, | |||
length, | |||
data, | |||
offset | |||
) | ((reader->modifyFlash((reader),(sector),(address),(password),(length),(data),(offset))) |
Definition at line 1267 of file tm_reader.h.
#define TMR_read | ( | reader, | |
timeoutMs, | |||
tagCount | |||
) | ((reader)->read((reader),(timeoutMs),(tagCount))) |
Definition at line 1253 of file tm_reader.h.
#define TMR_readTagMemBytes | ( | reader, | |
target, | |||
bank, | |||
address, | |||
count, | |||
data | |||
) | ((reader)->readTagMemBytes((reader),(target),(bank),(address),(count),(data))) |
Definition at line 1258 of file tm_reader.h.
#define TMR_readTagMemWords | ( | reader, | |
target, | |||
bank, | |||
address, | |||
count, | |||
data | |||
) | ((reader)->readTagMemWords((reader),(target),(bank),(address),(count),(data))) |
Definition at line 1257 of file tm_reader.h.
#define TMR_reboot | ( | reader | ) | ((reader)->reboot(reader)) |
Definition at line 1268 of file tm_reader.h.
#define TMR_writeTag | ( | reader, | |
filter, | |||
data | |||
) | ((reader)->writeTag((reader),(filter),(data))) |
Definition at line 1256 of file tm_reader.h.
#define TMR_writeTagMemBytes | ( | reader, | |
target, | |||
bank, | |||
address, | |||
count, | |||
data | |||
) | ((reader)->writeTagMemBytes((reader),(target),(bank),(address),(count),(data))) |
Definition at line 1260 of file tm_reader.h.
#define TMR_writeTagMemWords | ( | reader, | |
target, | |||
bank, | |||
address, | |||
count, | |||
data | |||
) | ((reader)->writeTagMemWords((reader),(target),(bank),(address),(count),(data))) |
Definition at line 1259 of file tm_reader.h.
typedef void(* TMR_AuthReqListener)(TMR_Reader *reader, const TMR_TagReadData *trd, void *cookie, TMR_TagAuthentication *auth) |
Type of functions to be registered as tagauth request callbacks
reader | Reader object |
trd | TagReadData object |
cookie | Arbitrary data structure to be passed to callback |
auth | [OUTPUT] Tag authentication value to initialize based on inputs |
Definition at line 210 of file tm_reader.h.
typedef struct TMR_AuthReqListenerBlock TMR_AuthReqListenerBlock |
User-allocated structure containing the callback pointer and the value to pass to that callback.
typedef TMR_SR_GEN2_Q TMR_GEN2_Q |
Definition at line 317 of file tm_reader.h.
typedef TMR_SR_GEN2_QStatic TMR_GEN2_QStatic |
Definition at line 316 of file tm_reader.h.
typedef TMR_SR_GEN2_QType TMR_GEN2_QType |
Definition at line 315 of file tm_reader.h.
typedef struct TMR_memoryCookie TMR_memoryCookie |
Cookie for state storage of a TMR_memoryProvider.
typedef struct TMR_Queue_tagReads TMR_Queue_tagReads |
Private: should not be used by user level application.
typedef struct TMR_Reader TMR_Reader |
TMR_ENABLE_JNI_SERIAL_READER_ONLY is used for building JNI project, and is defined from Makefile.jni
Definition at line 48 of file tm_reader.h.
typedef enum TMR_Reader_StatsFlag TMR_Reader_StatsFlag |
Reader Stats Flag Enum
typedef struct TMR_Reader_StatsValues TMR_Reader_StatsValues |
This object is returned from TMR_cmdGetReaderStats
typedef enum TMR_ReaderType TMR_ReaderType |
typedef void(* TMR_ReadExceptionListener)(TMR_Reader *reader, TMR_Status error, void *cookie) |
Type of functions to be registered as read error callbacks
Definition at line 227 of file tm_reader.h.
typedef struct TMR_ReadExceptionListenerBlock TMR_ReadExceptionListenerBlock |
User-allocated structure containing the callback pointer and the value to pass to that callback.
typedef void(* TMR_ReadListener)(TMR_Reader *reader, const TMR_TagReadData *t, void *cookie) |
Type of functions to be registered as read callbacks
Definition at line 188 of file tm_reader.h.
typedef struct TMR_ReadListenerBlock TMR_ReadListenerBlock |
User-allocated structure containing the callback pointer and the value to pass to that callback.
typedef struct TMR_readParams TMR_readParams |
typedef enum TMR_ReadState TMR_ReadState |
typedef void(* TMR_StatsListener)(TMR_Reader *reader, const TMR_Reader_StatsValues *value, void *cookie) |
Type of functions to be registered as Status read callbacks
Definition at line 261 of file tm_reader.h.
typedef struct TMR_StatsListenerBlock TMR_StatsListenerBlock |
User-allocated structure containing the callback pointer and the value to pass to that callback.
typedef struct TMR_StatsPerAntennaValues TMR_StatsPerAntennaValues |
Per Antenna stats
typedef struct TMR_StatsPerAntennaValuesList TMR_StatsPerAntennaValuesList |
Object to hold the per antenna stats
typedef void(* TMR_StatusListener)(TMR_Reader *reader, const TMR_SR_StatusReport report[], void *cookie) |
Definition at line 263 of file tm_reader.h.
typedef struct TMR_StatusListenerBlock TMR_StatusListenerBlock |
User-allocated structure containing the callback pointer and the value to pass to that callback.
typedef struct TMR_tagOpParams TMR_tagOpParams |
typedef void(* TMR_TransportListener)(bool tx, uint32_t dataLen, const uint8_t data[], uint32_t timeout, void *cookie) |
Type of functions to be registered as transport callbacks
Definition at line 243 of file tm_reader.h.
typedef struct TMR_TransportListenerBlock TMR_TransportListenerBlock |
User-allocated structure containing the callback pointer and the value to pass to that callback.
typedef TMR_Status(* TMR_TransportNativeInit)(TMR_SR_SerialTransport *transport, TMR_SR_SerialPortNativeContext *context, const char *device) |
Definition at line 73 of file tm_reader.h.
enum TMR_Reader_StatsFlag |
Reader Stats Flag Enum
Definition at line 115 of file tm_reader.h.
enum TMR_ReaderType |
Definition at line 92 of file tm_reader.h.
enum TMR_ReadState |
TMR_READ_STATE_IDLE | |
TMR_READ_STATE_STARTING | |
TMR_READ_STATE_STARTED | |
TMR_READ_STATE_ACTIVE | |
TMR_READ_STATE_DONE |
Definition at line 100 of file tm_reader.h.
void cleanup_background_threads | ( | TMR_Reader * | reader | ) |
void notify_exception_listeners | ( | TMR_Reader * | reader, |
TMR_Status | status | ||
) |
Definition at line 544 of file tm_reader_async.c.
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.
bool TMR_fileProvider | ( | void * | cookie, |
uint16_t * | size, | ||
uint8_t * | data | ||
) |
This function can be used as a callback to TMR_firmwareLoad when the firmware image exists as a file.
cookie | FILE * pointing to the file to read from. | |
[in] | size | The number of bytes requested. |
[out] | size | The number of bytes returned. |
data | Pointer to buffer to fill. |
TMR_Status TMR_killTag | ( | TMR_Reader * | reader, |
TMR_TagFilter * | target, | ||
TMR_TagAuthentication * | auth | ||
) |
Sends a kill command to a tag.
reader | The reader being operated on. |
target | The tag to kill, or NULL to kill the first tag seen. |
auth | The authentication needed to kill the tag. |
TMR_Status TMR_lockTag | ( | TMR_Reader * | reader, |
TMR_TagFilter * | target, | ||
TMR_TagLockAction * | action | ||
) |
Sends a lock command to a tag.
reader | The reader being operated on. |
target | The tag to kill, or NULL to kill the first tag seen. |
action | The locking action to apply. |
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.
cookie | TMR_memoryCookie value. | |
[in] | size | The number of bytes requested. |
[out] | size | The number of bytes returned. |
data | Pointer to buffer to fill. |
Definition at line 782 of file tm_reader.c.
void TMR_paramProbe | ( | struct TMR_Reader * | reader, |
TMR_Param | key | ||
) |
pointer to TMR_Reader pointer to TMR_Param
Initialize a TMR_TagOp as a Higgs2 Partial Load Image operation with the provided parameters.
tagop | Pointer to the tagop structure to initialize. |
killPassword | kill password |
accessPassword | access password |
epc | EPC to write |
Definition at line 3530 of file tm_reader.c.
TMR_Status TMR_reader_init_internal | ( | struct TMR_Reader * | reader | ) |
Definition at line 296 of file tm_reader.c.
TMR_Status TMR_receiveAutonomousReading | ( | struct TMR_Reader * | reader, |
TMR_TagReadData * | trd, | ||
TMR_Reader_StatsValues * | stats | ||
) |
Definition at line 3613 of file tm_reader.c.
TMR_Status TMR_writeTag | ( | TMR_Reader * | reader, |
const TMR_TagFilter * | target, | ||
TMR_TagData * | data | ||
) |
Write a new EPC to an existing tag.
The /reader/tagop/antenna
parameter controls which antenna will be used for the write operation. The /reader/tagop/protocol
parameter controls which protocol will be used.
reader | The reader being operated on |
target | The existing tag to write. |
data | The EPC to write to the tag |
Call should fail if reader is not connected.
Upon success, a subsequent TMR_read() should find the new tag ID.
TMR_Status TMR_writeTagMemBytes | ( | TMR_Reader * | reader, |
TMR_TagFilter * | target, | ||
uint32_t | bank, | ||
uint32_t | byteAddress, | ||
uint16_t | byteCount, | ||
const uint8_t | data[] | ||
) |
Write 8-bit bytes to the memory bank of a tag. If the tag's fundamental memory unit is larger than 8 bits, trying to write sub-unit quantities will produce an error.
reader | The reader to operate on. |
target | The tag to write to, or NULL . |
bank | The tag memory bank to write to. |
byteAddress | The byte address to start writing to. |
byteCount | The number of bytes to write. |
data | The bytes to write. |
TMR_Status TMR_writeTagMemWords | ( | TMR_Reader * | reader, |
TMR_TagFilter * | target, | ||
uint32_t | bank, | ||
uint32_t | wordAddress, | ||
uint16_t | wordCount, | ||
const uint16_t | data[] | ||
) |
Write 16-bit words to the memory bank of a tag. If the tag's fundamental memory unit is larger than 16 bits, trying to write sub-unit quantities will produce an error.
reader | The reader to operate on. |
target | The tag to write to, or NULL . |
bank | The tag memory bank to write to. |
wordAddress | The word address to start writing to. |
wordCount | The number of words to write. |
data | The words to write. |
TMR_Status validateReadPlan | ( | TMR_Reader * | reader, |
TMR_ReadPlan * | plan, | ||
TMR_AntennaMapList * | txRxMap, | ||
uint32_t | protocols | ||
) |
Definition at line 606 of file tm_reader.c.