tm_reader.h
Go to the documentation of this file.
00001 /* ex: set tabstop=2 shiftwidth=2 expandtab cindent: */
00002 #ifndef _TM_READER_H
00003 #define _TM_READER_H
00004 
00011  /*
00012  * Copyright (c) 2009 ThingMagic, Inc.
00013  *
00014  * Permission is hereby granted, free of charge, to any person obtaining a copy
00015  * of this software and associated documentation files (the "Software"), to deal
00016  * in the Software without restriction, including without limitation the rights
00017  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
00018  * copies of the Software, and to permit persons to whom the Software is
00019  * furnished to do so, subject to the following conditions:
00020  *
00021  * The above copyright notice and this permission notice shall be included in
00022  * all copies or substantial portions of the Software.
00023  * 
00024  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00025  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00026  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
00027  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00028  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00029  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
00030  * THE SOFTWARE.
00031  */
00032 
00033 #include "tm_config.h"
00034 
00039 #if !defined(TMR_ENABLE_SERIAL_READER_ONLY) && !defined(TMR_ENABLE_JNI_SERIAL_READER_ONLY)  && defined(TMR_ENABLE_LLRP_TRANSPORT)
00040 #define TMR_ENABLE_LLRP_READER
00041 #endif
00042 
00043 #ifdef TMR_ENABLE_BACKGROUND_READS
00044 #include <pthread.h>
00045 #include <semaphore.h>
00046 #endif
00047 
00048 typedef struct TMR_Reader TMR_Reader;
00049 
00050 #include "tmr_types.h"
00051 #include "tmr_status.h"
00052 
00053 #include "tmr_gpio.h"
00054 #include "tmr_params.h"
00055 #include "tmr_read_plan.h"
00056 #include "tmr_tag_auth.h"
00057 #include "tmr_tag_data.h"
00058 #include "tmr_tag_lock_action.h"
00059 #include "tmr_tag_protocol.h"
00060 #include "tmr_tagop.h"
00061 
00062 #include "tmr_serial_reader.h"
00063 #ifdef TMR_ENABLE_LLRP_READER
00064 #include "tmr_llrp_reader.h"
00065 #endif
00066 
00067 #ifdef  __cplusplus
00068 extern "C" {
00069 #endif
00070 
00071 
00072 #ifndef DOXYGEN_IGNORE
00073 typedef TMR_Status (*TMR_TransportNativeInit)(TMR_SR_SerialTransport *transport, TMR_SR_SerialPortNativeContext *context,
00074     const char *device);
00075 
00076 typedef struct TMR_readParams
00077 {
00078 #ifdef TMR_ENABLE_BACKGROUND_READS
00079   uint32_t asyncOnTime;
00080   uint32_t asyncOffTime;
00081 #endif
00082   TMR_ReadPlan defaultReadPlan;
00083   TMR_ReadPlan *readPlan;
00084 } TMR_readParams;
00085 
00086 typedef struct TMR_tagOpParams
00087 {
00088   uint8_t antenna;
00089   TMR_TagProtocol protocol;
00090 }TMR_tagOpParams;
00091 
00092 typedef enum TMR_ReaderType
00093 {
00094   TMR_READER_TYPE_INVALID,
00095   TMR_READER_TYPE_RQL,
00096   TMR_READER_TYPE_SERIAL,
00097   TMR_READER_TYPE_LLRP,
00098 } TMR_ReaderType;
00099 
00100 typedef enum TMR_ReadState
00101 {
00102   TMR_READ_STATE_IDLE,
00103   TMR_READ_STATE_STARTING,
00104   TMR_READ_STATE_STARTED,
00105   TMR_READ_STATE_ACTIVE,
00106   TMR_READ_STATE_DONE,
00107 } TMR_ReadState;
00108 
00109 
00110 #endif /* DOXYGEN_IGNORE */
00111 
00115 typedef enum TMR_Reader_StatsFlag
00116 {
00117   TMR_READER_STATS_FLAG_NONE = 0x00,
00119   TMR_READER_STATS_FLAG_RF_ON_TIME = (1 << 0),
00121   TMR_READER_STATS_FLAG_NOISE_FLOOR_SEARCH_RX_TX_WITH_TX_ON = (1 << 6),
00123   TMR_READER_STATS_FLAG_FREQUENCY = (1 << 7),
00125   TMR_READER_STATS_FLAG_TEMPERATURE = (1 << 8),
00127   TMR_READER_STATS_FLAG_ANTENNA_PORTS = (1 << 9),
00129   TMR_READER_STATS_FLAG_PROTOCOL = (1 << 10),
00131   TMR_READER_STATS_FLAG_CONNECTED_ANTENNAS = (1 << 11),
00132   /* ALL */
00133   TMR_READER_STATS_FLAG_ALL = (TMR_READER_STATS_FLAG_RF_ON_TIME |
00134       TMR_READER_STATS_FLAG_NOISE_FLOOR_SEARCH_RX_TX_WITH_TX_ON |
00135       TMR_READER_STATS_FLAG_TEMPERATURE |
00136       TMR_READER_STATS_FLAG_PROTOCOL |
00137       TMR_READER_STATS_FLAG_ANTENNA_PORTS |
00138       TMR_READER_STATS_FLAG_FREQUENCY |
00139       TMR_READER_STATS_FLAG_CONNECTED_ANTENNAS),
00140 }TMR_Reader_StatsFlag;
00141 
00145 typedef struct TMR_StatsPerAntennaValues
00146 {
00148         uint8_t antenna;
00150         uint32_t rfOnTime;
00152         int8_t noiseFloor;
00153 } TMR_StatsPerAntennaValues;
00154 
00158 typedef struct TMR_StatsPerAntennaValuesList
00159 {
00160         TMR_StatsPerAntennaValues *list;
00161         uint16_t max;
00162         uint16_t len;
00163 } TMR_StatsPerAntennaValuesList;
00164 
00168 typedef struct TMR_Reader_StatsValues
00169 {
00170         TMR_Reader_StatsFlag valid;
00172         int8_t temperature;
00174         TMR_TagProtocol protocol;
00176         uint16_t antenna;
00178         uint32_t frequency;
00180         TMR_uint8List connectedAntennas;
00181         uint8_t _connectedAntennasStorage[TMR_SR_MAX_ANTENNA_PORTS];
00183         TMR_StatsPerAntennaValuesList perAntenna;
00184         TMR_StatsPerAntennaValues _perAntStorage[TMR_SR_MAX_ANTENNA_PORTS];
00185 }TMR_Reader_StatsValues;
00186 
00188 typedef void (*TMR_ReadListener)(TMR_Reader *reader, const TMR_TagReadData *t,
00189                                  void *cookie);
00194 typedef struct TMR_ReadListenerBlock
00195 {
00197   TMR_ReadListener listener;
00199   void *cookie;
00201   struct TMR_ReadListenerBlock *next;
00202 } TMR_ReadListenerBlock;
00203 
00210 typedef void (*TMR_AuthReqListener)(TMR_Reader *reader, const TMR_TagReadData *trd,
00211                                                                         void *cookie, TMR_TagAuthentication *auth);
00216 typedef struct TMR_AuthReqListenerBlock
00217 {
00219   TMR_AuthReqListener listener;
00221   void *cookie;
00223   struct TMR_AuthReqListenerBlock *next;
00224 } TMR_AuthReqListenerBlock;
00225 
00227 typedef void (*TMR_ReadExceptionListener)(TMR_Reader *reader, TMR_Status error, void *cookie);
00232 typedef struct TMR_ReadExceptionListenerBlock
00233 {
00235   TMR_ReadExceptionListener listener;
00237   void *cookie;
00239   struct TMR_ReadExceptionListenerBlock *next;
00240 } TMR_ReadExceptionListenerBlock;
00241 
00243 typedef void (*TMR_TransportListener) (bool tx, uint32_t dataLen,
00244                                        const uint8_t data[], uint32_t timeout,
00245                                        void *cookie);
00250 typedef struct TMR_TransportListenerBlock
00251 {
00253   TMR_TransportListener listener;
00255   void *cookie;
00257   struct TMR_TransportListenerBlock *next;
00258 } TMR_TransportListenerBlock;
00259 
00261 typedef void (*TMR_StatsListener)(TMR_Reader *reader, const TMR_Reader_StatsValues* value,
00262                                 void *cookie);
00263 typedef void (*TMR_StatusListener)(TMR_Reader *reader, const TMR_SR_StatusReport report[],
00264                                  void *cookie);
00269 typedef struct TMR_StatsListenerBlock
00270 {
00272   TMR_StatsListener listener;
00274   void *cookie;
00276   struct TMR_StatsListenerBlock *next;
00277 } TMR_StatsListenerBlock;
00278 
00283 typedef struct TMR_StatusListenerBlock
00284 {
00286   TMR_StatusListener listener;
00288   void *cookie;
00290   struct TMR_StatusListenerBlock *next;
00291 } TMR_StatusListenerBlock;
00292 
00296 typedef struct TMR_Queue_tagReads
00297 {
00298   union
00299   {
00300     /* Buffer to hold serial message response */
00301     uint8_t *sMsg;
00302 #ifdef TMR_ENABLE_LLRP_READER
00303     /* Buffer to hold LLRP message response */
00304     LLRP_tSMessage *lMsg;
00305 #endif
00306   } tagEntry;
00307 
00308   uint8_t bufPointer;
00309   /* Object to hold tag results */
00310   TMR_TagReadData trd;
00311   bool isStatusResponse;
00312   struct TMR_Queue_tagReads  *next;
00313 }TMR_Queue_tagReads;
00314 
00315 typedef TMR_SR_GEN2_QType TMR_GEN2_QType;
00316 typedef TMR_SR_GEN2_QStatic TMR_GEN2_QStatic;
00317 typedef TMR_SR_GEN2_Q TMR_GEN2_Q;
00318 
00346 struct TMR_Reader
00347 {
00350   enum TMR_ReaderType readerType;
00351   bool connected;
00352   TMR_TransportListenerBlock *transportListeners;
00353 
00354   TMR_readParams readParams;
00355   TMR_tagOpParams tagOpParams;
00356   char uri[TMR_MAX_READER_NAME_LENGTH];
00357   
00358   bool continuousReading;
00359   bool trueAsyncflag;
00360   bool searchStatus;
00361   /* Statistics response indicator */
00362   bool isStatusResponse;
00363   /* Option for Fast Search */
00364   bool fastSearch;
00365   /* Option for Trigger Read */
00366   bool triggerRead;
00367   /* Option for Duty cycle*/
00368   bool dutyCycle;
00369   /* Option for stop N tag trigger */
00370   bool isStopNTags;
00371   /* Param wait indicator for Reader and protocol param control during continuous read */
00372   bool paramWait;
00373   /* Param responsefor Reader and protocol param control during continuous read */
00374   uint8_t paramMessage[256];
00375   /* True Continuous Read Start indicator */
00376   bool hasContinuousReadStarted;
00377   /* Total tag count for sto N trigger */
00378   uint32_t numberOfTagsToRead;
00379   /* Does ResetStats feature work on this reader?
00380    * Unknown: NULL == pSupportsResetStats
00381    * Yes: (NULL != pSupportsResetStats) && (true == *pSupportsResetStats)
00382    * No: (NULL != pSupportsResetStats) && (false == *pSupportsResetStats)
00383    */
00384   bool* pSupportsResetStats/* = NULL*/;
00385   bool _storeSupportsResetStats;
00386   /* the option to request for background thread cancel */
00387   bool backgroundThreadCancel;
00388 
00389   union
00390   {
00391     TMR_SR_SerialReader serialReader;
00392     /*
00393      *TMR_RQL_RqlReader rqlReader;
00394      */
00395 #ifdef TMR_ENABLE_LLRP_READER
00396     TMR_LLRP_LlrpReader llrpReader;
00397 #endif
00398   }u;
00399 
00400 #ifdef TMR_ENABLE_BACKGROUND_READS
00401   bool backgroundSetup, backgroundEnabled, backgroundRunning;
00402   bool parserSetup, parserEnabled, parserRunning;
00403 #endif
00404   bool finishedReading;
00405 #ifdef TMR_ENABLE_BACKGROUND_READS
00406   enum TMR_ReadState readState;
00407   unsigned int queue_depth;
00408   sem_t queue_slots, queue_length;
00409   pthread_mutex_t queue_lock;
00410   pthread_mutex_t backgroundLock;
00411   pthread_mutex_t parserLock;
00412   pthread_mutex_t listenerLock;  
00413   pthread_cond_t backgroundCond;
00414   pthread_cond_t parserCond;
00415   pthread_cond_t readCond;
00416   pthread_t backgroundReader;
00417   pthread_t backgroundParser;
00418   pthread_t autonomousBackgroundReader;
00419   TMR_AuthReqListenerBlock *authReqListeners;
00420 #endif
00421   TMR_ReadListenerBlock *readListeners;
00422   TMR_ReadExceptionListenerBlock *readExceptionListeners;
00423   TMR_StatsListenerBlock *statsListeners;
00424 #ifdef TMR_ENABLE_BACKGROUND_READS
00425   TMR_StatusListenerBlock *statusListeners;
00426   TMR_Queue_tagReads *tagQueueTail;
00427   TMR_Queue_tagReads *tagQueueHead;
00428 #endif
00429   TMR_Reader_StatsFlag statsFlag;
00430   TMR_SR_StatusType streamStats;
00431   TMR_TRD_MetadataFlag userMetadataFlag;
00432   uint8_t portmask;
00433 
00434 
00435   /* Level 1 */
00436 #ifndef TMR_ENABLE_SERIAL_READER_ONLY
00437   TMR_Status (*connect)(struct TMR_Reader *reader);
00438   TMR_Status (*destroy)(struct TMR_Reader *reader);
00439   TMR_Status (*read)(struct TMR_Reader *reader, uint32_t timeoutMs, int32_t *tagCount);
00440   TMR_Status (*hasMoreTags)(struct TMR_Reader *reader);
00441   TMR_Status (*getNextTag)(struct TMR_Reader *reader, TMR_TagReadData *read);
00442   TMR_Status (*writeTag)(struct TMR_Reader *reader, const TMR_TagFilter *filter, const TMR_TagData *data);
00443 #endif /* TMR_ENABLE_SERIAL_READER_ONLY  */
00444   TMR_Status (*paramGet)(struct TMR_Reader *reader, TMR_Param key, void *value);
00445   TMR_Status (*paramSet)(struct TMR_Reader *reader, TMR_Param key, const void *value);
00446   
00447   /* Level 2 */
00448 #ifndef TMR_ENABLE_SERIAL_READER_ONLY
00449   TMR_Status (*killTag)(struct TMR_Reader *reader, const TMR_TagFilter *filter, const TMR_TagAuthentication *auth);
00450   TMR_Status (*lockTag)(struct TMR_Reader *reader, const TMR_TagFilter *filter, TMR_TagLockAction *action);
00451   TMR_Status (*executeTagOp)(struct TMR_Reader *reader, TMR_TagOp *tagop, TMR_TagFilter *filter, TMR_uint8List *data);
00452   TMR_Status (*readTagMemBytes)(struct TMR_Reader *reader, const TMR_TagFilter *filter, 
00453                                uint32_t bank, uint32_t address,
00454                                uint16_t count, uint8_t data[]);
00455   TMR_Status (*readTagMemWords)(struct TMR_Reader *reader, const TMR_TagFilter *filter,
00456                                uint32_t bank, uint32_t address,
00457                                uint16_t count, uint16_t *data);
00458   TMR_Status (*writeTagMemBytes)(struct TMR_Reader *reader, const TMR_TagFilter *filter,
00459                                uint32_t bank, uint32_t address,
00460                                uint16_t count, const uint8_t data[]);
00461   TMR_Status (*writeTagMemWords)(struct TMR_Reader *reader, const TMR_TagFilter *filter,
00462                                uint32_t bank, uint32_t address,
00463                                uint16_t count, const uint16_t data[]);
00464   TMR_Status (*gpoSet)(struct TMR_Reader *reader, uint8_t count, const TMR_GpioPin state[]);
00465   TMR_Status (*gpiGet)(struct TMR_Reader *reader, uint8_t *count, TMR_GpioPin state[]);
00466   TMR_Status (*firmwareLoad)(TMR_Reader *reader, void *cookie, TMR_FirmwareDataProvider provider);
00467   TMR_Status (*modifyFlash) (TMR_Reader *reader, uint8_t sector, uint32_t address, uint32_t password,
00468                              uint8_t length, const uint8_t data[], uint32_t offset);
00469   TMR_Status (*reboot) (TMR_Reader *reader);
00470 #endif /* TMR_ENABLE_SERIAL_READER_ONLY  */
00471 
00472   /* Level 3 */
00473 #ifdef TMR_ENABLE_BACKGROUND_READS
00474   TMR_Status (*cmdAutonomousReading)(struct TMR_Reader *reader, TMR_TagReadData *trd, TMR_Reader_StatsValues *stats);
00475 #endif
00476   TMR_Status (*cmdStopReading)(struct TMR_Reader *reader);
00477 };
00478 
00503 TMR_Status TMR_create(TMR_Reader *reader, const char* deviceUri);
00504 
00520 TMR_Status TMR_create_alloc(TMR_Reader **readerPointer, const char* deviceUri);
00521 
00522 
00536 TMR_Status TMR_connect(struct TMR_Reader *reader);
00537 
00551 TMR_Status TMR_destroy(TMR_Reader *reader);
00552 
00568 TMR_Status TMR_read(TMR_Reader *reader, uint32_t timeoutMs, int32_t *tagCount);
00569 
00586 TMR_Status TMR_hasMoreTags(TMR_Reader *reader);
00587 
00603 TMR_Status TMR_getNextTag(TMR_Reader *reader, TMR_TagReadData *tagData);
00604 
00620 TMR_Status TMR_executeTagOp(struct TMR_Reader *reader, TMR_TagOp *tagop, TMR_TagFilter *filter, TMR_uint8List *data);
00621 
00640 TMR_Status TMR_readIntoArray(struct TMR_Reader *reader, uint32_t timeoutMs, int32_t *tagCount, TMR_TagReadData *result[]);
00641 
00662 TMR_Status TMR_writeTag(TMR_Reader *reader, const TMR_TagFilter *target, TMR_TagData *data);
00663 
00675 TMR_Status TMR_killTag(TMR_Reader *reader, TMR_TagFilter *target, TMR_TagAuthentication *auth);
00676 
00677 
00689 TMR_Status TMR_lockTag(TMR_Reader *reader, TMR_TagFilter *target, TMR_TagLockAction *action);
00690 
00691 
00703 TMR_Status TMR_readTagMemBytes(TMR_Reader *reader, TMR_TagFilter *target, 
00704                                uint32_t bank, uint32_t byteAddress, 
00705                                uint16_t byteCount, uint8_t data[]);
00706 
00718 TMR_Status TMR_readTagMemWords(TMR_Reader *reader, TMR_TagFilter *target, 
00719                                uint32_t bank, uint32_t wordAddress, 
00720                                uint16_t wordCount, uint16_t data[]);
00721 
00736 TMR_Status TMR_writeTagMemBytes(TMR_Reader *reader, TMR_TagFilter *target,
00737                                 uint32_t bank, uint32_t byteAddress,
00738                                 uint16_t byteCount, const uint8_t data[]);
00739 
00754 TMR_Status TMR_writeTagMemWords(TMR_Reader *reader, TMR_TagFilter *target,
00755                                 uint32_t bank, uint32_t wordAddress,
00756                                 uint16_t wordCount, const uint16_t data[]);
00757 
00758 
00767 TMR_Status TMR_gpoSet(TMR_Reader *reader, uint8_t count, const TMR_GpioPin state[]);
00768 
00778 TMR_Status TMR_gpiGet(TMR_Reader *reader, uint8_t *count, TMR_GpioPin state[]);
00779 
00789 TMR_Status TMR_firmwareLoad(TMR_Reader *reader, void *cookie, TMR_FirmwareDataProvider provider);
00790 
00794 typedef struct TMR_memoryCookie {
00796   uint8_t *firmwareStart;
00798   uint32_t firmwareSize;
00799 } TMR_memoryCookie;
00800 
00813 bool TMR_memoryProvider(void *cookie, uint16_t *size, uint8_t *data);
00814 
00825 bool TMR_fileProvider(void *cookie, uint16_t *size, uint8_t *data);
00826 
00840 TMR_Status TMR_paramSet(struct TMR_Reader *reader, TMR_Param key, const void *value);
00841 
00862 TMR_Status TMR_paramGet(struct TMR_Reader *reader, TMR_Param key, void *value);
00863 
00870 TMR_Status TMR_reboot(struct TMR_Reader *reader);
00871 
00971 TMR_Status TMR_paramList(struct TMR_Reader *reader, TMR_Param *keys, uint32_t *len);
00976 void TMR_paramProbe (struct TMR_Reader *reader, TMR_Param key);
00977 
00986 const char* TMR_paramName(TMR_Param key);
00987 
00997 TMR_Param TMR_paramID(const char *name);
00998 
00999 
01011 TMR_Status TMR_addTransportListener(TMR_Reader *reader, TMR_TransportListenerBlock *block);
01012 
01013 
01025 TMR_Status TMR_removeTransportListener(TMR_Reader *reader, TMR_TransportListenerBlock *block);
01026 
01037 TMR_Status TMR_addReadListener(struct TMR_Reader *reader,
01038                                TMR_ReadListenerBlock *block);
01039 
01050 TMR_Status TMR_addAuthReqListener(struct TMR_Reader *reader,
01051                                   TMR_AuthReqListenerBlock *block);
01052 
01063 TMR_Status TMR_removeReadListener(struct TMR_Reader *reader,
01064                                   TMR_ReadListenerBlock *block);
01065 
01076 TMR_Status TMR_addReadExceptionListener(struct TMR_Reader *reader,
01077                                         TMR_ReadExceptionListenerBlock *block);
01078 
01089 TMR_Status TMR_removeReadExceptionListener(struct TMR_Reader *reader,
01090                                            TMR_ReadExceptionListenerBlock *block);
01091 
01102 TMR_Status TMR_addStatusListener(struct TMR_Reader *reader,
01103                                TMR_StatusListenerBlock *block);
01104 
01115 TMR_Status TMR_removeStatusListener(struct TMR_Reader *reader,
01116                                   TMR_StatusListenerBlock *block);
01117 
01118 
01129 TMR_Status TMR_addStatsListener(struct TMR_Reader *reader,
01130                                TMR_StatsListenerBlock *block);
01131 
01142 TMR_Status TMR_removeStatsListener(struct TMR_Reader *reader,
01143                                   TMR_StatsListenerBlock *block);
01144 
01145 
01157 TMR_Status TMR_startReading(struct TMR_Reader *reader);
01158 TMR_Status TMR_receiveAutonomousReading(struct TMR_Reader *reader, TMR_TagReadData *trd, TMR_Reader_StatsValues *stats);
01166 TMR_Status TMR_stopReading(struct TMR_Reader *reader);
01167 
01175 TMR_Status TMR_setSerialTransport(char* scheme, TMR_TransportNativeInit nativeInit);
01176 
01184 const char *TMR_strerr(TMR_Reader *reader, TMR_Status status);
01185 
01191 TMR_Status TMR_STATS_init(TMR_Reader_StatsValues *stats);
01192 
01200 TMR_Status TMR_loadConfig(struct TMR_Reader *reader, char *filePath);
01201 
01209 TMR_Status TMR_saveConfig(struct TMR_Reader *reader, char *filePath);
01210 
01211 #ifndef DOXYGEN_IGNORE
01212 
01213 TMR_Status TMR_reader_init_internal(struct TMR_Reader *reader);
01214 /*TMR_Status TMR_init_statusListenerBlock(TMR_StatusListenerBlock *slb, TMR_StatusListener listener,
01215                                         void *cookie, TMR_SR_StatusContentFlags statusFlags);*/
01216 TMR_Status validateReadPlan(TMR_Reader *reader, TMR_ReadPlan *plan, TMR_AntennaMapList *txRxMap, uint32_t protocols);
01217 
01218 void TMR__notifyTransportListeners(TMR_Reader *reader, bool tx, 
01219                                    uint32_t dataLen, uint8_t *data,
01220                                    int timeout);
01221 
01222 void notify_exception_listeners(TMR_Reader *reader, TMR_Status status);
01223 void cleanup_background_threads(TMR_Reader *reader);
01224 
01225 #ifdef TMR_ENABLE_SERIAL_READER_ONLY
01226 
01227 #define TMR_connect(reader) (TMR_SR_connect(reader))
01228 #define TMR_destroy(reader) (TMR_SR_destroy(reader))
01229 #define TMR_read(reader, timeoutMs, tagCount) (TMR_SR_read((reader),(timeoutMs),(tagCount)))
01230 #define TMR_hasMoreTags(reader) (TMR_SR_hasMoreTags(reader))
01231 #define TMR_getNextTag(reader, read) (TMR_SR_getNextTag((reader),(read)))
01232 #define TMR_writeTag(reader, filter, data) (TMR_SR_writeTag((reader),(filter),(data)))
01233 #define TMR_readTagMemWords(reader, target, bank, address, count, data) (TMR_SR_readTagMemWords((reader),(target),(bank),(address),(count),(data)))
01234 #define TMR_readTagMemBytes(reader, target, bank, address, count, data) (TMR_SR_readTagMemBytes((reader),(target),(bank),(address),(count),(data)))
01235 #define TMR_writeTagMemWords(reader, target, bank, address, count, data) (TMR_SR_writeTagMemWords((reader),(target),(bank),(address),(count),(data)))
01236 #define TMR_writeTagMemBytes(reader, target, bank, address, count, data) (TMR_SR_writeTagMemBytes((reader),(target),(bank),(address),(count),(data)))
01237 #define TMR_killTag(reader, filter, auth) (TMR_SR_killTag((reader),(filter),(auth)))
01238 #define TMR_lockTag(reader, filter, action) (TMR_SR_lockTag((reader),(filter),(action)))
01239 #define TMR_executeTagOp(reader, tagop, filter, data) (TMR_SR_executeTagOp((reader), (tagop), (filter), (data)))
01240 #define TMR_gpoSet(reader, count, state) (TMR_SR_gpoSet((reader),(count),(state)))
01241 #define TMR_gpiGet(reader, count, state) (TMR_SR_gpiGet((reader),(count),(state)))
01242 #define TMR_firmwareLoad(reader, cookie, provider) (TMR_SR_firmwareLoad((reader),(cookie),(provider)))
01243 #define TMR_reboot(reader) (TMR_SR_reboot((reader)))
01244 
01245 #else
01246 
01251 #define TMR_connect(reader) ((reader)->connect(reader))
01252 #define TMR_destroy(reader) ((reader)->destroy(reader))
01253 #define TMR_read(reader, timeoutMs, tagCount) ((reader)->read((reader),(timeoutMs),(tagCount)))
01254 #define TMR_hasMoreTags(reader) ((reader)->hasMoreTags(reader))
01255 #define TMR_getNextTag(reader, read) ((reader)->getNextTag((reader),(read)))
01256 #define TMR_writeTag(reader, filter, data) ((reader)->writeTag((reader),(filter),(data)))
01257 #define TMR_readTagMemWords(reader, target, bank, address, count, data) ((reader)->readTagMemWords((reader),(target),(bank),(address),(count),(data)))
01258 #define TMR_readTagMemBytes(reader, target, bank, address, count, data) ((reader)->readTagMemBytes((reader),(target),(bank),(address),(count),(data)))
01259 #define TMR_writeTagMemWords(reader, target, bank, address, count, data) ((reader)->writeTagMemWords((reader),(target),(bank),(address),(count),(data)))
01260 #define TMR_writeTagMemBytes(reader, target, bank, address, count, data) ((reader)->writeTagMemBytes((reader),(target),(bank),(address),(count),(data)))
01261 #define TMR_killTag(reader, filter, auth) ((reader)->killTag((reader),(filter),(auth)))
01262 #define TMR_lockTag(reader, filter, action) ((reader)->lockTag((reader),(filter),(action)))
01263 #define TMR_executeTagOp(reader, tagop, filter, data) ((reader)->executeTagOp((reader), (tagop), (filter), (data)))
01264 #define TMR_gpoSet(reader, count, state) ((reader)->gpoSet((reader),(count),(state)))
01265 #define TMR_gpiGet(reader, count, state) ((reader)->gpiGet((reader),(count),(state)))
01266 #define TMR_firmwareLoad(reader, cookie, provider) ((reader)->firmwareLoad((reader),(cookie),(provider)))
01267 #define TMR_modifyFlash(reader, sector, address, password, length, data, offset)  ((reader->modifyFlash((reader),(sector),(address),(password),(length),(data),(offset)))
01268 #define TMR_reboot(reader) ((reader)->reboot(reader))
01269 #endif /* TMR_ENABLE_SERIAL_READER_ONLY  */
01270 
01271 #endif /* DOXYGEN_IGNORE */
01272 
01273 #ifdef  __cplusplus
01274 }
01275 #endif
01276 
01277 #endif /* _TM_READER_H_ */


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