llrp_reader_imp.h
Go to the documentation of this file.
00001 #ifndef _LLRP_READER_IMP_H
00002 #define _LLRP_READER_IMP_H
00003 
00011 /*
00012  * Copyright (c) 2011 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 <time.h>
00034 #include "tm_reader.h"
00035 #include "tmr_status.h"
00036 #include "ltkc.h"
00037 
00038 #ifdef  __cplusplus
00039 extern "C" {
00040 #endif
00041 
00046 #define TMR_POWER_CYCLE_MAGIC_NUMBER 0x20000920  
00047 
00051 #define TMR_LLRP_C1G2READOPSPECRESULT 349
00052 #define TMR_LLRP_C1G2WRITEOPSPECRESULT 350
00053 #define TMR_LLRP_C1G2KILLOPSPECRESULT 351
00054 #define TMR_LLRP_C1G2LOCKOPSPECRESULT 352
00055 #define TMR_LLRP_C1G2BLOCKERASEOPSPECRESULT 353
00056 #define TMR_LLRP_C1G2BLOCKWRITEOPSPECRESULT 354
00057 #define TMR_LLRP_CUSTOM_BLOCKPERMALOCKOPSPECRESULT 22
00058 #define TMR_LLRP_CUSTOM_HIGGS2PARTIALLOADIMAGEOPSPECRESULT 24
00059 #define TMR_LLRP_CUSTOM_HIGGS2FULLLOADIMAGEOPSPECRESULT 26
00060 #define TMR_LLRP_CUSTOM_HIGGS3FASTLOADIMAGEOPSPECRESULT 28
00061 #define TMR_LLRP_CUSTOM_HIGGS3LOADIMAGEOPSPECRESULT 30
00062 #define TMR_LLRP_CUSTOM_HIGGS3BLOCKREADLOCKOPSPECRESULT 32
00063 #define TMR_LLRP_CUSTOM_G2ISETREADPROTECTOPSPECRESULT 34                               
00064 #define TMR_LLRP_CUSTOM_G2XSETREADPROTECTOPSPECRESULT 36                               
00065 #define TMR_LLRP_CUSTOM_G2IRESETREADPROTECTOPSPECRESULT 38                             
00066 #define TMR_LLRP_CUSTOM_G2XRESETREADPROTECTOPSPECRESULT 40                             
00067 #define TMR_LLRP_CUSTOM_G2ICHANGEEASOPSPECRESULT 42                                    
00068 #define TMR_LLRP_CUSTOM_G2XCHANGEEASOPSPECRESULT 44                                    
00069 #define TMR_LLRP_CUSTOM_G2IEASALARMOPSPECRESULT 46                                     
00070 #define TMR_LLRP_CUSTOM_G2XEASALARMOPSPECRESULT 48                                     
00071 #define TMR_LLRP_CUSTOM_G2ICALIBRATEOPSPECRESULT 50                                    
00072 #define TMR_LLRP_CUSTOM_G2XCALIBRATEOPSPECRESULT 52                                    
00073 #define TMR_LLRP_CUSTOM_G2ICHANGECONFIGOPSPECRESULT 54                                 
00074 #define TMR_LLRP_CUSTOM_MONZA4QTREADWRITEOPSPECRESULT 57
00075 #define TMR_LLRP_CUSTOM_IDS_SETSFEPARAMETERSOPSPECRESULT 99
00076 #define TMR_LLRP_CUSTOM_IDS_GETMEASUREMENTSETUPOPSPECRESULT 93
00077 #define TMR_LLRP_CUSTOM_IDS_GETBATTERYLEVELOPSPECRESULT 103
00078 #define TMR_LLRP_CUSTOM_IDS_SETLOGLIMITSOPSPECRESULT 116
00079 #define TMR_LLRP_CUSTOM_IDS_SETSHELFLIFEOPSPECRESULT 124
00080 #define TMR_LLRP_CUSTOM_IDS_SETPASSWORDOPSPECRESULT 118
00081 #define TMR_LLRP_CUSTOM_WRITETAGOPSPECRESULT  61
00082 #define TMR_LLRP_CUSTOM_IDS_GETSENSORVALUEOPSPECRESULT 77
00083 #define TMR_LLRP_CUSTOM_IDS_SETLOGMODEOPSPECRESULT 85
00084 #define TMR_LLRP_CUSTOM_IDS_STARTLOGMODEOPSPECRESULT 87
00085 #define TMR_LLRP_CUSTOM_IDS_GETLOGSTATEOPSPECRESULT 79
00086 #define TMR_LLRP_CUSTOM_IDS_ENDLOGOPSPECRESULT 89
00087 #define TMR_LLRP_CUSTOM_IDS_INITIALIZEOPSPECRESULT 91
00088 #define TMR_LLRP_CUSTOM_IDS_ACCESSFIFOSTATUSOPSPECRESULT 101
00089 #define TMR_LLRP_CUSTOM_IDS_ACCESSFIFOWRITEOPSPECRESULT 114
00090 #define TMR_LLRP_CUSTOM_IDS_ACCESSFIFOREADOPSPECRESULT 112
00091 #define TMR_LLRP_CUSTOM_IDS_GETCALIBRATIONDATAOPSPECRESULT 95
00092 #define TMR_LLRP_CUSTOM_IDS_SETCALIBRATIONDATAOPSPECRESULT 97
00093 #define TMR_LLRP_CUSTOM_DENATRAN_IAV_ACTIVATESECUREMODEOPSPECRESULT 127
00094 #define TMR_LLRP_CUSTOM_DENATRAN_IAV_AUTHENTICATEOBUOPSPECRESULT 129
00095 #define TMR_LLRP_CUSTOM_DENATRAN_IAV_ACTIVATESINIAVMODEOPSPECRESULT 131
00096 #define TMR_LLRP_CUSTOM_DENATRAN_IAV_AUTHENTICATEIDOPSPECRESULT 133
00097 #define TMR_LLRP_CUSTOM_DENATRAN_IAV_AUTHENTICATEFULLPASS1OPSPECRESULT 135
00098 #define TMR_LLRP_CUSTOM_DENATRAN_IAV_AUTHENTICATEFULLPASS2OPSPECRESULT 137
00099 #define TMR_LLRP_CUSTOM_DENATRAN_IAV_OBUREADFROMMEMMAPOPSPECRESULT 139
00100 #define TMR_LLRP_CUSTOM_DENATRAN_IAV_OBUWRITETOMEMMAPOPSPECRESULT 141
00101 
00102 #ifdef TMR_ENABLE_ISO180006B
00103 #define TMR_LLRP_CUSTOM_ISO_READDATAOPSPECRESULT  65
00104 #define TMR_LLRP_CUSTOM_ISO_WRITEDATAOPSPECRESULT 68
00105 #define TMR_LLRP_CUSTOM_ISO_LOCKOPSPECRESULT 70
00106 #endif /* TMR_ENABLE_ISO180006B */
00107 
00111 #define TMR_LLRP_MAX_ROSPECS 32
00112 
00115 #define TMR_LLRP_STOP_TIMEOUT 5000
00116 
00120 typedef struct TMR_LLRP_PortDetect
00121 {
00123   uint16_t port;
00125   bool connected;
00127   int16_t gain;
00128 }TMR_LLRP_PortDetect;
00129 
00133 typedef struct TMR_LLRP_TMDeDuplication
00134 {
00136   llrp_u1_t highestRSSI;
00137 
00139   llrp_u1_t uniquebyAntenna;
00140 
00142   llrp_u1_t uniquebyData;
00143 }TMR_LLRP_TMDeDuplication;
00144   
00148 typedef struct TMR_LLRP_TMReaderConfiguration
00149 {
00151   llrp_utf8v_t description;
00153   llrp_utf8v_t role;
00155   llrp_utf8v_t hostName;
00156 } TMR_LLRP_TMReaderConfiguration;
00157 
00161 # define  TMR_LLRP_MODEL_M6  0x06
00162 # define  TMR_LLRP_MODEL_ASTRA_EX 0x30
00163 # define  TMR_LLRP_MODEL_SARGAS 0x3430
00164 
00165 TMR_Status TMR_LLRP_notifyTransportListener(TMR_Reader *reader, LLRP_tSMessage *pMsg, bool tx, int timeout);
00166 TMR_Status TMR_LLRP_sendMessage(TMR_Reader *reader, LLRP_tSMessage *pMsg, int timeoutMs);
00167 TMR_Status TMR_LLRP_receiveMessage(TMR_Reader *reader, LLRP_tSMessage **pMsg, int timeoutMs);
00168 TMR_Status TMR_LLRP_sendTimeout(TMR_Reader *reader, LLRP_tSMessage *pMsg, LLRP_tSMessage **pRsp, int timeoutMs);
00169 TMR_Status TMR_LLRP_send(TMR_Reader *reader, LLRP_tSMessage *pMsg, LLRP_tSMessage **pRsp);
00170 void TMR_LLRP_freeMessage(LLRP_tSMessage *pMsg);
00171 TMR_Status TMR_LLRP_checkLLRPStatus(LLRP_tSLLRPStatus *pLLRPStatus);
00172 
00173 TMR_Status TMR_LLRP_cmdGetRegion(TMR_Reader *reader, TMR_Region *region);
00174 TMR_Status TMR_LLRP_cmdAntennaDetect(TMR_Reader *reader, uint8_t *count, TMR_LLRP_PortDetect *ports);
00175 TMR_Status TMR_LLRP_cmdGetTMAsyncOffTime(TMR_Reader *reader, uint32_t *offtime);
00176 
00177 TMR_Status TMR_LLRP_cmdGetGPIState(TMR_Reader *reader, uint8_t *count, TMR_GpioPin state[]);
00178 TMR_Status TMR_LLRP_cmdSetGPOState(TMR_Reader *reader, uint8_t count, const TMR_GpioPin state[]);
00179 
00180 TMR_Status TMR_LLRP_cmdGetReaderCapabilities(TMR_Reader *reader, TMR_LLRP_ReaderCapabilities *capabilities);
00181 
00182 TMR_Status TMR_LLRP_cmdGetReadTransmitPowerList(TMR_Reader *reader, TMR_PortValueList *pPortValueList);
00183 TMR_Status TMR_LLRP_cmdSetReadTransmitPowerList(TMR_Reader *reader, TMR_PortValueList *pPortValueList);
00184 
00185 TMR_Status TMR_LLRP_cmdGetWriteTransmitPowerList(TMR_Reader *reader, TMR_PortValueList *pPortValueList);
00186 TMR_Status TMR_LLRP_cmdSetWriteTransmitPowerList(TMR_Reader *reader, TMR_PortValueList *pPortValueList);
00187 TMR_Status TMR_LLRP_cmdGetTMDeviceInformationCapabilities(TMR_Reader *reader, int param, TMR_String  *version);
00188 TMR_Status TMR_LLRP_cmdGetActiveRFControl(TMR_Reader *reader, TMR_LLRP_RFControl *rfControl);
00189 TMR_Status TMR_LLRP_cmdSetActiveRFControl(TMR_Reader *reader, TMR_LLRP_RFControl *rfControl);
00190 TMR_Status TMR_LLRP_cmdGetGen2Session(TMR_Reader *reader, TMR_GEN2_Session  *session);
00191 TMR_Status TMR_LLRP_cmdSetGen2Session(TMR_Reader *reader, TMR_GEN2_Session  *session);
00192 TMR_Status TMR_LLRP_cmdSetTMAsyncOffTime(TMR_Reader *reader, uint32_t offtime);
00193 
00194 /*ThingMagic Licensed Features*/
00195 TMR_Status TMR_LLRP_cmdGetLicensedFeatures(TMR_Reader *reader, TMR_uint8List  *features);
00196 
00197 /* ThingMagic DeDuplication */
00198 TMR_Status TMR_LLRP_cmdGetThingMagicDeDuplication(TMR_Reader *reader, TMR_LLRP_TMDeDuplication *duplication);
00199 TMR_Status TMR_LLRP_cmdSetThingMagicDeDuplication(TMR_Reader *reader, TMR_LLRP_TMDeDuplication *duplication);
00200 
00201 /* Thingmagic Reader configuration */
00202 TMR_Status TMR_LLRP_cmdGetThingmagicReaderConfiguration(TMR_Reader *reader, TMR_LLRP_TMReaderConfiguration *config);
00203 TMR_Status TMR_LLRP_cmdSetThingmagicReaderConfiguration(TMR_Reader *reader, TMR_LLRP_TMReaderConfiguration *config);
00204 void TMR_LLRP_freeTMReaderConfiguration(TMR_LLRP_TMReaderConfiguration *config);
00205 
00206 /* Thingmagic Current Time */
00207 TMR_Status TMR_LLRP_cmdGetThingMagicCurrentTime(TMR_Reader *reader, struct tm *curTime);
00208 
00209 /* Thingmagic Reader Module Temperature */
00210 TMR_Status TMR_LLRP_cmdGetThingMagicReaderModuleTemperature(TMR_Reader *reader, uint8_t *temp);
00211 
00212 /* Thingmagic protocol configuration: Gen2 Q */
00213 TMR_Status TMR_LLRP_cmdSetGen2Q(TMR_Reader *reader, TMR_GEN2_Q *q);
00214 TMR_Status TMR_LLRP_cmdGetGen2Q(TMR_Reader *reader, TMR_GEN2_Q *q);
00215 
00216 /* Thingmagic Protocol configuration:Gen2 Target */
00217 TMR_Status TMR_LLRP_cmdSetGen2Target(TMR_Reader *reader, TMR_GEN2_Target *target);
00218 TMR_Status TMR_LLRP_cmdGetGen2Target(TMR_Reader *reader, TMR_GEN2_Target *target);
00219 
00220 /* Thingmagic LicenseKey */
00221 TMR_Status TMR_LLRP_cmdSetTMLicenseKey(TMR_Reader *reader, TMR_uint8List *license);
00222 
00223 /* Thingmagic ISO 18K6B Delimiter */
00224 TMR_Status TMR_LLRP_cmdSetISO18K6BDelimiter(TMR_Reader *reader, TMR_ISO180006B_Delimiter *delimiter);
00225 TMR_Status TMR_LLRP_cmdGetISO18K6BDelimiter(TMR_Reader *reader, TMR_ISO180006B_Delimiter *delimiter);
00226 
00227 /* Thingmagic ISO 18K6B Modulation Depth */
00228 TMR_Status TMR_LLRP_cmdSetISO18K6BModDepth(TMR_Reader *reader, TMR_ISO180006B_ModulationDepth *modDepth);
00229 TMR_Status TMR_LLRP_cmdGetISO18K6BModDepth(TMR_Reader *reader, TMR_ISO180006B_ModulationDepth *modDepth);
00230 
00231 /* Thingmagic ISO 1806B Link Frequency */
00232 TMR_Status TMR_LLRP_cmdSetISO18K6BLinkFrequency(TMR_Reader *reader, TMR_ISO180006B_LinkFrequency *linkFreq);
00233 TMR_Status TMR_LLRP_cmdGetISO18K6BLinkFrequency(TMR_Reader *reader, TMR_ISO180006B_LinkFrequency *linkFreq);
00234 
00235 /* Thingmagic Device Protocol Capabilities */
00236 TMR_Status TMR_LLRP_cmdGetTMDeviceProtocolCapabilities(TMR_Reader *reader, TMR_TagProtocolList * protocol);
00237 
00238 /* Thingmagic Device Antenna Detection */
00239 TMR_Status TMR_LLRP_cmdGetThingMagicAntennaDetection(TMR_Reader *reader, bool *antennaport);
00240 TMR_Status TMR_LLRP_cmdSetThingMagicAntennaDetection(TMR_Reader *reader, bool *antennaport);
00241 
00242 /* Read  */
00243 TMR_Status TMR_LLRP_cmdPrepareROSpec(TMR_Reader *reader, uint16_t timeout, TMR_uint8List *antennaList,
00244             const TMR_TagFilter *filter, TMR_TagProtocol protocol);
00245 TMR_Status TMR_LLRP_cmdAddROSpec(TMR_Reader *reader, uint16_t readDuration, TMR_uint8List *antennaList,
00246                                   const TMR_TagFilter *filter, TMR_TagProtocol protocol);
00247 TMR_Status TMR_LLRP_cmdEnableROSpec(TMR_Reader *reader);
00248 TMR_Status TMR_LLRP_cmdDisableROSpec(TMR_Reader *reader);
00249 TMR_Status TMR_LLRP_cmdStartROSpec(TMR_Reader *reader, llrp_u32_t roSpecId);
00250 TMR_Status TMR_LLRP_cmdStopROSpec(TMR_Reader *reader, bool receiveResponse);
00251 TMR_Status TMR_LLRP_cmdDeleteAllROSpecs(TMR_Reader *reader, bool receiveResponse);
00252 TMR_Status TMR_LLRP_parseMetadataFromMessage(TMR_Reader *reader, TMR_TagReadData *data, LLRP_tSTagReportData *msg);
00253 TMR_Status TMR_LLRP_verifyReadOperation(TMR_Reader *reader, int32_t *tagCount);
00254 TMR_Status TMR_LLRP_cmdStopReading(struct TMR_Reader *reader);
00255 
00256 TMR_Status TMR_LLRP_cmdGetVersionSerial(TMR_Reader *reader, TMR_String *version);
00257 TMR_Status TMR_LLRP_cmdrebootReader(TMR_Reader *reader);
00258 
00259 /* Reset Reader */
00260 TMR_Status TMR_LLRP_stopActiveROSpecs(TMR_Reader *reader);
00261 
00262 /* Reports, Notifications and Keepalives */
00263 TMR_Status TMR_LLRP_setKeepAlive(TMR_Reader *reader);
00264 TMR_Status TMR_LLRP_enableEventsAndReports(TMR_Reader *reader);
00265 TMR_Status TMR_LLRP_setHoldEventsAndReportsStatus(TMR_Reader *reader, llrp_u1_t status);
00266 TMR_Status TMR_LLRP_handleKeepAlive(TMR_Reader *reader, LLRP_tSMessage *pMsg);
00267 TMR_Status TMR_LLRP_startBackgroundReceiver(TMR_Reader *reader);
00268 TMR_Status TMR_LLRP_cmdSetEventNotificationSpec(TMR_Reader *reader, bool state);
00269 TMR_Status TMR_LLRP_handleReaderEvents(TMR_Reader *reader, LLRP_tSMessage *pMsg);
00270 TMR_Status TMR_LLRP_processReceivedMessage(TMR_Reader *reader, LLRP_tSMessage *pMsg);
00271 void TMR_LLRP_setBackgroundReceiverState(TMR_Reader *reader, bool state);
00272 
00273 /* Access Spec */
00274 TMR_Status TMR_LLRP_cmdEnableAccessSpec(TMR_Reader *reader, llrp_u32_t accessSpecId);
00275 TMR_Status TMR_LLRP_msgPrepareAccessCommand(TMR_Reader *reader, LLRP_tSAccessCommand *pAccessCommand,
00276                                                               TMR_TagFilter *filter, TMR_TagOp *tagop);
00277 TMR_Status TMR_LLRP_cmdAddAccessSpec(TMR_Reader *reader, TMR_TagProtocol protocol, TMR_TagFilter *filter,
00278                                             llrp_u32_t roSpecId, TMR_TagOp *tagop, bool isStandalone);
00279 TMR_Status TMR_LLRP_verifyOpSpecResultStatus(TMR_Reader *reader, LLRP_tSParameter *pParameter);
00280 TMR_Status TMR_LLRP_cmdDeleteAllAccessSpecs(TMR_Reader *reader);
00281 
00282 TMR_Status TMR_LLRP_parseCustomTagOpSpecResultType(LLRP_tEThingMagicCustomTagOpSpecResultType status);
00283 void TMR_LLRP_parseTagOpSpecData(LLRP_tSParameter *pParameter, TMR_uint8List *data);
00284 
00285 TMR_Status TMR_LLRP_cmdGetReport(TMR_Reader *reader);
00286 #ifdef __cplusplus
00287 }
00288 #endif
00289 
00290 #endif /* _LLRP_READER_IMP_H */


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