LTKCPP-- LLRP Toolkit C Plus Plus Library
docsample5.cpp
Go to the documentation of this file.
1 
2 /*
3  *****************************************************************************
4  * *
5  * IMPINJ CONFIDENTIAL AND PROPRIETARY *
6  * *
7  * This source code is the sole property of Impinj, Inc. Reproduction or *
8  * utilization of this source code in whole or in part is forbidden without *
9  * the prior written consent of Impinj, Inc. *
10  * *
11  * (c) Copyright Impinj, Inc. 2007,2010. All rights reserved. *
12  * *
13  *****************************************************************************/
14 
48 #include <stdio.h>
49 #include "ltkcpp.h"
50 #include "impinj_ltkcpp.h"
51 #include "time.h"
52 
53 using namespace LLRP;
54 
55 /*
56 ** Sorry, we use this linux safe method
57 ** to print buffers. WIndows has the same
58 ** method, but by a different name
59 */
60 #if (WIN32)
61 #define snprintf _snprintf
62 #endif
63 
64 class CMyApplication
65 {
66 private:
67 
68  unsigned int m_PowerLevelIndex;
69  unsigned int m_messageID;
70 
71  public:
72  /* Store the command line parsing here */
73  /* Verbose level, incremented by each -v on command line */
74  int m_Verbose;
75  unsigned int m_password;
76  unsigned short int m_qtmode;
77  unsigned short int m_tid;
78  EImpinjQTAccessRange m_shortRange;
79  unsigned int m_newPassword;
80 
82  CConnection * m_pConnectionToReader;
83 
84  inline
85  CMyApplication (void)
86  : m_Verbose(0), m_pConnectionToReader(NULL)
87  {
88  m_messageID = 0;
90  m_password = 0;
91  m_qtmode = 0;
92  m_tid = 0;
93  m_Verbose = 0;
94  }
95 
96  int
97  run (
98  char * pReaderHostName);
99 
100  int
101  checkConnectionStatus (void);
102 
103  int
104  enableImpinjExtensions (void);
105 
106  int
107  resetConfigurationToFactoryDefaults (void);
108 
109  int
110  getReaderCapabilities(void);
111 
112  int
113  setImpinjReaderConfig(void);
114 
115  int
116  addROSpec (void);
117 
118  int
119  enableROSpec (void);
120 
121  int
122  startROSpec (void);
123 
124  int
125  stopROSpec (void);
126 
127  int
128  addAccessSpec(void);
129 
130  int
131  enableAccessSpec(void);
132 
133  int
134  awaitAndPrintReport (int timeoutSec);
135 
136  void
137  printTagReportData (
138  CRO_ACCESS_REPORT * pRO_ACCESS_REPORT);
139 
140  void
141  printOneTagReportData (
142  CTagReportData * pTagReportData);
143 
144  int
145  formatOneEPC (
146  CParameter *pEPCParameter,
147  char * buf,
148  int buflen,
149  char * startStr);
150 
151  int
152  formatOneWriteResult (
153  CParameter * pWriteResilt,
154  char * buf,
155  int buflen,
156  char * startStr);
157  int
158  formatOneSetQTConfigResult (
159  CParameter * pQTResilt,
160  char * buf,
161  int buflen,
162  char * startStr);
163 
164  int
165  formatOneGetQTConfigResult (
166  CParameter * pQTResilt,
167  char * buf,
168  int buflen,
169  char * startStr);
170 
171  int
172  formatOneSerializedTID (
173  CParameter * pTID,
174  char * buf,
175  int buflen,
176  char * startStr);
177 
178  int
179  formatOneReadResult (
180  CParameter * pReadResult,
181  char * buf,
182  int buflen,
183  char * startStr);
184 
185  void
186  handleReaderEventNotification (
187  CReaderEventNotificationData *pNtfData);
188 
189  void
190  handleAntennaEvent (
191  CAntennaEvent * pAntennaEvent);
192 
193  void
194  handleReaderExceptionEvent (
195  CReaderExceptionEvent * pReaderExceptionEvent);
196 
197  int
198  checkLLRPStatus (
199  CLLRPStatus * pLLRPStatus,
200  char * pWhatStr);
201 
202  CMessage *
203  transact (
204  CMessage * pSendMsg);
205 
206  CMessage *
207  recvMessage (
208  int nMaxMS);
209 
210  int
211  sendMessage (
212  CMessage * pSendMsg);
213 
214  void
215  printXMLMessage (
216  CMessage * pMessage);
217 };
218 
219 
220 /* BEGIN forward declarations */
221 int
222 main (
223  int ac,
224  char * av[]);
225 
226 void
227 usage (
228  char * pProgName);
229 /* END forward declarations */
230 
231 
247 int
249  int ac,
250  char * av[])
251 {
252  CMyApplication myApp;
253  char * pReaderHostName;
254  int rc;
255  int i;
256 
257  /*
258  * Process comand arguments, determine reader name
259  * and verbosity level.
260  */
261 
262  if( ac < 2)
263  {
264  usage(av[0]);
265  return -1;
266  }
267 
268  srand((unsigned int) time(NULL));
269 
270 
271  /* get the options. Skip the last one as its the hostname */
272  for( i = 1; i < ac-1; i++)
273  {
274  if((0 == strcmp(av[i],"-p")) && (i < (ac-1)))
275  {
276  i++;
277  myApp.m_password = atoi(av[i]);
278  }
279  else if((0 == strcmp(av[i],"-n")) && (i < (ac-1)))
280  {
281  i++;
282  myApp.m_newPassword = atoi(av[i]);
283  }
284  else if(0==strcmp(av[i], "-t"))
285  {
286  myApp.m_tid=1;
287  }
288  else if(0==strcmp(av[i], "-s"))
289  {
290  myApp.m_shortRange=ImpinjQTAccessRange_Short_Range ;
291  }
292  else if((0 == strcmp(av[i],"-v")) && (i < (ac-1)))
293  {
294  i++;
295  myApp.m_Verbose = atoi(av[i]);
296  }
297  else if((0 == strcmp(av[i],"-q")) && (i < (ac-1)))
298  {
299  i++;
300  myApp.m_qtmode = atoi(av[i]);
301  }
302  else
303  {
304  usage(av[0]);
305  return -1;
306  }
307  }
308 
309  pReaderHostName = av[i];
310 
311  /*
312  * Run application, capture return value for exit status
313  */
314  rc = myApp.run(pReaderHostName );
315 
316  printf("INFO: Done\n");
317 
318  /*
319  * Exit with the right status.
320  */
321  if(0 == rc)
322  {
323  exit(0);
324  }
325  else
326  {
327  exit(2);
328  }
329  /*NOTREACHED*/
330 }
331 
332 
344 void
346  char * pProgName)
347 {
348  printf("Usage: %s [options] READERHOSTNAME\n", pProgName);
349  printf(" -p <password> -- specify an optional password for operations\n");
350  printf(" -n <password> -- specifies a new password for the set password command\n");
351  printf(" -t -- specify to automatically backscatter the TID\n");
352  printf(" -s -- if setting QT config, -s will short range the tag\n");
353  printf(" -q <n> -- run QT scenario n where n is defined as \n");
354  printf(" 0 -- Read standard TID memory\n");
355  printf(" 1 -- set tag password (uses -p, -n )\n");
356  printf(" 2 -- Read private memory data without QT commands\n");
357  printf(" 3 -- read QT status of tag (uses -p)\n");
358  printf(" 4 -- set QT status of tag to private (uses -p, -s)\n");
359  printf(" 5 -- set QT status of tag to public (uses -p, -s)\n");
360  printf(" 6 -- Peek at private memory data with temporary QT command (uses -p)\n");
361  printf(" 7 -- Write 32 words of user data to random values\n");
362  printf(" 8 -- Write 6 words of public EPC data to random values\n");
363  printf(" 9 -- Read Reserved memory\n");
364  printf("\n");
365 
366  exit(1);
367 }
368 
369 
414 int
415 CMyApplication::run (
416  char * pReaderHostName)
417 {
418  CTypeRegistry * pTypeRegistry;
419  CConnection * pConn;
420  int rc;
421 
422  /*
423  * Allocate the type registry. This is needed
424  * by the connection to decode.
425  */
426  pTypeRegistry = getTheTypeRegistry();
427  if(NULL == pTypeRegistry)
428  {
429  printf("ERROR: getTheTypeRegistry failed\n");
430  return -1;
431  }
432 
433  /*
434  * Enroll impinj extension types into the
435  * type registry, in preparation for using
436  * Impinj extension params.
437  */
439 
440  /*
441  * Construct a connection (LLRP::CConnection).
442  * Using a 32kb max frame size for send/recv.
443  * The connection object is ready for business
444  * but not actually connected to the reader yet.
445  */
446  pConn = new CConnection(pTypeRegistry, 32u*1024u);
447  if(NULL == pConn)
448  {
449  printf("ERROR: new CConnection failed\n");
450  return -2;
451  }
452 
453  /*
454  * Open the connection to the reader
455  */
456  if(m_Verbose)
457  {
458  printf("INFO: Connecting to %s....\n", pReaderHostName);
459  }
460 
461  rc = pConn->openConnectionToReader(pReaderHostName);
462  if(0 != rc)
463  {
464  printf("ERROR: connect: %s (%d)\n", pConn->getConnectError(), rc);
465  delete pConn;
466  return -3;
467  }
468 
469  /*
470  * Record the pointer to the connection object so other
471  * routines can use it.
472  */
473  m_pConnectionToReader = pConn;
474 
475  if(m_Verbose)
476  {
477  printf("INFO: Connected, checking status....\n");
478  }
479 
480  /*
481  * Commence the sequence and check for errors as we go.
482  * See comments for each routine for details.
483  * Each routine prints messages.
484  */
485  rc = 1;
486  if(0 == checkConnectionStatus())
487  {
488  rc = 2;
489  if(0 == enableImpinjExtensions())
490  {
491  rc = 3;
492  if(0 == resetConfigurationToFactoryDefaults())
493  {
494  rc = 4;
495  if(0 == getReaderCapabilities())
496  {
497  rc = 5;
498  if(0 == setImpinjReaderConfig())
499  {
500  rc = 6;
501  if(0 == addROSpec())
502  {
503  rc = 7;
504  if(0 == addAccessSpec())
505  {
506  rc = 8;
507  if(0 == enableAccessSpec())
508  {
509  rc = 9;
510  if(0 == enableROSpec())
511  {
512  rc = 10;
513  if(0 == startROSpec())
514  {
515  rc = 11;
516  if(0 == awaitAndPrintReport(1))
517  {
518  rc = 12;
519  if(0 == stopROSpec())
520  {
521  rc = 0;
522  }
523  }
524  }
525  }
526  }
527  }
528  }
529  }
530  }
531  }
532 
533  /*
534  * After we're done, try to leave the reader
535  * in a clean state for next use. This is best
536  * effort and no checking of the result is done.
537  */
538  if(m_Verbose)
539  {
540  printf("INFO: Clean up reader configuration...\n");
541  }
542  resetConfigurationToFactoryDefaults();
543  }
544  }
545 
546  if(m_Verbose)
547  {
548  printf("INFO: Finished\n");
549  }
550 
551  /*
552  * Close the connection and release its resources
553  */
554  pConn->closeConnectionToReader();
555  delete pConn;
556 
557  /*
558  * Done with the registry.
559  */
560  delete pTypeRegistry;
561 
562  /*
563  * When we get here all allocated memory should have been deallocated.
564  */
565 
566  return rc;
567 }
568 
569 
600 int
601 CMyApplication::checkConnectionStatus (void)
602 {
603  CMessage * pMessage;
606  CConnectionAttemptEvent * pEvent;
607 
608  /*
609  * Expect the notification within 10 seconds.
610  * It is suppose to be the very first message sent.
611  */
612  pMessage = recvMessage(10000);
613 
614  /*
615  * recvMessage() returns NULL if something went wrong.
616  */
617  if(NULL == pMessage)
618  {
619  /* recvMessage already tattled */
620  goto fail;
621  }
622 
623  /*
624  * Check to make sure the message is of the right type.
625  * The type label (pointer) in the message should be
626  * the type descriptor for READER_EVENT_NOTIFICATION.
627  */
628  if(&CREADER_EVENT_NOTIFICATION::s_typeDescriptor != pMessage->m_pType)
629  {
630  goto fail;
631  }
632 
633  /*
634  * Now that we are sure it is a READER_EVENT_NOTIFICATION,
635  * traverse to the ReaderEventNotificationData parameter.
636  */
637  pNtf = (CREADER_EVENT_NOTIFICATION *) pMessage;
638  pNtfData = pNtf->getReaderEventNotificationData();
639  if(NULL == pNtfData)
640  {
641  goto fail;
642  }
643 
644  /*
645  * The ConnectionAttemptEvent parameter must be present.
646  */
647  pEvent = pNtfData->getConnectionAttemptEvent();
648  if(NULL == pEvent)
649  {
650  goto fail;
651  }
652 
653  /*
654  * The status in the ConnectionAttemptEvent parameter
655  * must indicate connection success.
656  */
658  {
659  goto fail;
660  }
661 
662  /*
663  * Done with the message
664  */
665  delete pMessage;
666 
667  if(m_Verbose)
668  {
669  printf("INFO: Connection status OK\n");
670  }
671 
672  /*
673  * Victory.
674  */
675  return 0;
676 
677  fail:
678  /*
679  * Something went wrong. Tattle. Clean up. Return error.
680  */
681  printf("ERROR: checkConnectionStatus failed\n");
682  delete pMessage;
683  return -1;
684 }
685 
703 int
704 CMyApplication::enableImpinjExtensions (void)
705 {
707  CMessage * pRspMsg;
709 
710  /*
711  * Compose the command message
712  */
713  pCmd = new CIMPINJ_ENABLE_EXTENSIONS();
714  pCmd->setMessageID(m_messageID++);
715  /*
716  * Send the message, expect the response of certain type
717  */
718  pRspMsg = transact(pCmd);
719 
720  /*
721  * Done with the command message
722  */
723  delete pCmd;
724 
725  /*
726  * transact() returns NULL if something went wrong.
727  */
728  if(NULL == pRspMsg)
729  {
730  /* transact already tattled */
731  return -1;
732  }
733 
734  /*
735  * Cast to a CIMPINJ_ENABLE_EXTENSIONS_RESPONSE message.
736  */
737  pRsp = (CIMPINJ_ENABLE_EXTENSIONS_RESPONSE *) pRspMsg;
738 
739  /*
740  * Check the LLRPStatus parameter.
741  */
742  if(0 != checkLLRPStatus(pRsp->getLLRPStatus(),
743  "enableImpinjExtensions"))
744  {
745  /* checkLLRPStatus already tattled */
746  delete pRspMsg;
747  return -1;
748  }
749 
750  /*
751  * Done with the response message.
752  */
753  delete pRspMsg;
754 
755  /*
756  * Tattle progress, maybe
757  */
758  if(m_Verbose)
759  {
760  printf("INFO: Impinj Extensions are enabled\n");
761  }
762 
763  /*
764  * Victory.
765  */
766  return 0;
767 }
768 
789 int
790 CMyApplication::resetConfigurationToFactoryDefaults (void)
791 {
792  CSET_READER_CONFIG * pCmd;
793  CMessage * pRspMsg;
795 
796  /*
797  * Compose the command message
798  */
799  pCmd = new CSET_READER_CONFIG();
800  pCmd->setMessageID(m_messageID++);
801  pCmd->setResetToFactoryDefault(1);
802 
803  /*
804  * Send the message, expect the response of certain type
805  */
806  pRspMsg = transact(pCmd);
807 
808  /*
809  * Done with the command message
810  */
811  delete pCmd;
812 
813  /*
814  * transact() returns NULL if something went wrong.
815  */
816  if(NULL == pRspMsg)
817  {
818  /* transact already tattled */
819  return -1;
820  }
821 
822  /*
823  * Cast to a SET_READER_CONFIG_RESPONSE message.
824  */
825  pRsp = (CSET_READER_CONFIG_RESPONSE *) pRspMsg;
826 
827  /*
828  * Check the LLRPStatus parameter.
829  */
830  if(0 != checkLLRPStatus(pRsp->getLLRPStatus(),
831  "resetConfigurationToFactoryDefaults"))
832  {
833  /* checkLLRPStatus already tattled */
834  delete pRspMsg;
835  return -1;
836  }
837 
838  /*
839  * Done with the response message.
840  */
841  delete pRspMsg;
842 
843  /*
844  * Tattle progress, maybe
845  */
846  if(m_Verbose)
847  {
848  printf("INFO: Configuration reset to factory defaults\n");
849  }
850 
851  /*
852  * Victory.
853  */
854  return 0;
855 }
856 
857 
871 int
872 CMyApplication::getReaderCapabilities(void)
873 {
875  CMessage * pRspMsg;
878  unsigned int bMajorVersion, bMinorVersion, bDevVersion, bBuildVersion = 0;
879 
880 
881  /*
882  * Compose the command message
883  */
884  pCmd = new CGET_READER_CAPABILITIES();
885  pCmd->setMessageID(m_messageID++);
887 
888  /*
889  * Send the message, expect the response of certain type
890  */
891  pRspMsg = transact(pCmd);
892 
893  /*
894  * Done with the command message
895  */
896  delete pCmd;
897 
898  /*
899  * transact() returns NULL if something went wrong.
900  */
901  if(NULL == pRspMsg)
902  {
903  /* transact already tattled */
904  return -1;
905  }
906 
907  /*
908  * Cast to a CGET_READER_CAPABILITIES_RESPONSE message.
909  */
910  pRsp = (CGET_READER_CAPABILITIES_RESPONSE *) pRspMsg;
911 
912  /*
913  * Check the LLRPStatus parameter.
914  */
915  if(0 != checkLLRPStatus(pRsp->getLLRPStatus(),
916  "getReaderCapabilities"))
917  {
918  /* checkLLRPStatus already tattled */
919  delete pRspMsg;
920  return -1;
921  }
922 
923  /*
924  ** Get out the general device capabilities
925  */
926  if(NULL == (pDevCap = pRsp->getGeneralDeviceCapabilities()))
927  {
928  delete pRspMsg;
929  return -1;
930  }
931 
932 
933  /* if this parameter is missing, or if this is not an Impinj
934  ** reader, we can't determine its capabilities so we exit
935  ** Impinj Private Enterprise NUmber is 25882 */
936  if( (NULL == (pDevCap = pRsp->getGeneralDeviceCapabilities())) ||
937  (25882 != pDevCap->getDeviceManufacturerName()))
938  {
939  delete pRspMsg;
940  return -1;
941  }
942 
943 
944  /*
945  * Get the version information from the reader and make sure we are 4.4 or better.
946  */
947  if ( pDevCap->getReaderFirmwareVersion().m_nValue < 3)
948  {
949  printf("ERROR: Must have Firmware 4.4 or later for low level data example \n");
950  delete pRspMsg;
951  return -1;
952  }
953 
954  /*
955  * Parse to make sure it is really 4.4 or better
956  */
957  sscanf((char *) pDevCap->getReaderFirmwareVersion().m_pValue, "%u.%u.%u.%u", &bMajorVersion, &bMinorVersion, &bDevVersion, &bBuildVersion);
958 
959  if( (bMajorVersion < 4) && (bMinorVersion < 4) )
960  {
961  printf("ERROR: Must have Firmware 4.4 or later for low level data example \n");
962  delete pRspMsg;
963  return -1;
964  }
965 
966  /*
967  * Done with the response message.
968  */
969  delete pRspMsg;
970 
971  /*
972  * Tattle progress, maybe
973  */
974  if(m_Verbose)
975  {
976  printf("INFO: Found LLRP Capabilities \n");
977  }
978 
979  /*
980  * Victory.
981  */
982  return 0;
983 }
984 
985 
1000 int
1001 CMyApplication::setImpinjReaderConfig(void)
1002 {
1003  CSET_READER_CONFIG *pCmd;
1004  CMessage * pRspMsg;
1006 
1007  /*
1008  * Compose the command message
1009  */
1010  pCmd = new CSET_READER_CONFIG();
1011  pCmd->setMessageID(m_messageID++);
1012 
1014 
1015  /*
1016  ** Apply this configuration to all antennas
1017  */
1018  pAnt->setAntennaID(0);
1019 
1020  /*
1021  ** Create the container Inventory command to hold all the parameters
1022  */
1023  CC1G2InventoryCommand *pC1G2Inv = new CC1G2InventoryCommand();
1024 
1025  /* set the mode to auto-set max throughput */
1026  CC1G2RFControl *pC1G2Rf = new CC1G2RFControl();
1027  pC1G2Rf->setModeIndex(2); /* DRM M=4 */
1028  pC1G2Rf->setTari(0); /* tari is ignored by the reader */
1029  pC1G2Inv->setC1G2RFControl(pC1G2Rf);
1030 
1032  pC1G2Sing->setSession(1);
1033  pC1G2Sing->setTagPopulation(1);
1034  pC1G2Sing->setTagTransitTime(0);
1035  pC1G2Inv->setC1G2SingulationControl(pC1G2Sing);
1036 
1037  pC1G2Inv->setTagInventoryStateAware(false);
1038 
1039  /* set the Impinj Inventory search mode as per the use case */
1042  pC1G2Inv->addCustom(pImpIsm);
1043 
1044  /*
1045  ** set the Impinj Low Duty Cycle mode as per the use case
1046  */
1047  CImpinjLowDutyCycle *pImpLdc = new CImpinjLowDutyCycle();
1048  pImpLdc->setEmptyFieldTimeout(10000);
1049  pImpLdc->setFieldPingInterval(200);
1051  pC1G2Inv->addCustom(pImpLdc);
1052 
1053  /*
1054  ** Don't forget to add the InventoryCommand to the antenna
1055  ** configuration, and then add the antenna configuration to the
1056  ** config message
1057  */
1059  pCmd->addAntennaConfiguration(pAnt);
1060 
1061  /*
1062  ** report every tag (N=1) since that is required for tag direction
1063  */
1064  CROReportSpec *pROrs = new CROReportSpec();
1066  pROrs->setN(1);
1067 
1068  /*
1069  ** Turn off off report data that we don't need since our use
1070  ** case suggests we are bandwidth constrained
1071  */
1073  pROcontent->setEnableAccessSpecID(false);
1074  pROcontent->setEnableAntennaID(false);
1075  pROcontent->setEnableChannelIndex(false);
1076  pROcontent->setEnableFirstSeenTimestamp(true);
1077  pROcontent->setEnableInventoryParameterSpecID(false);
1078  pROcontent->setEnableLastSeenTimestamp(false);
1079  pROcontent->setEnablePeakRSSI(false);
1080  pROcontent->setEnableROSpecID(false);
1081  pROcontent->setEnableSpecIndex(false);
1082  pROcontent->setEnableTagSeenCount(false);
1084  pC1G2Mem->setEnableCRC(false);
1085  pC1G2Mem->setEnablePCBits(false);
1086  pROcontent->addAirProtocolEPCMemorySelector(pC1G2Mem);
1087  pROrs->setTagReportContentSelector(pROcontent);
1088 
1089  /* Optionally turn on EPC/TID backscatter. leave the others off as
1090  ** low level data is another example */
1092 
1093  CImpinjEnableRFPhaseAngle * pEnableRfPhase = new CImpinjEnableRFPhaseAngle();
1095  pImpTagCnt->setImpinjEnableRFPhaseAngle(pEnableRfPhase);
1096 
1097  CImpinjEnablePeakRSSI * pEnablePeakRssi = new CImpinjEnablePeakRSSI();
1098  pEnablePeakRssi->setPeakRSSIMode(ImpinjPeakRSSIMode_Disabled);
1099  pImpTagCnt->setImpinjEnablePeakRSSI(pEnablePeakRssi);
1100 
1101  CImpinjEnableSerializedTID * pEnableSerializedTID = new CImpinjEnableSerializedTID();
1102 
1103  /* Here's where we set the backscatter of the TID */
1104  if(m_tid)
1106  else
1108 
1109  pImpTagCnt->setImpinjEnableSerializedTID(pEnableSerializedTID);
1110 
1111  pROrs->addCustom(pImpTagCnt);
1112 
1113  pCmd->setROReportSpec(pROrs);
1114 
1115  /*
1116  * Send the message, expect the response of certain type
1117  */
1118  pRspMsg = transact(pCmd);
1119 
1120  /*
1121  * Done with the command message
1122  */
1123  delete pCmd;
1124 
1125  /*
1126  * transact() returns NULL if something went wrong.
1127  */
1128  if(NULL == pRspMsg)
1129  {
1130  /* transact already tattled */
1131  return -1;
1132  }
1133 
1134  /*
1135  * Cast to a CSET_READER_CONFIG_RESPONSE message.
1136  */
1137  pRsp = (CSET_READER_CONFIG_RESPONSE *) pRspMsg;
1138 
1139  /*
1140  * Check the LLRPStatus parameter.
1141  */
1142  if(0 != checkLLRPStatus(pRsp->getLLRPStatus(),
1143  "setImpinjReaderConfig"))
1144  {
1145  /* checkLLRPStatus already tattled */
1146  delete pRspMsg;
1147  return -1;
1148  }
1149 
1150  /*
1151  * Done with the response message.
1152  */
1153  delete pRspMsg;
1154 
1155  /*
1156  * Tattle progress, maybe
1157  */
1158  if(m_Verbose)
1159  {
1160  printf("INFO: Set Impinj Reader Configuration \n");
1161  }
1162 
1163  /*
1164  * Victory.
1165  */
1166  return 0;
1167 }
1168 
1246 int
1247 CMyApplication::addROSpec (void)
1248 {
1249  CROSpecStartTrigger * pROSpecStartTrigger =
1250  new CROSpecStartTrigger();
1251  pROSpecStartTrigger->setROSpecStartTriggerType(
1253 
1254  CROSpecStopTrigger * pROSpecStopTrigger = new CROSpecStopTrigger();
1256  pROSpecStopTrigger->setDurationTriggerValue(0); /* n/a */
1257 
1258  CROBoundarySpec * pROBoundarySpec = new CROBoundarySpec();
1259  pROBoundarySpec->setROSpecStartTrigger(pROSpecStartTrigger);
1260  pROBoundarySpec->setROSpecStopTrigger(pROSpecStopTrigger);
1261 
1262  CAISpecStopTrigger * pAISpecStopTrigger = new CAISpecStopTrigger();
1263  pAISpecStopTrigger->setAISpecStopTriggerType(
1265  pAISpecStopTrigger->setDurationTrigger(0);
1266 
1267  CInventoryParameterSpec * pInventoryParameterSpec =
1269  pInventoryParameterSpec->setInventoryParameterSpecID(1234);
1270  pInventoryParameterSpec->setProtocolID(AirProtocols_EPCGlobalClass1Gen2);
1271 
1272  /* Build the antennaConfiguration to Contain this */
1273  CAntennaConfiguration * pAntennaConfiguration =
1274  new CAntennaConfiguration();
1275  pAntennaConfiguration->setAntennaID(0);
1276 
1277  /* don't forget to add this to the INventory Parameter Spec above */
1278  pInventoryParameterSpec->addAntennaConfiguration(pAntennaConfiguration);
1279 
1280  /*
1281  ** Use all Antennas
1282  */
1283  llrp_u16v_t AntennaIDs = llrp_u16v_t(1);
1284  AntennaIDs.m_pValue[0] = 0;
1285 
1286  CAISpec * pAISpec = new CAISpec();
1287  pAISpec->setAntennaIDs(AntennaIDs);
1288  pAISpec->setAISpecStopTrigger(pAISpecStopTrigger);
1289  pAISpec->addInventoryParameterSpec(pInventoryParameterSpec);
1290 
1291  CROSpec * pROSpec = new CROSpec();
1292  pROSpec->setROSpecID(1111);
1293  pROSpec->setPriority(0);
1295  pROSpec->setROBoundarySpec(pROBoundarySpec);
1296  pROSpec->addSpecParameter(pAISpec);
1297 
1298  CADD_ROSPEC * pCmd;
1299  CMessage * pRspMsg;
1300  CADD_ROSPEC_RESPONSE * pRsp;
1301 
1302  /*
1303  * Compose the command message.
1304  * N.B.: After the message is composed, all the parameters
1305  * constructed, immediately above, are considered "owned"
1306  * by the command message. When it is destructed so
1307  * too will the parameters be.
1308  */
1309  pCmd = new CADD_ROSPEC();
1310  pCmd->setMessageID(m_messageID++);
1311  pCmd->setROSpec(pROSpec);
1312 
1313  /*
1314  * Send the message, expect the response of certain type
1315  */
1316  pRspMsg = transact(pCmd);
1317 
1318  /*
1319  * Done with the command message.
1320  * N.B.: And the parameters
1321  */
1322  delete pCmd;
1323 
1324  /*
1325  * transact() returns NULL if something went wrong.
1326  */
1327  if(NULL == pRspMsg)
1328  {
1329  /* transact already tattled */
1330  return -1;
1331  }
1332 
1333  /*
1334  * Cast to a ADD_ROSPEC_RESPONSE message.
1335  */
1336  pRsp = (CADD_ROSPEC_RESPONSE *) pRspMsg;
1337 
1338  /*
1339  * Check the LLRPStatus parameter.
1340  */
1341  if(0 != checkLLRPStatus(pRsp->getLLRPStatus(), "addROSpec"))
1342  {
1343  /* checkLLRPStatus already tattled */
1344  delete pRspMsg;
1345  return -1;
1346  }
1347 
1348  /*
1349  * Done with the response message.
1350  */
1351  delete pRspMsg;
1352 
1353  /*
1354  * Tattle progress, maybe
1355  */
1356  if(m_Verbose)
1357  {
1358  printf("INFO: ROSpec added\n");
1359  }
1360 
1361  /*
1362  * Victory.
1363  */
1364  return 0;
1365 }
1366 
1367 
1385 int
1386 CMyApplication::enableROSpec (void)
1387 {
1388  CENABLE_ROSPEC * pCmd;
1389  CMessage * pRspMsg;
1390  CENABLE_ROSPEC_RESPONSE * pRsp;
1391 
1392  /*
1393  * Compose the command message
1394  */
1395  pCmd = new CENABLE_ROSPEC();
1396  pCmd->setMessageID(m_messageID++);
1397  pCmd->setROSpecID(1111);
1398 
1399  /*
1400  * Send the message, expect the response of certain type
1401  */
1402  pRspMsg = transact(pCmd);
1403 
1404  /*
1405  * Done with the command message
1406  */
1407  delete pCmd;
1408 
1409  /*
1410  * transact() returns NULL if something went wrong.
1411  */
1412  if(NULL == pRspMsg)
1413  {
1414  /* transact already tattled */
1415  return -1;
1416  }
1417 
1418  /*
1419  * Cast to a ENABLE_ROSPEC_RESPONSE message.
1420  */
1421  pRsp = (CENABLE_ROSPEC_RESPONSE *) pRspMsg;
1422 
1423  /*
1424  * Check the LLRPStatus parameter.
1425  */
1426  if(0 != checkLLRPStatus(pRsp->getLLRPStatus(), "enableROSpec"))
1427  {
1428  /* checkLLRPStatus already tattled */
1429  delete pRspMsg;
1430  return -1;
1431  }
1432 
1433  /*
1434  * Done with the response message.
1435  */
1436  delete pRspMsg;
1437 
1438  /*
1439  * Tattle progress, maybe
1440  */
1441  if(m_Verbose)
1442  {
1443  printf("INFO: ROSpec enabled\n");
1444  }
1445 
1446  /*
1447  * Victory.
1448  */
1449  return 0;
1450 }
1451 
1452 
1470 int
1471 CMyApplication::startROSpec (void)
1472 {
1473  CSTART_ROSPEC * pCmd;
1474  CMessage * pRspMsg;
1475  CSTART_ROSPEC_RESPONSE * pRsp;
1476 
1477  /*
1478  * Compose the command message
1479  */
1480  pCmd = new CSTART_ROSPEC();
1481  pCmd->setMessageID(m_messageID++);
1482  pCmd->setROSpecID(1111);
1483 
1484  /*
1485  * Send the message, expect the response of certain type
1486  */
1487  pRspMsg = transact(pCmd);
1488 
1489  /*
1490  * Done with the command message
1491  */
1492  delete pCmd;
1493 
1494  /*
1495  * transact() returns NULL if something went wrong.
1496  */
1497  if(NULL == pRspMsg)
1498  {
1499  /* transact already tattled */
1500  return -1;
1501  }
1502 
1503  /*
1504  * Cast to a START_ROSPEC_RESPONSE message.
1505  */
1506  pRsp = (CSTART_ROSPEC_RESPONSE *) pRspMsg;
1507 
1508  /*
1509  * Check the LLRPStatus parameter.
1510  */
1511  if(0 != checkLLRPStatus(pRsp->getLLRPStatus(), "startROSpec"))
1512  {
1513  /* checkLLRPStatus already tattled */
1514  delete pRspMsg;
1515  return -1;
1516  }
1517 
1518  /*
1519  * Done with the response message.
1520  */
1521  delete pRspMsg;
1522 
1523  /*
1524  * Tattle progress
1525  */
1526  if(m_Verbose)
1527  {
1528  printf("INFO: ROSpec started\n");
1529  }
1530 
1531  /*
1532  * Victory.
1533  */
1534  return 0;
1535 }
1536 
1554 int
1555 CMyApplication::stopROSpec (void)
1556 {
1557  CSTOP_ROSPEC * pCmd;
1558  CMessage * pRspMsg;
1559  CSTOP_ROSPEC_RESPONSE * pRsp;
1560 
1561  /*
1562  * Compose the command message
1563  */
1564  pCmd = new CSTOP_ROSPEC();
1565  pCmd->setMessageID(m_messageID++);
1566  pCmd->setROSpecID(1111);
1567 
1568  /*
1569  * Send the message, expect the response of certain type
1570  */
1571  pRspMsg = transact(pCmd);
1572 
1573  /*
1574  * Done with the command message
1575  */
1576  delete pCmd;
1577 
1578  /*
1579  * transact() returns NULL if something went wrong.
1580  */
1581  if(NULL == pRspMsg)
1582  {
1583  /* transact already tattled */
1584  return -1;
1585  }
1586 
1587  /*
1588  * Cast to a STOP_ROSPEC_RESPONSE message.
1589  */
1590  pRsp = (CSTOP_ROSPEC_RESPONSE *) pRspMsg;
1591 
1592  /*
1593  * Check the LLRPStatus parameter.
1594  */
1595  if(0 != checkLLRPStatus(pRsp->getLLRPStatus(), "stopROSpec"))
1596  {
1597  /* checkLLRPStatus already tattled */
1598  delete pRspMsg;
1599  return -1;
1600  }
1601 
1602  /*
1603  * Done with the response message.
1604  */
1605  delete pRspMsg;
1606 
1607  /*
1608  * Tattle progress
1609  */
1610  if(m_Verbose)
1611  {
1612  printf("INFO: ROSpec stopped\n");
1613  }
1614 
1615  /*
1616  * Victory.
1617  */
1618  return 0;
1619 }
1620 
1633 int
1634 CMyApplication::addAccessSpec (void)
1635 {
1636  CADD_ACCESSSPEC * pCmd;
1637  CMessage * pRspMsg;
1638  CADD_ACCESSSPEC_RESPONSE * pRsp;
1639 
1640  pCmd = new CADD_ACCESSSPEC();
1641  pCmd->setMessageID(m_messageID++);
1642 
1643  /* build the C1G2Target Tag with the AccessSpec filter */
1644  CC1G2TargetTag *ptargetTag = new CC1G2TargetTag();
1645  ptargetTag->setMatch(true);
1646  ptargetTag->setMB(1);
1647  ptargetTag->setPointer(16);
1648 
1649  /* match any tag */
1650  llrp_u1v_t tagData = llrp_u1v_t(0);
1651  tagData.m_nBit = 0;
1652  ptargetTag->setTagData(tagData);
1653  llrp_u1v_t tagMask = llrp_u1v_t(0);
1654  tagMask.m_nBit = 0;
1655  ptargetTag->setTagMask(tagMask);
1656 
1657  /* build the AirProtocolTagSpec Add the filter */
1658  CC1G2TagSpec *ptagSpec = new CC1G2TagSpec();
1659  ptagSpec->addC1G2TargetTag(ptargetTag);
1660 
1661  /* Create the AccessCommand. Add the TagSpec and the OpSpec */
1662  CAccessCommand *pAccessCommand = new CAccessCommand();
1663  pAccessCommand->setAirProtocolTagSpec(ptagSpec);
1664 
1665  /* Build the read Op Spec and add to the access command */
1666  /*
1667  ** -q <n> -- run QT scenario n where n is defined as
1668  ** 0 -- Read standard TID memory
1669  ** 1 -- set tag password (uses -p, -n)
1670  ** 2 -- Read private memory data without QT commands
1671  ** 3 -- read QT status of tag (uses -p)
1672  ** 4 -- set QT status of tag to private (uses -p, -s)
1673  ** 5 -- set QT status of tag to public (uses -p, -s)
1674  ** 6 -- Peek at private memory data with temporary QT command (uses -p)
1675  ** 7 -- write random data to user memory
1676  ** 8 -- write random data to the public EPC space
1677  */
1678 
1679  switch(m_qtmode)
1680  {
1681  case 0:
1682  {
1683  CC1G2Read *preadStdTID = new CC1G2Read();
1684  preadStdTID->setAccessPassword(0); /* no access required to read */
1685  preadStdTID->setMB(2);
1686  preadStdTID->setOpSpecID(1);
1687  preadStdTID->setWordCount(2); /* standard TID */
1688  preadStdTID->setWordPointer(0);
1689  pAccessCommand->addAccessCommandOpSpec(preadStdTID);
1690  }
1691  break;
1692  case 1:
1693  {
1694  llrp_u16v_t Data = llrp_u16v_t(2);
1695  Data.m_pValue[0] = ((m_newPassword >> 16) & 0x0000ffff);
1696  Data.m_pValue[1] = (m_newPassword & 0x0000ffff);
1697 
1698  CC1G2Write *pwrite = new CC1G2Write();
1699  pwrite->setOpSpecID(10);
1700  pwrite->setMB(0);
1701  pwrite->setAccessPassword(m_password);
1702  pwrite->setWordPointer(2);
1703  pwrite->setWriteData(Data);
1704  pAccessCommand->addAccessCommandOpSpec(pwrite);
1705  }
1706  break;
1707  case 2:
1708  {
1709  CC1G2Read *preadSTID = new CC1G2Read();
1710  preadSTID->setAccessPassword(0); /* no access required to read */
1711  preadSTID->setMB(2);
1712  preadSTID->setOpSpecID(2);
1713  preadSTID->setWordCount(6); /* standard TID plus 48 bit STID */
1714  preadSTID->setWordPointer(0);
1715  pAccessCommand->addAccessCommandOpSpec(preadSTID);
1716 
1717  CC1G2Read *preadPEPC = new CC1G2Read();
1718  preadPEPC->setAccessPassword(0); /* no access required to read */
1719  preadPEPC->setMB(2);
1720  preadPEPC->setOpSpecID(2);
1721  preadPEPC->setWordCount(6); /* Public EPC memory */
1722  preadPEPC->setWordPointer(6);
1723  pAccessCommand->addAccessCommandOpSpec(preadPEPC);
1724 
1725  CC1G2Read *preadUser = new CC1G2Read();
1726  preadUser->setAccessPassword(0); /* no access required to read */
1727  preadUser->setMB(3);
1728  preadUser->setOpSpecID(3);
1729  preadUser->setWordCount(32); /* 512 bits of user memory */
1730  preadUser->setWordPointer(0);
1731  pAccessCommand->addAccessCommandOpSpec(preadUser);
1732  }
1733  break;
1734  default:
1735  /* for unknown, just try to read QT status */
1736  case 3:
1737  {
1738  CImpinjGetQTConfig *pgetQT = new CImpinjGetQTConfig();
1739  pgetQT->setAccessPassword(m_password); /* use password if provided */
1740  pgetQT->setOpSpecID(4);
1741  pAccessCommand->addAccessCommandOpSpec(pgetQT);
1742  }
1743  break;
1744  case 4:
1745  {
1746  CImpinjSetQTConfig *psetQT = new CImpinjSetQTConfig();
1747  psetQT->setAccessPassword(m_password);
1748  psetQT->setOpSpecID(5);
1749  psetQT->setAccessRange(m_shortRange);
1752  pAccessCommand->addAccessCommandOpSpec(psetQT);
1753  }
1754  break;
1755  case 5:
1756  {
1757  CImpinjSetQTConfig *psetQT = new CImpinjSetQTConfig();
1758  psetQT->setAccessPassword(m_password);
1759  psetQT->setOpSpecID(6);
1760  psetQT->setAccessRange(m_shortRange);
1763  pAccessCommand->addAccessCommandOpSpec(psetQT);
1764  }
1765  break;
1766  case 6:
1767  {
1768  CImpinjSetQTConfig *psetQT = new CImpinjSetQTConfig();
1769  psetQT->setAccessPassword(m_password);
1770  psetQT->setOpSpecID(6);
1774  pAccessCommand->addAccessCommandOpSpec(psetQT);
1775 
1776  CC1G2Read *preadPrivEPC = new CC1G2Read();
1777  preadPrivEPC->setAccessPassword(0); /* no access required to read */
1778  preadPrivEPC->setMB(1);
1779  preadPrivEPC->setOpSpecID(7);
1780  preadPrivEPC->setWordCount(8); /* assume 128-bit */
1781  preadPrivEPC->setWordPointer(2);
1782  pAccessCommand->addAccessCommandOpSpec(preadPrivEPC);
1783 
1784  CC1G2Read *preadSTID = new CC1G2Read();
1785  preadSTID->setAccessPassword(0); /* no access required to read */
1786  preadSTID->setMB(2);
1787  preadSTID->setOpSpecID(8);
1788  preadSTID->setWordCount(6); /* standard TID plus 48 bit STID */
1789  preadSTID->setWordPointer(0);
1790  pAccessCommand->addAccessCommandOpSpec(preadSTID);
1791 
1792  CC1G2Read *preadUser = new CC1G2Read();
1793  preadUser->setAccessPassword(0); /* no access required to read */
1794  preadUser->setMB(3);
1795  preadUser->setOpSpecID(9);
1796  preadUser->setWordCount(32);
1797  preadUser->setWordPointer(0);
1798  pAccessCommand->addAccessCommandOpSpec(preadUser);
1799  }
1800  break;
1801  case 7:
1802  {
1803  llrp_u16v_t Data = llrp_u16v_t(32);
1804 
1805  for(int x = 0; x < 32; x++)
1806  {
1807  Data.m_pValue[x] = rand();
1808  }
1809 
1810  CC1G2Write *pwrite = new CC1G2Write();
1811  pwrite->setOpSpecID(10);
1812  pwrite->setMB(3);
1813  pwrite->setAccessPassword(m_password);
1814  pwrite->setWordPointer(0);
1815  pwrite->setWriteData(Data);
1816  pAccessCommand->addAccessCommandOpSpec(pwrite);
1817  }
1818  break;
1819  case 8:
1820  {
1821  llrp_u16v_t Data = llrp_u16v_t(6);
1822 
1823  for(int x = 0; x < 6; x++)
1824  {
1825  Data.m_pValue[x] = rand();
1826  }
1827 
1828  CC1G2Write *pwrite = new CC1G2Write();
1829  pwrite->setOpSpecID(11);
1830  pwrite->setMB(2);
1831  pwrite->setAccessPassword(m_password);
1832  pwrite->setWordPointer(6);
1833  pwrite->setWriteData(Data);
1834  pAccessCommand->addAccessCommandOpSpec(pwrite);
1835  }
1836  break;
1837  case 9:
1838  {
1839  CC1G2Read *preadRsvd = new CC1G2Read();
1840  preadRsvd->setAccessPassword(0); /* no access required to read */
1841  preadRsvd->setMB(0);
1842  preadRsvd->setOpSpecID(12);
1843  preadRsvd->setWordCount(4); /* Access and Kill */
1844  preadRsvd->setWordPointer(0);
1845  pAccessCommand->addAccessCommandOpSpec(preadRsvd);
1846  }
1847  break;
1848  }
1849 
1850  /* set up the Access Report Spec rule to report only with ROSpecs */
1851  CAccessReportSpec *pAccessReportSpec = new CAccessReportSpec();
1852  pAccessReportSpec->setAccessReportTrigger(
1854 
1855  /* set up the stop trigger for the access spec. Do not stop */
1856  CAccessSpecStopTrigger *pAccessStopTrigger = new CAccessSpecStopTrigger();
1857  pAccessStopTrigger->setAccessSpecStopTrigger(
1859  pAccessStopTrigger->setOperationCountValue(0); /* ignored */
1860 
1861  /* Create and configure the AccessSpec */
1862  CAccessSpec *pAccessSpec = new CAccessSpec();
1863  pAccessSpec->setAccessSpecID(23);
1864  pAccessSpec->setAntennaID(0); /* valid for all antennas */
1867  pAccessSpec->setROSpecID(0); /* valid for All RoSpecs */
1868  pAccessSpec->setAccessSpecStopTrigger(pAccessStopTrigger);
1869  pAccessSpec->setAccessReportSpec(pAccessReportSpec);
1870  pAccessSpec->setAccessCommand(pAccessCommand);
1871 
1872  /* Add the AccessSpec to the ADD_ACCESS_SPEC message */
1873  pCmd->setAccessSpec(pAccessSpec);
1874 
1875  /*
1876  * Send the message, expect the response of certain type
1877  */
1878  pRspMsg = transact(pCmd);
1879 
1880  /*
1881  * Done with the command message
1882  */
1883  delete pCmd;
1884 
1885  /*
1886  * transact() returns NULL if something went wrong.
1887  */
1888  if(NULL == pRspMsg)
1889  {
1890  /* transact already tattled */
1891  return -1;
1892  }
1893 
1894  /*
1895  * Cast to a ADD_ACCESSSPEC_RESPONSE message.
1896  */
1897  pRsp = (CADD_ACCESSSPEC_RESPONSE *) pRspMsg;
1898 
1899  /*
1900  * Check the LLRPStatus parameter.
1901  */
1902  if(0 != checkLLRPStatus(pRsp->getLLRPStatus(), "addAccessSpec"))
1903  {
1904  /* checkLLRPStatus already tattled */
1905  delete pRspMsg;
1906  return -1;
1907  }
1908 
1909  /*
1910  * Done with the response message.
1911  */
1912  delete pRspMsg;
1913 
1914  /*
1915  * Tattle progress, maybe
1916  */
1917  if(m_Verbose)
1918  {
1919  printf("INFO: AccessSpec added\n");
1920  }
1921 
1922  /*
1923  * Victory.
1924  */
1925  return 0;
1926 }
1927 
1928 
1942 int
1943 CMyApplication::enableAccessSpec (void)
1944 {
1945  CENABLE_ACCESSSPEC * pCmd;
1946  CMessage * pRspMsg;
1948 
1949  /*
1950  * Compose the command message
1951  */
1952  pCmd = new CENABLE_ACCESSSPEC();
1953  pCmd->setMessageID(m_messageID++);
1954  pCmd->setAccessSpecID(23);
1955 
1956  /*
1957  * Send the message, expect the response of certain type
1958  */
1959  pRspMsg = transact(pCmd);
1960 
1961  /*
1962  * Done with the command message
1963  */
1964  delete pCmd;
1965 
1966  /*
1967  * transact() returns NULL if something went wrong.
1968  */
1969  if(NULL == pRspMsg)
1970  {
1971  /* transact already tattled */
1972  return -1;
1973  }
1974 
1975  /*
1976  * Cast to a ENABLE_ACCESSSPEC_RESPONSE message.
1977  */
1978  pRsp = (CENABLE_ACCESSSPEC_RESPONSE *) pRspMsg;
1979 
1980  /*
1981  * Check the LLRPStatus parameter.
1982  */
1983  if(0 != checkLLRPStatus(pRsp->getLLRPStatus(), "enableAccessSpec"))
1984  {
1985  /* checkLLRPStatus already tattled */
1986  delete pRspMsg;
1987  return -1;
1988  }
1989 
1990  /*
1991  * Done with the response message.
1992  */
1993  delete pRspMsg;
1994 
1995  /*
1996  * Tattle progress, maybe
1997  */
1998  if(m_Verbose)
1999  {
2000  printf("INFO: AccessSpec enabled\n");
2001  }
2002 
2003  /*
2004  * Victory.
2005  */
2006  return 0;
2007 }
2008 
2009 
2029 int
2030 CMyApplication::awaitAndPrintReport (int timeout)
2031 {
2032  int bDone = 0;
2033  int retVal = 0;
2034  time_t startTime = time(NULL);
2035  time_t tempTime;
2036  /*
2037  * Keep receiving messages until done or until
2038  * something bad happens.
2039  */
2040  while(!bDone)
2041  {
2042  CMessage * pMessage;
2043  const CTypeDescriptor * pType;
2044 
2045  /*
2046  * Wait up to 1 second for a report. Check
2047  * That way, we can check the timestamp even if
2048  * there are no reports coming in
2049  */
2050  pMessage = recvMessage(1000);
2051 
2052  /* validate the timestamp */
2053  tempTime = time(NULL);
2054  if(difftime(tempTime, startTime) > timeout)
2055  {
2056  bDone=1;
2057  }
2058 
2059  if(NULL == pMessage)
2060  {
2061  continue;
2062  }
2063 
2064  /*
2065  * What happens depends on what kind of message
2066  * received. Use the type label (m_pType) to
2067  * discriminate message types.
2068  */
2069  pType = pMessage->m_pType;
2070 
2071  /*
2072  * Is it a tag report? If so, print it out.
2073  */
2074  if(&CRO_ACCESS_REPORT::s_typeDescriptor == pType)
2075  {
2076  CRO_ACCESS_REPORT * pNtf;
2077 
2078  pNtf = (CRO_ACCESS_REPORT *) pMessage;
2079 
2080  printTagReportData(pNtf);
2081  }
2082 
2083  /*
2084  * Is it a reader event? This example only recognizes
2085  * AntennaEvents.
2086  */
2087  else if(&CREADER_EVENT_NOTIFICATION::s_typeDescriptor == pType)
2088  {
2090  CReaderEventNotificationData *pNtfData;
2091 
2092  pNtf = (CREADER_EVENT_NOTIFICATION *) pMessage;
2093 
2094  pNtfData = pNtf->getReaderEventNotificationData();
2095  if(NULL != pNtfData)
2096  {
2097  handleReaderEventNotification(pNtfData);
2098  }
2099  else
2100  {
2101  /*
2102  * This should never happen. Using continue
2103  * to keep indent depth down.
2104  */
2105  printf("WARNING: READER_EVENT_NOTIFICATION without data\n");
2106  }
2107  }
2108 
2109  /*
2110  * Hmmm. Something unexpected. Just tattle and keep going.
2111  */
2112  else
2113  {
2114  printf("WARNING: Ignored unexpected message during monitor: %s\n",
2115  pType->m_pName);
2116  }
2117 
2118  /*
2119  * Done with the received message
2120  */
2121  delete pMessage;
2122  }
2123 
2124  return retVal;
2125 }
2126 
2127 
2142 void
2143 CMyApplication::printTagReportData (
2144  CRO_ACCESS_REPORT * pRO_ACCESS_REPORT)
2145 {
2146  std::list<CTagReportData *>::iterator Cur;
2147 
2148  unsigned int nEntry = 0;
2149 
2150  /*
2151  * Loop through and count the number of entries
2152  */
2153  for(
2154  Cur = pRO_ACCESS_REPORT->beginTagReportData();
2155  Cur != pRO_ACCESS_REPORT->endTagReportData();
2156  Cur++)
2157  {
2158  nEntry++;
2159  }
2160 
2161  if(m_Verbose)
2162  {
2163  printf("INFO: %u tag report entries\n", nEntry);
2164  }
2165 
2166  /*
2167  * Loop through again and print each entry.
2168  */
2169  for(
2170  Cur = pRO_ACCESS_REPORT->beginTagReportData();
2171  Cur != pRO_ACCESS_REPORT->endTagReportData();
2172  Cur++)
2173  {
2174  printOneTagReportData(*Cur);
2175  }
2176 }
2177 
2178 
2187 int
2188 CMyApplication::formatOneEPC (
2189  CParameter *pEPCParameter,
2190  char *buf,
2191  int buflen,
2192  char * startStr)
2193 {
2194  char * p = buf;
2195  int bufsize = buflen;
2196  int written = 0;
2197 
2198  written = snprintf(p, bufsize, "%s", startStr);
2199  bufsize -= written;
2200  p += written;
2201 
2202  if(NULL != pEPCParameter)
2203  {
2204  const CTypeDescriptor * pType;
2205  llrp_u96_t my_u96;
2206  llrp_u1v_t my_u1v;
2207  llrp_u8_t * pValue = NULL;
2208  unsigned int n, i;
2209 
2210  pType = pEPCParameter->m_pType;
2211  if(&CEPC_96::s_typeDescriptor == pType)
2212  {
2213  CEPC_96 *pEPC_96;
2214 
2215  pEPC_96 = (CEPC_96 *) pEPCParameter;
2216  my_u96 = pEPC_96->getEPC();
2217  pValue = my_u96.m_aValue;
2218  n = 12u;
2219  }
2220  else if(&CEPCData::s_typeDescriptor == pType)
2221  {
2222  CEPCData * pEPCData;
2223 
2224  pEPCData = (CEPCData *) pEPCParameter;
2225  my_u1v = pEPCData->getEPC();
2226  pValue = my_u1v.m_pValue;
2227  n = (my_u1v.m_nBit + 7u) / 8u;
2228  }
2229 
2230  if(NULL != pValue)
2231  {
2232  for(i = 0; i < n; i++)
2233  {
2234  if(0 < i && i%2 == 0 && 1 < bufsize)
2235  {
2236  *p++ = '-';
2237  bufsize--;
2238  }
2239  if(bufsize > 2)
2240  {
2241  written = snprintf(p, bufsize, "%02X", pValue[i]);
2242  bufsize -= written;
2243  p+= written;
2244  }
2245  }
2246  }
2247  else
2248  {
2249  written = snprintf(p, bufsize, "%s", "---unknown-epc-data-type---");
2250  bufsize -= written;
2251  p += written;
2252  }
2253  }
2254  else
2255  {
2256  written = snprintf(p, bufsize, "%s", "--null epc---");
2257  bufsize -= written;
2258  p += written;
2259  }
2260 
2261  // null terminate this for good practice
2262  buf[buflen-1] = '\0';
2263 
2264  return buflen - bufsize;
2265 }
2266 
2275 int
2276 CMyApplication::formatOneReadResult (
2277  CParameter *pOpSpecReadResult,
2278  char *buf,
2279  int buflen,
2280  char * startStr)
2281 {
2282  EC1G2ReadResultType result;
2283  char * p = buf;
2284  int written = 0;
2285  int bufsize = buflen;
2286  int i;
2287  llrp_u16v_t readData;
2288  CC1G2ReadOpSpecResult *pread = (CC1G2ReadOpSpecResult*) pOpSpecReadResult;
2289 
2290  written = snprintf(p, bufsize, "%s", startStr);
2291  bufsize -= written;
2292  p += written;
2293 
2294  result = pread->getResult();
2295  written = snprintf(p, bufsize, "result=%d", result);
2296  p+= written;
2297  bufsize -= written;
2298 
2299  if(result == C1G2ReadResultType_Success)
2300  {
2301  readData = pread->getReadData();
2302 
2303  written = snprintf(p, bufsize, " Data=");
2304  p+= written;
2305  bufsize -= written;
2306 
2307  for(i = 0; i < readData.m_nValue - 1 ; i++)
2308  {
2309  written =snprintf(p, bufsize, "%04x-", readData.m_pValue[i]);
2310  p+= written;
2311  bufsize -= written;
2312  }
2313  if(readData.m_nValue)
2314  {
2315  written =snprintf(p, bufsize, "%04x", readData.m_pValue[i]);
2316  p+= written;
2317  bufsize -= written;
2318  }
2319  }
2320  buf[buflen-1] = '\0';
2321  return buflen - bufsize;
2322 }
2323 
2332 int
2333 CMyApplication::formatOneWriteResult (
2334  CParameter *pOpSpecReadResult,
2335  char *buf,
2336  int buflen,
2337  char * startStr)
2338 {
2339  EC1G2WriteResultType result;
2340  char * p = buf;
2341  int written = 0;
2342  int bufsize = buflen;
2343  llrp_u16v_t readData;
2344  CC1G2WriteOpSpecResult *pwrite = (CC1G2WriteOpSpecResult*) pOpSpecReadResult;
2345 
2346  written = snprintf(p, bufsize, "%s", startStr);
2347  bufsize -= written;
2348  p += written;
2349 
2350  result = pwrite->getResult();
2351  written = snprintf(p, bufsize, "result=%d", result);
2352  p+= written;
2353  bufsize -= written;
2354 
2355  buf[buflen-1] = '\0';
2356  return buflen - bufsize;
2357 }
2358 
2367 int
2368 CMyApplication::formatOneSetQTConfigResult (
2369  CParameter *pSetQTConfig,
2370  char *buf,
2371  int buflen,
2372  char * startStr)
2373 {
2375  char * p = buf;
2376 
2377  int written = 0;
2378  int bufsize = buflen;
2379  llrp_u16v_t readData;
2381 
2382  written = snprintf(p, bufsize, "%s", startStr);
2383  bufsize -= written;
2384  p += written;
2385 
2386  result = pset->getResult();
2387 
2388  written = snprintf(p, bufsize, "result=%d", result);
2389  p+= written;
2390  bufsize -= written;
2391 
2392  buf[buflen-1] = '\0';
2393  return buflen - bufsize;
2394 }
2395 
2404 int
2405 CMyApplication::formatOneGetQTConfigResult (
2406  CParameter *pSetQTConfig,
2407  char *buf,
2408  int buflen,
2409  char * startStr)
2410 {
2412  char * p = buf;
2413  int written = 0;
2414  int bufsize = buflen;
2415  llrp_u16v_t readData;
2416  const char * dataStrings[3] = { "Unknown",
2417  "Private",
2418  "Public"};
2419 
2420  const char * rangeStrings[3] = { "Unknown",
2421  "Normal",
2422  "Short"};
2423 
2425 
2426  written = snprintf(p, bufsize, "%s", startStr);
2427  bufsize -= written;
2428  p += written;
2429 
2430  result = pset->getResult();
2431  written = snprintf(p, bufsize, "result=%d ", result);
2432  p+= written;
2433  bufsize -= written;
2434 
2436  {
2437  written = snprintf(p, bufsize, "data=%s range=%s\n",
2438  dataStrings[pset->getDataProfile()],
2439  rangeStrings[pset->getAccessRange()]);
2440  p+= written;
2441  bufsize -= written;
2442  }
2443 
2444  buf[buflen-1] = '\0';
2445  return buflen - bufsize;
2446 }
2447 
2448 
2457 int
2458 CMyApplication::formatOneSerializedTID (
2459  CParameter *pSerializedTID,
2460  char *buf,
2461  int buflen,
2462  char * startStr)
2463 {
2464  char * p = buf;
2465  int written = 0;
2466  int bufsize = buflen;
2467 
2468  CImpinjSerializedTID *pTID = (CImpinjSerializedTID*) pSerializedTID;
2469 
2470  written = snprintf(p, bufsize, "%s", startStr);
2471  bufsize -= written;
2472  p += written;
2473 
2474  llrp_u16v_t tid = pTID->getTID();
2475 
2476  for(int i = 0; i < tid.m_nValue; i++)
2477  {
2478  if(0 < i && i%2 == 0 && 1 < bufsize)
2479  {
2480  *p++ = '-';
2481  bufsize--;
2482  }
2483  if(bufsize > 2)
2484  {
2485  written = snprintf(p, bufsize, "%02X", tid.m_pValue[i]);
2486  bufsize -= written;
2487  p+= written;
2488  }
2489  }
2490 
2491  buf[buflen-1] = '\0';
2492  return buflen - bufsize;
2493 }
2494 
2503 void
2504 CMyApplication::printOneTagReportData (
2505  CTagReportData * pTagReportData)
2506 {
2507  const int bufSize = 1024;
2508  char aBuf[bufSize];
2509  char *ptr = aBuf;
2510  int written = 0;
2511  int bufLimit = bufSize;
2512 
2513  std::list<CParameter *>::iterator OpSpecResults;
2514  std::list<CParameter *>::iterator Cur;
2515 
2516  /*
2517  * Print the EPC. It could be an 96-bit EPC_96 parameter
2518  * or an variable length EPCData parameter.
2519  */
2520 
2521  CParameter * pEPCParameter =
2522  pTagReportData->getEPCParameter();
2523 
2524  written = formatOneEPC(pEPCParameter, ptr, bufLimit, "epc=");
2525  ptr += written;
2526  bufLimit-=written;
2527 
2528  aBuf[bufSize-1] = '\0';
2529  /*
2530  ** Handle a few of the op Spec result types
2531  */
2532  for (
2533  OpSpecResults = pTagReportData->beginAccessCommandOpSpecResult();
2534  OpSpecResults != pTagReportData->endAccessCommandOpSpecResult();
2535  OpSpecResults++)
2536  {
2537  if( (*OpSpecResults)->m_pType == &CC1G2ReadOpSpecResult::s_typeDescriptor)
2538  {
2539  written = formatOneReadResult(*OpSpecResults, ptr, bufLimit, "\n READ ");
2540  ptr += written;
2541  bufLimit-=written;
2542  }
2543  else if( (*OpSpecResults)->m_pType == &CC1G2WriteOpSpecResult::s_typeDescriptor)
2544  {
2545  written = formatOneWriteResult(*OpSpecResults, ptr, bufLimit, "\n WRITE ");
2546  ptr += written;
2547  bufLimit-=written;
2548  }
2549  else if( (*OpSpecResults)->m_pType == &CImpinjSetQTConfigOpSpecResult::s_typeDescriptor)
2550  {
2551  written = formatOneSetQTConfigResult(*OpSpecResults, ptr, bufLimit, "\n SETQT ");
2552  ptr += written;
2553  bufLimit-=written;
2554  }
2555  else if( (*OpSpecResults)->m_pType == &CImpinjGetQTConfigOpSpecResult::s_typeDescriptor)
2556  {
2557  written = formatOneGetQTConfigResult(*OpSpecResults, ptr, bufLimit, "\n GETQT ");
2558  ptr += written;
2559  bufLimit-=written;
2560  }
2561  }
2562 
2563  /* look for custom parameters like TID */
2564  for(
2565  Cur = pTagReportData->beginCustom();
2566  Cur != pTagReportData->endCustom();
2567  Cur++)
2568  {
2569  /* look for our special Impinj Tag Report Data */
2570  if(&CImpinjSerializedTID ::s_typeDescriptor == (*Cur)->m_pType)
2571  {
2572  written = formatOneSerializedTID(*Cur, ptr, bufLimit, "\n SERIAL-TID ");
2573  ptr += written;
2574  bufLimit -= written;
2575  }
2576  }
2577 
2578  /*
2579  * End of line
2580  */
2581  printf("%s\n", aBuf);
2582 }
2583 
2584 
2598 void
2599 CMyApplication::handleReaderEventNotification (
2600  CReaderEventNotificationData *pNtfData)
2601 {
2602  CAntennaEvent * pAntennaEvent;
2603  CReaderExceptionEvent * pReaderExceptionEvent;
2604  int nReported = 0;
2605 
2606  pAntennaEvent = pNtfData->getAntennaEvent();
2607  if(NULL != pAntennaEvent)
2608  {
2609  handleAntennaEvent(pAntennaEvent);
2610  nReported++;
2611  }
2612 
2613  pReaderExceptionEvent = pNtfData->getReaderExceptionEvent();
2614  if(NULL != pReaderExceptionEvent)
2615  {
2616  handleReaderExceptionEvent(pReaderExceptionEvent);
2617  nReported++;
2618  }
2619 
2620  /*
2621  * Similarly handle other events here:
2622  * HoppingEvent
2623  * GPIEvent
2624  * ROSpecEvent
2625  * ReportBufferLevelWarningEvent
2626  * ReportBufferOverflowErrorEvent
2627  * RFSurveyEvent
2628  * AISpecEvent
2629  * ConnectionAttemptEvent
2630  * ConnectionCloseEvent
2631  * Custom
2632  */
2633 
2634  if(0 == nReported)
2635  {
2636  printf("NOTICE: Unexpected (unhandled) ReaderEvent\n");
2637  }
2638 }
2639 
2640 
2652 void
2653 CMyApplication::handleAntennaEvent (
2654  CAntennaEvent * pAntennaEvent)
2655 {
2656  EAntennaEventType eEventType;
2657  llrp_u16_t AntennaID;
2658  char * pStateStr;
2659 
2660  eEventType = pAntennaEvent->getEventType();
2661  AntennaID = pAntennaEvent->getAntennaID();
2662 
2663  switch(eEventType)
2664  {
2666  pStateStr = "disconnected";
2667  break;
2668 
2670  pStateStr = "connected";
2671  break;
2672 
2673  default:
2674  pStateStr = "?unknown-event?";
2675  break;
2676  }
2677 
2678  printf("NOTICE: Antenna %d is %s\n", AntennaID, pStateStr);
2679 }
2680 
2681 
2694 void
2695 CMyApplication::handleReaderExceptionEvent (
2696  CReaderExceptionEvent * pReaderExceptionEvent)
2697 {
2698  llrp_utf8v_t Message;
2699 
2700  Message = pReaderExceptionEvent->getMessage();
2701 
2702  if(0 < Message.m_nValue && NULL != Message.m_pValue)
2703  {
2704  printf("NOTICE: ReaderException '%.*s'\n",
2705  Message.m_nValue, Message.m_pValue);
2706  }
2707  else
2708  {
2709  printf("NOTICE: ReaderException but no message\n");
2710  }
2711 }
2712 
2713 
2732 int
2733 CMyApplication::checkLLRPStatus (
2734  CLLRPStatus * pLLRPStatus,
2735  char * pWhatStr)
2736 {
2737  /*
2738  * The LLRPStatus parameter is mandatory in all responses.
2739  * If it is missing there should have been a decode error.
2740  * This just makes sure (remember, this program is a
2741  * diagnostic and suppose to catch LTKC mistakes).
2742  */
2743  if(NULL == pLLRPStatus)
2744  {
2745  printf("ERROR: %s missing LLRP status\n", pWhatStr);
2746  return -1;
2747  }
2748 
2749  /*
2750  * Make sure the status is M_Success.
2751  * If it isn't, print the error string if one.
2752  * This does not try to pretty-print the status
2753  * code. To get that, run this program with -vv
2754  * and examine the XML output.
2755  */
2756  if(StatusCode_M_Success != pLLRPStatus->getStatusCode())
2757  {
2758  llrp_utf8v_t ErrorDesc;
2759 
2760  ErrorDesc = pLLRPStatus->getErrorDescription();
2761 
2762  if(0 == ErrorDesc.m_nValue)
2763  {
2764  printf("ERROR: %s failed, no error description given\n",
2765  pWhatStr);
2766  }
2767  else
2768  {
2769  printf("ERROR: %s failed, %.*s\n",
2770  pWhatStr, ErrorDesc.m_nValue, ErrorDesc.m_pValue);
2771  }
2772  return -2;
2773  }
2774 
2775  /*
2776  * Victory. Everything is fine.
2777  */
2778  return 0;
2779 }
2780 
2781 
2805 CMessage *
2806 CMyApplication::transact (
2807  CMessage * pSendMsg)
2808 {
2809  CConnection * pConn = m_pConnectionToReader;
2810  CMessage * pRspMsg;
2811 
2812  /*
2813  * Print the XML text for the outbound message if
2814  * verbosity is 2 or higher.
2815  */
2816  if(1 < m_Verbose)
2817  {
2818  printf("\n===================================\n");
2819  printf("INFO: Transact sending\n");
2820  printXMLMessage(pSendMsg);
2821  }
2822 
2823  /*
2824  * Send the message, expect the response of certain type.
2825  * If LLRP::CConnection::transact() returns NULL then there was
2826  * an error. In that case we try to print the error details.
2827  */
2828  pRspMsg = pConn->transact(pSendMsg, 5000);
2829 
2830  if(NULL == pRspMsg)
2831  {
2832  const CErrorDetails * pError = pConn->getTransactError();
2833 
2834  printf("ERROR: %s transact failed, %s\n",
2835  pSendMsg->m_pType->m_pName,
2836  pError->m_pWhatStr ? pError->m_pWhatStr : "no reason given");
2837 
2838  if(NULL != pError->m_pRefType)
2839  {
2840  printf("ERROR: ... reference type %s\n",
2841  pError->m_pRefType->m_pName);
2842  }
2843 
2844  if(NULL != pError->m_pRefField)
2845  {
2846  printf("ERROR: ... reference field %s\n",
2847  pError->m_pRefField->m_pName);
2848  }
2849 
2850  return NULL;
2851  }
2852 
2853  /*
2854  * Print the XML text for the inbound message if
2855  * verbosity is 2 or higher.
2856  */
2857  if(1 < m_Verbose)
2858  {
2859  printf("\n- - - - - - - - - - - - - - - - - -\n");
2860  printf("INFO: Transact received response\n");
2861  printXMLMessage(pRspMsg);
2862  }
2863 
2864  /*
2865  * If it is an ERROR_MESSAGE (response from reader
2866  * when it can't understand the request), tattle
2867  * and declare defeat.
2868  */
2869  if(&CERROR_MESSAGE::s_typeDescriptor == pRspMsg->m_pType)
2870  {
2871  const CTypeDescriptor * pResponseType;
2872 
2873  pResponseType = pSendMsg->m_pType->m_pResponseType;
2874 
2875  printf("ERROR: Received ERROR_MESSAGE instead of %s\n",
2876  pResponseType->m_pName);
2877  delete pRspMsg;
2878  pRspMsg = NULL;
2879  }
2880 
2881  return pRspMsg;
2882 }
2883 
2884 
2909 CMessage *
2910 CMyApplication::recvMessage (
2911  int nMaxMS)
2912 {
2913  CConnection * pConn = m_pConnectionToReader;
2914  CMessage * pMessage;
2915 
2916  /*
2917  * Receive the message subject to a time limit
2918  */
2919  pMessage = pConn->recvMessage(nMaxMS);
2920 
2921  /*
2922  * If LLRP::CConnection::recvMessage() returns NULL then there was
2923  * an error. In that case we try to print the error details.
2924  */
2925  if(NULL == pMessage)
2926  {
2927  const CErrorDetails * pError = pConn->getRecvError();
2928 
2929  /* don't warn on timeout since this is a polling example */
2930  if(pError->m_eResultCode != RC_RecvTimeout)
2931  {
2932  printf("ERROR: recvMessage failed, %s\n",
2933  pError->m_pWhatStr ? pError->m_pWhatStr : "no reason given");
2934  }
2935 
2936  if(NULL != pError->m_pRefType)
2937  {
2938  printf("ERROR: ... reference type %s\n",
2939  pError->m_pRefType->m_pName);
2940  }
2941 
2942  if(NULL != pError->m_pRefField)
2943  {
2944  printf("ERROR: ... reference field %s\n",
2945  pError->m_pRefField->m_pName);
2946  }
2947 
2948  return NULL;
2949  }
2950 
2951  /*
2952  * Print the XML text for the inbound message if
2953  * verbosity is 2 or higher.
2954  */
2955  if(1 < m_Verbose)
2956  {
2957  printf("\n===================================\n");
2958  printf("INFO: Message received\n");
2959  printXMLMessage(pMessage);
2960  }
2961 
2962  return pMessage;
2963 }
2964 
2965 
2983 int
2984 CMyApplication::sendMessage (
2985  CMessage * pSendMsg)
2986 {
2987  CConnection * pConn = m_pConnectionToReader;
2988 
2989  /*
2990  * Print the XML text for the outbound message if
2991  * verbosity is 2 or higher.
2992  */
2993  if(1 < m_Verbose)
2994  {
2995  printf("\n===================================\n");
2996  printf("INFO: Sending\n");
2997  printXMLMessage(pSendMsg);
2998  }
2999 
3000  /*
3001  * If LLRP::CConnection::sendMessage() returns other than RC_OK
3002  * then there was an error. In that case we try to print
3003  * the error details.
3004  */
3005  if(RC_OK != pConn->sendMessage(pSendMsg))
3006  {
3007  const CErrorDetails * pError = pConn->getSendError();
3008 
3009  printf("ERROR: %s sendMessage failed, %s\n",
3010  pSendMsg->m_pType->m_pName,
3011  pError->m_pWhatStr ? pError->m_pWhatStr : "no reason given");
3012 
3013  if(NULL != pError->m_pRefType)
3014  {
3015  printf("ERROR: ... reference type %s\n",
3016  pError->m_pRefType->m_pName);
3017  }
3018 
3019  if(NULL != pError->m_pRefField)
3020  {
3021  printf("ERROR: ... reference field %s\n",
3022  pError->m_pRefField->m_pName);
3023  }
3024 
3025  return -1;
3026  }
3027 
3028  /*
3029  * Victory
3030  */
3031  return 0;
3032 }
3033 
3034 
3048 void
3049 CMyApplication::printXMLMessage (
3050  CMessage * pMessage)
3051 {
3052  char aBuf[100*1024];
3053 
3054  /*
3055  * Convert the message to an XML string.
3056  * This fills the buffer with either the XML string
3057  * or an error message. The return value could
3058  * be checked.
3059  */
3060 
3061  pMessage->toXMLString(aBuf, sizeof aBuf);
3062 
3063  /*
3064  * Print the XML Text to the standard output.
3065  */
3066  printf("%s", aBuf);
3067 }
EResultCode addAntennaConfiguration(CAntennaConfiguration *pValue)
Add a AntennaConfiguration to the LLRP sub-parameter list.
Class Definition CImpinjInventorySearchMode for LLRP parameter ImpinjInventorySearchMode.
Class Definition CROBoundarySpec for LLRP parameter ROBoundarySpec.
Definition: ltkcpp.h:9540
CGeneralDeviceCapabilities * getGeneralDeviceCapabilities(void)
Get accessor functions for the LLRP GeneralDeviceCapabilities sub-parameter.
Definition: ltkcpp.h:2161
void enrollImpinjTypesIntoRegistry(CTypeRegistry *pTypeRegistry)
Enrolls the types for Impinj into the LTKCPP registry.
void setOperationCountValue(llrp_u16_t value)
Set accessor functions for the LLRP OperationCountValue field.
Definition: ltkcpp.h:11756
Class Definition CC1G2EPCMemorySelector for LLRP parameter C1G2EPCMemorySelector. ...
Definition: ltkcpp.h:22828
Class Definition CGET_READER_CAPABILITIES_RESPONSE for LLRP message GET_READER_CAPABILITIES_RESPONSE...
Definition: ltkcpp.h:2099
llrp_u16v_t getTID(void)
Get accessor functions for the LLRP TID field.
EResultCode addAirProtocolEPCMemorySelector(CParameter *pValue)
Add a AirProtocolEPCMemorySelector to the LLRP sub-parameter list.
void setTagData(llrp_u1v_t value)
Set accessor functions for the LLRP TagData field.
Definition: ltkcpp.h:21524
void setDurationTrigger(llrp_u32_t value)
Set accessor functions for the LLRP DurationTrigger field.
Definition: ltkcpp.h:10523
EResultCode setROReportSpec(CROReportSpec *pValue)
Set accessor functions for the LLRP ROReportSpec sub-parameter.
char * m_pName
String name of field (e.g. "ROSpecID")
Definition: ltkcpp_base.h:840
void setAntennaIDs(llrp_u16v_t value)
Set accessor functions for the LLRP AntennaIDs field.
Definition: ltkcpp.h:10303
const CTypeDescriptor * m_pType
The type descriptor desribing this element.
Definition: ltkcpp_base.h:972
EResultCode addCustom(CParameter *pValue)
Add a Custom to the LLRP sub-parameter list.
void setROSpecID(llrp_u32_t value)
Set accessor functions for the LLRP ROSpecID field.
Definition: ltkcpp.h:2922
void setAccessPassword(llrp_u32_t value)
Set accessor functions for the LLRP AccessPassword field.
Definition: ltkcpp.h:21656
Class Definition CAntennaConfiguration for LLRP parameter AntennaConfiguration.
Definition: ltkcpp.h:12905
CLLRPStatus * getLLRPStatus(void)
Get accessor functions for the LLRP LLRPStatus sub-parameter.
Definition: ltkcpp.h:2437
llrp_u8_t * m_pValue
Pointer to the first array element.
Definition: ltkcpp_base.h:443
void setWordPointer(llrp_u16_t value)
Set accessor functions for the LLRP WordPointer field.
Definition: ltkcpp.h:21708
Class Definition CImpinjEnableRFPhaseAngle for LLRP parameter ImpinjEnableRFPhaseAngle.
Class for LLRP basic type u16v (List of unsigned 16-bit values)
Definition: ltkcpp_base.h:179
EResultCode setTagReportContentSelector(CTagReportContentSelector *pValue)
Set accessor functions for the LLRP TagReportContentSelector sub-parameter.
void setEnablePCBits(llrp_u1_t value)
Set accessor functions for the LLRP EnablePCBits field.
Definition: ltkcpp.h:22912
std::list< CTagReportData * >::iterator beginTagReportData(void)
Returns the first element of the TagReportData sub-parameter list.
Definition: ltkcpp.h:6187
EC1G2ReadResultType
Global enumeration EC1G2ReadResultType for LLRP enumerated field C1G2ReadResultType.
Definition: ltkcpp.h:1578
const CFieldDescriptor * m_pRefField
If non-NULL this is the field descriptors for the errored field.
Definition: ltkcpp_base.h:641
CLLRPStatus * getLLRPStatus(void)
Get accessor functions for the LLRP LLRPStatus sub-parameter.
Definition: ltkcpp.h:3773
Class Definition CAccessReportSpec for LLRP parameter AccessReportSpec.
Definition: ltkcpp.h:14159
EImpinjGetQTConfigResultType getResult(void)
Get accessor functions for the LLRP Result field.
void setEnableFirstSeenTimestamp(llrp_u1_t value)
Set accessor functions for the LLRP EnableFirstSeenTimestamp field.
Definition: ltkcpp.h:14003
Class Definition CAISpec for LLRP parameter AISpec.
Definition: ltkcpp.h:10245
void setEnablePeakRSSI(llrp_u1_t value)
Set accessor functions for the LLRP EnablePeakRSSI field.
Definition: ltkcpp.h:13977
Class Definition CImpinjEnableSerializedTID for LLRP parameter ImpinjEnableSerializedTID.
llrp_u16v_t getReadData(void)
Get accessor functions for the LLRP ReadData field.
Definition: ltkcpp.h:23371
void setPriority(llrp_u8_t value)
Set accessor functions for the LLRP Priority field.
Definition: ltkcpp.h:9401
void setOpSpecID(llrp_u16_t value)
Set accessor functions for the LLRP OpSpecID field.
Definition: ltkcpp.h:21837
const CTypeDescriptor * m_pRefType
If non-NULL this is the type descriptors for the errored type.
Definition: ltkcpp_base.h:639
Class Definition CInventoryParameterSpec for LLRP parameter InventoryParameterSpec.
Definition: ltkcpp.h:10807
EResultCode m_eResultCode
Result code from operation.
Definition: ltkcpp_base.h:635
Class for LLRP basic type u96 (96-bit value)
Definition: ltkcpp_base.h:566
CLLRPStatus * getLLRPStatus(void)
Get accessor functions for the LLRP LLRPStatus sub-parameter.
Definition: ltkcpp.h:5847
EResultCode setC1G2RFControl(CC1G2RFControl *pValue)
Set accessor functions for the LLRP C1G2RFControl sub-parameter.
void setAccessRange(EImpinjQTAccessRange value)
Set accessor functions for the LLRP AccessRange field.
void setEnableAccessSpecID(llrp_u1_t value)
Set accessor functions for the LLRP EnableAccessSpecID field.
Definition: ltkcpp.h:14081
Class Definition CSTOP_ROSPEC for LLRP message STOP_ROSPEC.
Definition: ltkcpp.h:2864
void setPeakRSSIMode(EImpinjPeakRSSIMode value)
Set accessor functions for the LLRP PeakRSSIMode field.
llrp_u96_t getEPC(void)
Get accessor functions for the LLRP EPC field.
Definition: ltkcpp.h:14952
void setModeIndex(llrp_u16_t value)
Set accessor functions for the LLRP ModeIndex field.
Definition: ltkcpp.h:20828
Class Definition CSTART_ROSPEC for LLRP message START_ROSPEC.
Definition: ltkcpp.h:2674
EResultCode setAccessSpec(CAccessSpec *pValue)
Set accessor functions for the LLRP AccessSpec sub-parameter.
void setCurrentState(EROSpecState value)
Set accessor functions for the LLRP CurrentState field.
Definition: ltkcpp.h:9427
EC1G2WriteResultType getResult(void)
Get accessor functions for the LLRP Result field.
Definition: ltkcpp.h:23476
EStatusCode getStatusCode(void)
Get accessor functions for the LLRP StatusCode field.
Definition: ltkcpp.h:18940
const char * m_pWhatStr
Descriptive printable error string.
Definition: ltkcpp_base.h:637
EResultCode toXMLString(char *pBuffer, int nBuffer)
A wrapper around LLRP::toXMLString()
Class Definition CImpinjSetQTConfig for LLRP parameter ImpinjSetQTConfig.
EResultCode addAccessCommandOpSpec(CParameter *pValue)
Add a AccessCommandOpSpec to the LLRP sub-parameter list.
CReaderEventNotificationData * getReaderEventNotificationData(void)
Get accessor functions for the LLRP ReaderEventNotificationData sub-parameter.
Definition: ltkcpp.h:6517
Class Definition CROSpecStartTrigger for LLRP parameter ROSpecStartTrigger.
Definition: ltkcpp.h:9648
void setFieldPingInterval(llrp_u16_t value)
Set accessor functions for the LLRP FieldPingInterval field.
Class Definition CEPC_96 for LLRP parameter EPC_96.
Definition: ltkcpp.h:14901
void setEnableChannelIndex(llrp_u1_t value)
Set accessor functions for the LLRP EnableChannelIndex field.
Definition: ltkcpp.h:13951
Class Definition CENABLE_ROSPEC_RESPONSE for LLRP message ENABLE_ROSPEC_RESPONSE. ...
Definition: ltkcpp.h:3152
Class Definition CROReportSpec for LLRP parameter ROReportSpec.
Definition: ltkcpp.h:13599
void usage(char *pProgName)
Print usage message and exit.
Definition: docsample5.cpp:345
EC1G2WriteResultType
Global enumeration EC1G2WriteResultType for LLRP enumerated field C1G2WriteResultType.
Definition: ltkcpp.h:1616
void setAccessReportTrigger(EAccessReportTriggerType value)
Set accessor functions for the LLRP AccessReportTrigger field.
Definition: ltkcpp.h:14217
Class Definition CRO_ACCESS_REPORT for LLRP message RO_ACCESS_REPORT.
Definition: ltkcpp.h:6142
std::list< CParameter * >::iterator endCustom(void)
Returns the last element of the Custom sub-parameter list.
Definition: ltkcpp.h:14745
llrp_u16_t m_nValue
The number of arrray elements.
Definition: ltkcpp_base.h:484
EResultCode addC1G2TargetTag(CC1G2TargetTag *pValue)
Add a C1G2TargetTag to the LLRP sub-parameter list.
int closeConnectionToReader(void)
Close connection to reader, allow reuse of instance.
Class Definition CAccessCommand for LLRP parameter AccessCommand.
Definition: ltkcpp.h:11808
EConnectionAttemptStatusType getStatus(void)
Get accessor functions for the LLRP Status field.
Definition: ltkcpp.h:18764
void setEnableROSpecID(llrp_u1_t value)
Set accessor functions for the LLRP EnableROSpecID field.
Definition: ltkcpp.h:13847
A collection of pointers to CTypeDescriptors.
Definition: ltkcpp_base.h:885
Class Definition CREADER_EVENT_NOTIFICATION for LLRP message READER_EVENT_NOTIFICATION.
Definition: ltkcpp.h:6472
llrp_u16_t getAntennaID(void)
Get accessor functions for the LLRP AntennaID field.
Definition: ltkcpp.h:18666
const CErrorDetails * getTransactError(void)
Get the details that explains transact() error.
void setAntennaID(llrp_u16_t value)
Set accessor functions for the LLRP AntennaID field.
Definition: ltkcpp.h:12963
std::list< CParameter * >::iterator beginCustom(void)
Returns the first element of the Custom sub-parameter list.
Definition: ltkcpp.h:14738
void setAccessPassword(llrp_u32_t value)
Set accessor functions for the LLRP AccessPassword field.
void setPointer(llrp_u16_t value)
Set accessor functions for the LLRP Pointer field.
Definition: ltkcpp.h:21472
EImpinjSetQTConfigResultType
Global enumeration EImpinjSetQTConfigResultType for LLRP enumerated field ImpinjSetQTConfigResultType...
Class Definition CConnectionAttemptEvent for LLRP parameter ConnectionAttemptEvent.
Definition: ltkcpp.h:18713
Class Definition CENABLE_ACCESSSPEC_RESPONSE for LLRP message ENABLE_ACCESSSPEC_RESPONSE.
Definition: ltkcpp.h:4108
void setMB(llrp_u2_t value)
Set accessor functions for the LLRP MB field.
Definition: ltkcpp.h:21889
Class Definition CSTART_ROSPEC_RESPONSE for LLRP message START_ROSPEC_RESPONSE.
Definition: ltkcpp.h:2772
void setOpSpecID(llrp_u16_t value)
Set accessor functions for the LLRP OpSpecID field.
Definition: ltkcpp.h:21630
EResultCode setAccessReportSpec(CAccessReportSpec *pValue)
Set accessor functions for the LLRP AccessReportSpec sub-parameter.
EResultCode setImpinjEnablePeakRSSI(CImpinjEnablePeakRSSI *pValue)
Set accessor functions for the LLRP ImpinjEnablePeakRSSI sub-parameter.
llrp_utf8v_t getReaderFirmwareVersion(void)
Get accessor functions for the LLRP ReaderFirmwareVersion field.
Definition: ltkcpp.h:7315
void setWriteData(llrp_u16v_t value)
Set accessor functions for the LLRP WriteData field.
Definition: ltkcpp.h:21941
void setWordPointer(llrp_u16_t value)
Set accessor functions for the LLRP WordPointer field.
Definition: ltkcpp.h:21915
Class Definition CC1G2Write for LLRP parameter C1G2Write.
Definition: ltkcpp.h:21779
Class Definition CReaderEventNotificationData for LLRP parameter ReaderEventNotificationData.
Definition: ltkcpp.h:17017
void setROSpecID(llrp_u32_t value)
Set accessor functions for the LLRP ROSpecID field.
Definition: ltkcpp.h:2732
EImpinjSetQTConfigResultType getResult(void)
Get accessor functions for the LLRP Result field.
Class Definition CADD_ROSPEC for LLRP message ADD_ROSPEC.
Definition: ltkcpp.h:2303
void setResetToFactoryDefault(llrp_u1_t value)
Set accessor functions for the LLRP ResetToFactoryDefault field.
Definition: ltkcpp.h:5487
CMessage * recvMessage(int nMaxMS)
Receive a message from a connection.
llrp_u16_t m_nValue
The number of arrray elements.
Definition: ltkcpp_base.h:183
Class Definition CTagReportContentSelector for LLRP parameter TagReportContentSelector.
Definition: ltkcpp.h:13789
Class Definition CADD_ROSPEC_RESPONSE for LLRP message ADD_ROSPEC_RESPONSE.
Definition: ltkcpp.h:2392
void setEnableCRC(llrp_u1_t value)
Set accessor functions for the LLRP EnableCRC field.
Definition: ltkcpp.h:22886
void setTari(llrp_u16_t value)
Set accessor functions for the LLRP Tari field.
Definition: ltkcpp.h:20854
Class Definition CADD_ACCESSSPEC_RESPONSE for LLRP message ADD_ACCESSSPEC_RESPONSE.
Definition: ltkcpp.h:3728
File that includes all Impinj Custom extension classes and types.
Class Definition CENABLE_ACCESSSPEC for LLRP message ENABLE_ACCESSSPEC.
Definition: ltkcpp.h:4010
void setROReportTrigger(EROReportTriggerType value)
Set accessor functions for the LLRP ROReportTrigger field.
Definition: ltkcpp.h:13657
void setDurationTriggerValue(llrp_u32_t value)
Set accessor functions for the LLRP DurationTriggerValue field.
Definition: ltkcpp.h:10185
llrp_utf8v_t getErrorDescription(void)
Get accessor functions for the LLRP ErrorDescription field.
Definition: ltkcpp.h:18966
EImpinjQTAccessRange getAccessRange(void)
Get accessor functions for the LLRP AccessRange field.
EResultCode setROSpec(CROSpec *pValue)
Set accessor functions for the LLRP ROSpec sub-parameter.
EImpinjGetQTConfigResultType
Global enumeration EImpinjGetQTConfigResultType for LLRP enumerated field ImpinjGetQTConfigResultType...
CMessage * transact(CMessage *pSendMessage, int nMaxMS)
Transact a LLRP request and response to a connection.
EResultCode addAntennaConfiguration(CAntennaConfiguration *pValue)
Add a AntennaConfiguration to the LLRP sub-parameter list.
Class Definition CGeneralDeviceCapabilities for LLRP parameter GeneralDeviceCapabilities.
Definition: ltkcpp.h:7134
std::list< CParameter * >::iterator endAccessCommandOpSpecResult(void)
Returns the last element of the AccessCommandOpSpecResult sub-parameter list.
Definition: ltkcpp.h:14707
Class Definition CAccessSpec for LLRP parameter AccessSpec.
Definition: ltkcpp.h:11377
Class Definition CImpinjGetQTConfig for LLRP parameter ImpinjGetQTConfig.
Class Definition CAntennaEvent for LLRP parameter AntennaEvent.
Definition: ltkcpp.h:18589
const CErrorDetails * getRecvError(void)
Get the details that explains recvMessage() or recvResponse() error.
Class for LLRP basic type utf8v (vector of utf-8 encoded characters)
Definition: ltkcpp_base.h:480
EResultCode setImpinjEnableRFPhaseAngle(CImpinjEnableRFPhaseAngle *pValue)
Set accessor functions for the LLRP ImpinjEnableRFPhaseAngle sub-parameter.
void setPersistence(EImpinjQTPersistence value)
Set accessor functions for the LLRP Persistence field.
llrp_u16_t m_nBit
The number of arrray elements.
Definition: ltkcpp_base.h:441
EResultCode setC1G2SingulationControl(CC1G2SingulationControl *pValue)
Set accessor functions for the LLRP C1G2SingulationControl sub-parameter.
Class for LLRP basic type u1v (vector of unsigned 1-bit values)
Definition: ltkcpp_base.h:437
Class Definition CENABLE_ROSPEC for LLRP message ENABLE_ROSPEC.
Definition: ltkcpp.h:3054
Class Definition CImpinjTagReportContentSelector for LLRP parameter ImpinjTagReportContentSelector.
int openConnectionToReader(const char *pReaderHostName)
Open a connection to the reader over an unencrypted socket.
void setSerializedTIDMode(EImpinjSerializedTIDMode value)
Set accessor functions for the LLRP SerializedTIDMode field.
void setProtocolID(EAirProtocols value)
Set accessor functions for the LLRP ProtocolID field.
Definition: ltkcpp.h:10891
Class Definition CC1G2TargetTag for LLRP parameter C1G2TargetTag.
Definition: ltkcpp.h:21362
void setOpSpecID(llrp_u16_t value)
Set accessor functions for the LLRP OpSpecID field.
CLLRPStatus * getLLRPStatus(void)
Get accessor functions for the LLRP LLRPStatus sub-parameter.
Definition: ltkcpp.h:3007
EResultCode setAccessSpecStopTrigger(CAccessSpecStopTrigger *pValue)
Set accessor functions for the LLRP AccessSpecStopTrigger sub-parameter.
EResultCode addSpecParameter(CParameter *pValue)
Add a SpecParameter to the LLRP sub-parameter list.
Class Definition CLLRPStatus for LLRP parameter LLRPStatus.
Definition: ltkcpp.h:18889
void setEnableSpecIndex(llrp_u1_t value)
Set accessor functions for the LLRP EnableSpecIndex field.
Definition: ltkcpp.h:13873
const CTypeDescriptor * m_pResponseType
For messages (bIsMessage==TRUE), this is the type descriptor for the corresponding response...
Definition: ltkcpp_base.h:776
EResultCode addAirProtocolInventoryCommandSettings(CParameter *pValue)
Add a AirProtocolInventoryCommandSettings to the LLRP sub-parameter list.
Class Definition CC1G2SingulationControl for LLRP parameter C1G2SingulationControl.
Definition: ltkcpp.h:20948
void setROSpecID(llrp_u32_t value)
Set accessor functions for the LLRP ROSpecID field.
Definition: ltkcpp.h:11539
void setOpSpecID(llrp_u16_t value)
Set accessor functions for the LLRP OpSpecID field.
Class Definition CC1G2RFControl for LLRP parameter C1G2RFControl.
Definition: ltkcpp.h:20770
Class Definition CSTOP_ROSPEC_RESPONSE for LLRP message STOP_ROSPEC_RESPONSE.
Definition: ltkcpp.h:2962
Class Definition CImpinjSetQTConfigOpSpecResult for LLRP parameter ImpinjSetQTConfigOpSpecResult.
void setROSpecID(llrp_u32_t value)
Set accessor functions for the LLRP ROSpecID field.
Definition: ltkcpp.h:3112
CReaderExceptionEvent * getReaderExceptionEvent(void)
Get accessor functions for the LLRP ReaderExceptionEvent sub-parameter.
Definition: ltkcpp.h:17164
void setN(llrp_u16_t value)
Set accessor functions for the LLRP N field.
Definition: ltkcpp.h:13683
void setAntennaID(llrp_u16_t value)
Set accessor functions for the LLRP AntennaID field.
Definition: ltkcpp.h:11461
EResultCode sendMessage(CMessage *pMessage)
Send a LLRP message to a connection.
CParameter * getEPCParameter(void)
Get accessor functions for the LLRP EPCParameter sub-parameter.
Definition: ltkcpp.h:14441
Class to return error details in LTKCPP operations.
Definition: ltkcpp_base.h:631
void setLowDutyCycleMode(EImpinjLowDutyCycleMode value)
Set accessor functions for the LLRP LowDutyCycleMode field.
void setMB(llrp_u2_t value)
Set accessor functions for the LLRP MB field.
Definition: ltkcpp.h:21682
Class Definition CROSpec for LLRP parameter ROSpec.
Definition: ltkcpp.h:9317
EResultCode setROBoundarySpec(CROBoundarySpec *pValue)
Set accessor functions for the LLRP ROBoundarySpec sub-parameter.
char * m_pName
String name of parameter/message type (e.g. "ROSpec")
Definition: ltkcpp_base.h:762
Class Definition CC1G2InventoryCommand for LLRP parameter C1G2InventoryCommand.
Definition: ltkcpp.h:19981
Class Definition CImpinjLowDutyCycle for LLRP parameter ImpinjLowDutyCycle.
EResultCode setAirProtocolTagSpec(CParameter *pValue)
Set accessor functions for the LLRP AirProtocolTagSpec sub-parameter.
void setAccessPassword(llrp_u32_t value)
Set accessor functions for the LLRP AccessPassword field.
Definition: ltkcpp.h:21863
File that includes all LLRP classes and types.
Class Definition CEPCData for LLRP parameter EPCData.
Definition: ltkcpp.h:14803
CLLRPStatus * getLLRPStatus(void)
Get accessor functions for the LLRP LLRPStatus sub-parameter.
Definition: ltkcpp.h:3197
void setAccessSpecID(llrp_u32_t value)
Set accessor functions for the LLRP AccessSpecID field.
Definition: ltkcpp.h:11435
Class Definition CSET_READER_CONFIG for LLRP message SET_READER_CONFIG.
Definition: ltkcpp.h:5429
void setEnableAntennaID(llrp_u1_t value)
Set accessor functions for the LLRP EnableAntennaID field.
Definition: ltkcpp.h:13925
void setTagInventoryStateAware(llrp_u1_t value)
Set accessor functions for the LLRP TagInventoryStateAware field.
Definition: ltkcpp.h:20039
Class Definition CImpinjGetQTConfigOpSpecResult for LLRP parameter ImpinjGetQTConfigOpSpecResult.
void setSession(llrp_u2_t value)
Set accessor functions for the LLRP Session field.
Definition: ltkcpp.h:21006
CLLRPStatus * getLLRPStatus(void)
Get accessor functions for the LLRP LLRPStatus sub-parameter.
Definition: ltkcpp.h:2144
void setROSpecStopTriggerType(EROSpecStopTriggerType value)
Set accessor functions for the LLRP ROSpecStopTriggerType field.
Definition: ltkcpp.h:10159
std::list< CParameter * >::iterator beginAccessCommandOpSpecResult(void)
Returns the first element of the AccessCommandOpSpecResult sub-parameter list.
Definition: ltkcpp.h:14700
llrp_u1v_t getEPC(void)
Get accessor functions for the LLRP EPC field.
Definition: ltkcpp.h:14854
void setRequestedData(EGetReaderCapabilitiesRequestedData value)
Set accessor functions for the LLRP RequestedData field.
Definition: ltkcpp.h:2016
EC1G2ReadResultType getResult(void)
Get accessor functions for the LLRP Result field.
Definition: ltkcpp.h:23319
void setProtocolID(EAirProtocols value)
Set accessor functions for the LLRP ProtocolID field.
Definition: ltkcpp.h:11487
llrp_u16_t * m_pValue
Pointer to the first array element.
Definition: ltkcpp_base.h:185
Class Definition CAccessSpecStopTrigger for LLRP parameter AccessSpecStopTrigger. ...
Definition: ltkcpp.h:11672
void setWordCount(llrp_u16_t value)
Set accessor functions for the LLRP WordCount field.
Definition: ltkcpp.h:21734
CLLRPStatus * getLLRPStatus(void)
Get accessor functions for the LLRP LLRPStatus sub-parameter.
Definition: ltkcpp.h:4153
EResultCode setROSpecStopTrigger(CROSpecStopTrigger *pValue)
Set accessor functions for the LLRP ROSpecStopTrigger sub-parameter.
llrp_u8_t m_aValue[12]
Simple array of basic type llrp_u8_t.
Definition: ltkcpp_base.h:570
void setInventoryParameterSpecID(llrp_u16_t value)
Set accessor functions for the LLRP InventoryParameterSpecID field.
Definition: ltkcpp.h:10865
CLLRPStatus * getLLRPStatus(void)
Get accessor functions for the LLRP LLRPStatus sub-parameter.
Definition: ltkcpp.h:2817
Class Definition CC1G2ReadOpSpecResult for LLRP parameter C1G2ReadOpSpecResult.
Definition: ltkcpp.h:23268
int main(int ac, char *av[])
Command main routine.
Definition: docsample5.cpp:248
void setMB(llrp_u2_t value)
Set accessor functions for the LLRP MB field.
Definition: ltkcpp.h:21420
Base Class for All LLRP LTK Parameters.
Definition: ltkcpp_base.h:1125
Base Class for All LLRP LTK Messages.
Definition: ltkcpp_base.h:1088
EResultCode setROSpecStartTrigger(CROSpecStartTrigger *pValue)
Set accessor functions for the LLRP ROSpecStartTrigger sub-parameter.
Class Definition CIMPINJ_ENABLE_EXTENSIONS_RESPONSE for LLRP message IMPINJ_ENABLE_EXTENSIONS_RESPONS...
std::list< CTagReportData * >::iterator endTagReportData(void)
Returns the last element of the TagReportData sub-parameter list.
Definition: ltkcpp.h:6194
llrp_utf8v_t getMessage(void)
Get accessor functions for the LLRP Message field.
Definition: ltkcpp.h:17979
const char * getConnectError(void)
Get the string that explains openReaderConnection() error.
Class Definition CC1G2Read for LLRP parameter C1G2Read.
Definition: ltkcpp.h:21572
void setTagTransitTime(llrp_u32_t value)
Set accessor functions for the LLRP TagTransitTime field.
Definition: ltkcpp.h:21058
EResultCode addCustom(CParameter *pValue)
Add a Custom to the LLRP sub-parameter list.
Class Definition CSET_READER_CONFIG_RESPONSE for LLRP message SET_READER_CONFIG_RESPONSE.
Definition: ltkcpp.h:5802
Class Definition CIMPINJ_ENABLE_EXTENSIONS for LLRP message IMPINJ_ENABLE_EXTENSIONS.
Class Definition CImpinjSerializedTID for LLRP parameter ImpinjSerializedTID.
Class Definition CReaderExceptionEvent for LLRP parameter ReaderExceptionEvent.
Definition: ltkcpp.h:17928
CAntennaEvent * getAntennaEvent(void)
Get accessor functions for the LLRP AntennaEvent sub-parameter.
Definition: ltkcpp.h:17215
void setCurrentState(EAccessSpecState value)
Set accessor functions for the LLRP CurrentState field.
Definition: ltkcpp.h:11513
void setEnableLastSeenTimestamp(llrp_u1_t value)
Set accessor functions for the LLRP EnableLastSeenTimestamp field.
Definition: ltkcpp.h:14029
void setEnableTagSeenCount(llrp_u1_t value)
Set accessor functions for the LLRP EnableTagSeenCount field.
Definition: ltkcpp.h:14055
void setRFPhaseAngleMode(EImpinjRFPhaseAngleMode value)
Set accessor functions for the LLRP RFPhaseAngleMode field.
void setROSpecID(llrp_u32_t value)
Set accessor functions for the LLRP ROSpecID field.
Definition: ltkcpp.h:9375
EImpinjQTDataProfile getDataProfile(void)
Get accessor functions for the LLRP DataProfile field.
Class Definition CTagReportData for LLRP parameter TagReportData.
Definition: ltkcpp.h:14396
void setMessageID(llrp_u32_t MessageID)
Sets the LLRP Message ID for the Message.
Definition: ltkcpp_base.h:1097
llrp_u32_t getDeviceManufacturerName(void)
Get accessor functions for the LLRP DeviceManufacturerName field.
Definition: ltkcpp.h:7263
void setAISpecStopTriggerType(EAISpecStopTriggerType value)
Set accessor functions for the LLRP AISpecStopTriggerType field.
Definition: ltkcpp.h:10497
Class Definition CC1G2WriteOpSpecResult for LLRP parameter C1G2WriteOpSpecResult. ...
Definition: ltkcpp.h:23425
void setMatch(llrp_u1_t value)
Set accessor functions for the LLRP Match field.
Definition: ltkcpp.h:21446
Class Definition CADD_ACCESSSPEC for LLRP message ADD_ACCESSSPEC.
Definition: ltkcpp.h:3639
Class Definition CAISpecStopTrigger for LLRP parameter AISpecStopTrigger.
Definition: ltkcpp.h:10439
void setAccessPassword(llrp_u32_t value)
Set accessor functions for the LLRP AccessPassword field.
CLLRPStatus * getLLRPStatus(void)
Get accessor functions for the LLRP LLRPStatus sub-parameter.
void setTagMask(llrp_u1v_t value)
Set accessor functions for the LLRP TagMask field.
Definition: ltkcpp.h:21498
EResultCode addInventoryParameterSpec(CInventoryParameterSpec *pValue)
Add a InventoryParameterSpec to the LLRP sub-parameter list.
Class Definition CImpinjEnablePeakRSSI for LLRP parameter ImpinjEnablePeakRSSI.
void setDataProfile(EImpinjQTDataProfile value)
Set accessor functions for the LLRP DataProfile field.
void setEmptyFieldTimeout(llrp_u16_t value)
Set accessor functions for the LLRP EmptyFieldTimeout field.
EImpinjQTAccessRange
Global enumeration EImpinjQTAccessRange for LLRP enumerated field ImpinjQTAccessRange.
void setTagPopulation(llrp_u16_t value)
Set accessor functions for the LLRP TagPopulation field.
Definition: ltkcpp.h:21032
LLRP connection class.
EAntennaEventType
Global enumeration EAntennaEventType for LLRP enumerated field AntennaEventType.
Definition: ltkcpp.h:1041
Class Definition CGET_READER_CAPABILITIES for LLRP message GET_READER_CAPABILITIES.
Definition: ltkcpp.h:1958
void setEnableInventoryParameterSpecID(llrp_u1_t value)
Set accessor functions for the LLRP EnableInventoryParameterSpecID field.
Definition: ltkcpp.h:13899
EResultCode setAccessCommand(CAccessCommand *pValue)
Set accessor functions for the LLRP AccessCommand sub-parameter.
CConnectionAttemptEvent * getConnectionAttemptEvent(void)
Get accessor functions for the LLRP ConnectionAttemptEvent sub-parameter.
Definition: ltkcpp.h:17232
llrp_utf8_t * m_pValue
Pointer to the first array element.
Definition: ltkcpp_base.h:486
void setAccessSpecID(llrp_u32_t value)
Set accessor functions for the LLRP AccessSpecID field.
Definition: ltkcpp.h:4068
EAntennaEventType getEventType(void)
Get accessor functions for the LLRP EventType field.
Definition: ltkcpp.h:18640
EResultCode setImpinjEnableSerializedTID(CImpinjEnableSerializedTID *pValue)
Set accessor functions for the LLRP ImpinjEnableSerializedTID sub-parameter.
EResultCode setAISpecStopTrigger(CAISpecStopTrigger *pValue)
Set accessor functions for the LLRP AISpecStopTrigger sub-parameter.
void setInventorySearchMode(EImpinjInventorySearchType value)
Set accessor functions for the LLRP InventorySearchMode field.
Class Definition CC1G2TagSpec for LLRP parameter C1G2TagSpec.
Definition: ltkcpp.h:21247
Describes a message or parameter type.
Definition: ltkcpp_base.h:755
void setROSpecStartTriggerType(EROSpecStartTriggerType value)
Set accessor functions for the LLRP ROSpecStartTriggerType field.
Definition: ltkcpp.h:9706
Class Definition CROSpecStopTrigger for LLRP parameter ROSpecStopTrigger.
Definition: ltkcpp.h:10101
const CErrorDetails * getSendError(void)
Get the details that explains sendMessage() error.
void setAccessSpecStopTrigger(EAccessSpecStopTriggerType value)
Set accessor functions for the LLRP AccessSpecStopTrigger field.
Definition: ltkcpp.h:11730