LTKCPP-- LLRP Toolkit C Plus Plus Library
docsample1.cpp
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,2009. All rights reserved. *
12  * *
13  *****************************************************************************/
14 
44 #include <stdio.h>
45 #include "ltkcpp.h"
46 #include "impinj_ltkcpp.h"
47 #include "time.h"
48 
49 using namespace LLRP;
50 
51 /*
52 ** Sorry, we use this linux safe method
53 ** to print buffers. WIndows has the same
54 ** method, but by a different name
55 */
56 #if (WIN32)
57 #define snprintf _snprintf
58 #endif
59 
60 class CMyApplication
61 {
62  unsigned int m_messageID;
63 
64  public:
66  int m_Verbose;
67 
69  CConnection * m_pConnectionToReader;
70 
71  inline
72  CMyApplication (void)
73  : m_Verbose(0), m_pConnectionToReader(NULL)
74  {
75  m_messageID = 0;
76  }
77 
78  int
79  run (
80  char * pReaderHostName);
81 
82  int
83  checkConnectionStatus (void);
84 
85  int
86  enableImpinjExtensions (void);
87 
88  int
89  resetConfigurationToFactoryDefaults (void);
90 
91  int
92  addROSpec (void);
93 
94  int
95  enableROSpec (void);
96 
97  int
98  startROSpec (void);
99 
100  int
101  stopROSpec (void);
102 
103  int
104  awaitAndPrintReport (int timeoutSec);
105 
106  void
107  printTagReportData (
108  CRO_ACCESS_REPORT * pRO_ACCESS_REPORT);
109 
110  void
111  printOneTagReportData (
112  CTagReportData * pTagReportData);
113 
114  void
115  formatOneEPC (
116  CParameter * pEpcParameter,
117  char * buf,
118  int buflen);
119 
120  void
121  handleReaderEventNotification (
122  CReaderEventNotificationData *pNtfData);
123 
124  void
125  handleAntennaEvent (
126  CAntennaEvent * pAntennaEvent);
127 
128  void
129  handleReaderExceptionEvent (
130  CReaderExceptionEvent * pReaderExceptionEvent);
131 
132  int
133  checkLLRPStatus (
134  CLLRPStatus * pLLRPStatus,
135  char * pWhatStr);
136 
137  CMessage *
138  transact (
139  CMessage * pSendMsg);
140 
141  CMessage *
142  recvMessage (
143  int nMaxMS);
144 
145  int
146  sendMessage (
147  CMessage * pSendMsg);
148 
149  void
150  printXMLMessage (
151  CMessage * pMessage);
152 };
153 
154 
155 /* BEGIN forward declarations */
156 int
157 main (
158  int ac,
159  char * av[]);
160 
161 void
162 usage (
163  char * pProgName);
164 /* END forward declarations */
165 
166 
182 int
183 main (
184  int ac,
185  char * av[])
186 {
187  CMyApplication myApp;
188  char * pReaderHostName;
189  int rc;
190 
191  /*
192  * Process comand arguments, determine reader name
193  * and verbosity level.
194  */
195  if(ac == 2)
196  {
197  pReaderHostName = av[1];
198  }
199  else if(ac == 3)
200  {
201  char * p = av[1];
202 
203  while(*p)
204  {
205  switch(*p++)
206  {
207  case '-': /* linux conventional option warn char */
208  case '/': /* Windows/DOS conventional option warn char */
209  break;
210 
211  case 'v':
212  case 'V':
213  myApp.m_Verbose++;
214  break;
215 
216  default:
217  usage(av[0]);
218  /* no return */
219  break;
220  }
221  }
222 
223  pReaderHostName = av[2];
224  }
225  else
226  {
227  usage(av[0]);
228  /* no return */
229  }
230 
231  /*
232  * Run application, capture return value for exit status
233  */
234  rc = myApp.run(pReaderHostName);
235 
236  printf("INFO: Done\n");
237 
238  /*
239  * Exit with the right status.
240  */
241  if(0 == rc)
242  {
243  exit(0);
244  }
245  else
246  {
247  exit(2);
248  }
249  /*NOTREACHED*/
250 }
251 
252 
264 void
265 usage (
266  char * pProgName)
267 {
268 #ifdef linux
269  printf("Usage: %s [-v[v]] READERHOSTNAME\n", pProgName);
270  printf("\n");
271  printf("Each -v increases verbosity level\n");
272 #endif /* linux */
273 #ifdef WIN32
274  printf("Usage: %s [/v[v]] READERHOSTNAME\n", pProgName);
275  printf("\n");
276  printf("Each /v increases verbosity level\n");
277 #endif /* WIN32 */
278  exit(1);
279 }
280 
281 
315 int
316 CMyApplication::run (
317  char * pReaderHostName)
318 {
319  CTypeRegistry * pTypeRegistry;
320  CConnection * pConn;
321  int rc;
322 
323  /*
324  * Allocate the type registry. This is needed
325  * by the connection to decode.
326  */
327  pTypeRegistry = getTheTypeRegistry();
328  if(NULL == pTypeRegistry)
329  {
330  printf("ERROR: getTheTypeRegistry failed\n");
331  return -1;
332  }
333 
334  /*
335  * Enroll impinj extension types into the
336  * type registry, in preparation for using
337  * Impinj extension params.
338  */
340 
341  /*
342  * Construct a connection (LLRP::CConnection).
343  * Using a 32kb max frame size for send/recv.
344  * The connection object is ready for business
345  * but not actually connected to the reader yet.
346  */
347  pConn = new CConnection(pTypeRegistry, 32u*1024u);
348  if(NULL == pConn)
349  {
350  printf("ERROR: new CConnection failed\n");
351  return -2;
352  }
353 
354  /*
355  * Open the connection to the reader
356  */
357  if(m_Verbose)
358  {
359  printf("INFO: Connecting to %s....\n", pReaderHostName);
360  }
361 
362  rc = pConn->openConnectionToReader(pReaderHostName);
363  if(0 != rc)
364  {
365  printf("ERROR: connect: %s (%d)\n", pConn->getConnectError(), rc);
366  delete pConn;
367  return -3;
368  }
369 
370  /*
371  * Record the pointer to the connection object so other
372  * routines can use it.
373  */
374  m_pConnectionToReader = pConn;
375 
376  if(m_Verbose)
377  {
378  printf("INFO: Connected, checking status....\n");
379  }
380 
381  /*
382  * Commence the sequence and check for errors as we go.
383  * See comments for each routine for details.
384  * Each routine prints messages.
385  */
386  rc = 1;
387  if(0 == checkConnectionStatus())
388  {
389  rc = 2;
390  if(0 == enableImpinjExtensions())
391  {
392  rc = 3;
393  if(0 == resetConfigurationToFactoryDefaults())
394  {
395  rc = 4;
396  if(0 == addROSpec())
397  {
398  rc = 5;
399  if(0 == enableROSpec())
400  {
401  rc = 6;
402  if(0 == startROSpec())
403  {
404  rc = 7;
405  if(0 == awaitAndPrintReport(10))
406  {
407  rc = 8;
408  if(0 == stopROSpec())
409  {
410  rc = 0;
411  }
412  }
413  }
414  }
415  }
416  }
417 
418  /*
419  * After we're done, try to leave the reader
420  * in a clean state for next use. This is best
421  * effort and no checking of the result is done.
422  */
423  if(m_Verbose)
424  {
425  printf("INFO: Clean up reader configuration...\n");
426  }
427  resetConfigurationToFactoryDefaults();
428  }
429  }
430 
431  if(m_Verbose)
432  {
433  printf("INFO: Finished\n");
434  }
435 
436  /*
437  * Close the connection and release its resources
438  */
439  pConn->closeConnectionToReader();
440  delete pConn;
441 
442  /*
443  * Done with the registry.
444  */
445  delete pTypeRegistry;
446 
447  /*
448  * When we get here all allocated memory should have been deallocated.
449  */
450 
451  return rc;
452 }
453 
454 
485 int
486 CMyApplication::checkConnectionStatus (void)
487 {
488  CMessage * pMessage;
491  CConnectionAttemptEvent * pEvent;
492 
493  /*
494  * Expect the notification within 10 seconds.
495  * It is suppose to be the very first message sent.
496  */
497  pMessage = recvMessage(10000);
498 
499  /*
500  * recvMessage() returns NULL if something went wrong.
501  */
502  if(NULL == pMessage)
503  {
504  /* recvMessage already tattled */
505  goto fail;
506  }
507 
508  /*
509  * Check to make sure the message is of the right type.
510  * The type label (pointer) in the message should be
511  * the type descriptor for READER_EVENT_NOTIFICATION.
512  */
513  if(&CREADER_EVENT_NOTIFICATION::s_typeDescriptor != pMessage->m_pType)
514  {
515  goto fail;
516  }
517 
518  /*
519  * Now that we are sure it is a READER_EVENT_NOTIFICATION,
520  * traverse to the ReaderEventNotificationData parameter.
521  */
522  pNtf = (CREADER_EVENT_NOTIFICATION *) pMessage;
523  pNtfData = pNtf->getReaderEventNotificationData();
524  if(NULL == pNtfData)
525  {
526  goto fail;
527  }
528 
529  /*
530  * The ConnectionAttemptEvent parameter must be present.
531  */
532  pEvent = pNtfData->getConnectionAttemptEvent();
533  if(NULL == pEvent)
534  {
535  goto fail;
536  }
537 
538  /*
539  * The status in the ConnectionAttemptEvent parameter
540  * must indicate connection success.
541  */
542  if(ConnectionAttemptStatusType_Success != pEvent->getStatus())
543  {
544  goto fail;
545  }
546 
547  /*
548  * Done with the message
549  */
550  delete pMessage;
551 
552  if(m_Verbose)
553  {
554  printf("INFO: Connection status OK\n");
555  }
556 
557  /*
558  * Victory.
559  */
560  return 0;
561 
562  fail:
563  /*
564  * Something went wrong. Tattle. Clean up. Return error.
565  */
566  printf("ERROR: checkConnectionStatus failed\n");
567  delete pMessage;
568  return -1;
569 }
570 
588 int
589 CMyApplication::enableImpinjExtensions (void)
590 {
592  CMessage * pRspMsg;
594 
595  /*
596  * Compose the command message
597  */
598  pCmd = new CIMPINJ_ENABLE_EXTENSIONS();
599  pCmd->setMessageID(m_messageID++);
600  /*
601  * Send the message, expect the response of certain type
602  */
603  pRspMsg = transact(pCmd);
604 
605  /*
606  * Done with the command message
607  */
608  delete pCmd;
609 
610  /*
611  * transact() returns NULL if something went wrong.
612  */
613  if(NULL == pRspMsg)
614  {
615  /* transact already tattled */
616  return -1;
617  }
618 
619  /*
620  * Cast to a CIMPINJ_ENABLE_EXTENSIONS_RESPONSE message.
621  */
622  pRsp = (CIMPINJ_ENABLE_EXTENSIONS_RESPONSE *) pRspMsg;
623 
624  /*
625  * Check the LLRPStatus parameter.
626  */
627  if(0 != checkLLRPStatus(pRsp->getLLRPStatus(),
628  "enableImpinjExtensions"))
629  {
630  /* checkLLRPStatus already tattled */
631  delete pRspMsg;
632  return -1;
633  }
634 
635  /*
636  * Done with the response message.
637  */
638  delete pRspMsg;
639 
640  /*
641  * Tattle progress, maybe
642  */
643  if(m_Verbose)
644  {
645  printf("INFO: Impinj Extensions are enabled\n");
646  }
647 
648  /*
649  * Victory.
650  */
651  return 0;
652 }
653 
674 int
675 CMyApplication::resetConfigurationToFactoryDefaults (void)
676 {
677  CSET_READER_CONFIG * pCmd;
678  CMessage * pRspMsg;
680 
681  /*
682  * Compose the command message
683  */
684  pCmd = new CSET_READER_CONFIG();
685  pCmd->setMessageID(m_messageID++);
686  pCmd->setResetToFactoryDefault(1);
687 
688  /*
689  * Send the message, expect the response of certain type
690  */
691  pRspMsg = transact(pCmd);
692 
693  /*
694  * Done with the command message
695  */
696  delete pCmd;
697 
698  /*
699  * transact() returns NULL if something went wrong.
700  */
701  if(NULL == pRspMsg)
702  {
703  /* transact already tattled */
704  return -1;
705  }
706 
707  /*
708  * Cast to a SET_READER_CONFIG_RESPONSE message.
709  */
710  pRsp = (CSET_READER_CONFIG_RESPONSE *) pRspMsg;
711 
712  /*
713  * Check the LLRPStatus parameter.
714  */
715  if(0 != checkLLRPStatus(pRsp->getLLRPStatus(),
716  "resetConfigurationToFactoryDefaults"))
717  {
718  /* checkLLRPStatus already tattled */
719  delete pRspMsg;
720  return -1;
721  }
722 
723  /*
724  * Done with the response message.
725  */
726  delete pRspMsg;
727 
728  /*
729  * Tattle progress, maybe
730  */
731  if(m_Verbose)
732  {
733  printf("INFO: Configuration reset to factory defaults\n");
734  }
735 
736  /*
737  * Victory.
738  */
739  return 0;
740 }
741 
742 
790 int
791 CMyApplication::addROSpec (void)
792 {
793  CROSpecStartTrigger * pROSpecStartTrigger =
794  new CROSpecStartTrigger();
795  pROSpecStartTrigger->setROSpecStartTriggerType(
796  ROSpecStartTriggerType_Null);
797 
798  CROSpecStopTrigger * pROSpecStopTrigger = new CROSpecStopTrigger();
799  pROSpecStopTrigger->setROSpecStopTriggerType(ROSpecStopTriggerType_Null);
800  pROSpecStopTrigger->setDurationTriggerValue(0); /* n/a */
801 
802  CROBoundarySpec * pROBoundarySpec = new CROBoundarySpec();
803  pROBoundarySpec->setROSpecStartTrigger(pROSpecStartTrigger);
804  pROBoundarySpec->setROSpecStopTrigger(pROSpecStopTrigger);
805 
806  CAISpecStopTrigger * pAISpecStopTrigger = new CAISpecStopTrigger();
807  pAISpecStopTrigger->setAISpecStopTriggerType(
808  AISpecStopTriggerType_Null);
809  pAISpecStopTrigger->setDurationTrigger(0);
810 
811  CInventoryParameterSpec * pInventoryParameterSpec =
813  pInventoryParameterSpec->setInventoryParameterSpecID(1234);
814  pInventoryParameterSpec->setProtocolID(AirProtocols_EPCGlobalClass1Gen2);
815 
816  llrp_u16v_t AntennaIDs = llrp_u16v_t(1);
817  AntennaIDs.m_pValue[0] = 0; /* All */
818 
819  CAISpec * pAISpec = new CAISpec();
820  pAISpec->setAntennaIDs(AntennaIDs);
821  pAISpec->setAISpecStopTrigger(pAISpecStopTrigger);
822  pAISpec->addInventoryParameterSpec(pInventoryParameterSpec);
823 
824  CROSpec * pROSpec = new CROSpec();
825  pROSpec->setROSpecID(1111);
826  pROSpec->setPriority(0);
827  pROSpec->setCurrentState(ROSpecState_Disabled);
828  pROSpec->setROBoundarySpec(pROBoundarySpec);
829  pROSpec->addSpecParameter(pAISpec);
830 
831  CADD_ROSPEC * pCmd;
832  CMessage * pRspMsg;
833  CADD_ROSPEC_RESPONSE * pRsp;
834 
835  /*
836  * Compose the command message.
837  * N.B.: After the message is composed, all the parameters
838  * constructed, immediately above, are considered "owned"
839  * by the command message. When it is destructed so
840  * too will the parameters be.
841  */
842  pCmd = new CADD_ROSPEC();
843  pCmd->setMessageID(m_messageID++);
844  pCmd->setROSpec(pROSpec);
845 
846  /*
847  * Send the message, expect the response of certain type
848  */
849  pRspMsg = transact(pCmd);
850 
851  /*
852  * Done with the command message.
853  * N.B.: And the parameters
854  */
855  delete pCmd;
856 
857  /*
858  * transact() returns NULL if something went wrong.
859  */
860  if(NULL == pRspMsg)
861  {
862  /* transact already tattled */
863  return -1;
864  }
865 
866  /*
867  * Cast to a ADD_ROSPEC_RESPONSE message.
868  */
869  pRsp = (CADD_ROSPEC_RESPONSE *) pRspMsg;
870 
871  /*
872  * Check the LLRPStatus parameter.
873  */
874  if(0 != checkLLRPStatus(pRsp->getLLRPStatus(), "addROSpec"))
875  {
876  /* checkLLRPStatus already tattled */
877  delete pRspMsg;
878  return -1;
879  }
880 
881  /*
882  * Done with the response message.
883  */
884  delete pRspMsg;
885 
886  /*
887  * Tattle progress, maybe
888  */
889  if(m_Verbose)
890  {
891  printf("INFO: ROSpec added\n");
892  }
893 
894  /*
895  * Victory.
896  */
897  return 0;
898 }
899 
900 
918 int
919 CMyApplication::enableROSpec (void)
920 {
921  CENABLE_ROSPEC * pCmd;
922  CMessage * pRspMsg;
924 
925  /*
926  * Compose the command message
927  */
928  pCmd = new CENABLE_ROSPEC();
929  pCmd->setMessageID(m_messageID++);
930  pCmd->setROSpecID(1111);
931 
932  /*
933  * Send the message, expect the response of certain type
934  */
935  pRspMsg = transact(pCmd);
936 
937  /*
938  * Done with the command message
939  */
940  delete pCmd;
941 
942  /*
943  * transact() returns NULL if something went wrong.
944  */
945  if(NULL == pRspMsg)
946  {
947  /* transact already tattled */
948  return -1;
949  }
950 
951  /*
952  * Cast to a ENABLE_ROSPEC_RESPONSE message.
953  */
954  pRsp = (CENABLE_ROSPEC_RESPONSE *) pRspMsg;
955 
956  /*
957  * Check the LLRPStatus parameter.
958  */
959  if(0 != checkLLRPStatus(pRsp->getLLRPStatus(), "enableROSpec"))
960  {
961  /* checkLLRPStatus already tattled */
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: ROSpec enabled\n");
977  }
978 
979  /*
980  * Victory.
981  */
982  return 0;
983 }
984 
985 
1003 int
1004 CMyApplication::startROSpec (void)
1005 {
1006  CSTART_ROSPEC * pCmd;
1007  CMessage * pRspMsg;
1008  CSTART_ROSPEC_RESPONSE * pRsp;
1009 
1010  /*
1011  * Compose the command message
1012  */
1013  pCmd = new CSTART_ROSPEC();
1014  pCmd->setMessageID(m_messageID++);
1015  pCmd->setROSpecID(1111);
1016 
1017  /*
1018  * Send the message, expect the response of certain type
1019  */
1020  pRspMsg = transact(pCmd);
1021 
1022  /*
1023  * Done with the command message
1024  */
1025  delete pCmd;
1026 
1027  /*
1028  * transact() returns NULL if something went wrong.
1029  */
1030  if(NULL == pRspMsg)
1031  {
1032  /* transact already tattled */
1033  return -1;
1034  }
1035 
1036  /*
1037  * Cast to a START_ROSPEC_RESPONSE message.
1038  */
1039  pRsp = (CSTART_ROSPEC_RESPONSE *) pRspMsg;
1040 
1041  /*
1042  * Check the LLRPStatus parameter.
1043  */
1044  if(0 != checkLLRPStatus(pRsp->getLLRPStatus(), "startROSpec"))
1045  {
1046  /* checkLLRPStatus already tattled */
1047  delete pRspMsg;
1048  return -1;
1049  }
1050 
1051  /*
1052  * Done with the response message.
1053  */
1054  delete pRspMsg;
1055 
1056  /*
1057  * Tattle progress
1058  */
1059  if(m_Verbose)
1060  {
1061  printf("INFO: ROSpec started\n");
1062  }
1063 
1064  /*
1065  * Victory.
1066  */
1067  return 0;
1068 }
1069 
1087 int
1088 CMyApplication::stopROSpec (void)
1089 {
1090  CSTOP_ROSPEC * pCmd;
1091  CMessage * pRspMsg;
1092  CSTOP_ROSPEC_RESPONSE * pRsp;
1093 
1094  /*
1095  * Compose the command message
1096  */
1097  pCmd = new CSTOP_ROSPEC();
1098  pCmd->setMessageID(m_messageID++);
1099  pCmd->setROSpecID(1111);
1100 
1101  /*
1102  * Send the message, expect the response of certain type
1103  */
1104  pRspMsg = transact(pCmd);
1105 
1106  /*
1107  * Done with the command message
1108  */
1109  delete pCmd;
1110 
1111  /*
1112  * transact() returns NULL if something went wrong.
1113  */
1114  if(NULL == pRspMsg)
1115  {
1116  /* transact already tattled */
1117  return -1;
1118  }
1119 
1120  /*
1121  * Cast to a STOP_ROSPEC_RESPONSE message.
1122  */
1123  pRsp = (CSTOP_ROSPEC_RESPONSE *) pRspMsg;
1124 
1125  /*
1126  * Check the LLRPStatus parameter.
1127  */
1128  if(0 != checkLLRPStatus(pRsp->getLLRPStatus(), "stopROSpec"))
1129  {
1130  /* checkLLRPStatus already tattled */
1131  delete pRspMsg;
1132  return -1;
1133  }
1134 
1135  /*
1136  * Done with the response message.
1137  */
1138  delete pRspMsg;
1139 
1140  /*
1141  * Tattle progress
1142  */
1143  if(m_Verbose)
1144  {
1145  printf("INFO: ROSpec stopped\n");
1146  }
1147 
1148  /*
1149  * Victory.
1150  */
1151  return 0;
1152 }
1153 
1154 
1174 int
1175 CMyApplication::awaitAndPrintReport (int timeout)
1176 {
1177  int bDone = 0;
1178  int retVal = 0;
1179  time_t startTime = time(NULL);
1180  time_t tempTime;
1181  /*
1182  * Keep receiving messages until done or until
1183  * something bad happens.
1184  */
1185  while(!bDone)
1186  {
1187  CMessage * pMessage;
1188  const CTypeDescriptor * pType;
1189 
1190  /*
1191  * Wait up to 1 second for a report. Check
1192  * That way, we can check the timestamp even if
1193  * there are no reports coming in
1194  */
1195  pMessage = recvMessage(1000);
1196 
1197  /* validate the timestamp */
1198  tempTime = time(NULL);
1199  if(difftime(tempTime, startTime) > timeout)
1200  {
1201  bDone=1;
1202  }
1203 
1204  if(NULL == pMessage)
1205  {
1206  continue;
1207  }
1208 
1209  /*
1210  * What happens depends on what kind of message
1211  * received. Use the type label (m_pType) to
1212  * discriminate message types.
1213  */
1214  pType = pMessage->m_pType;
1215 
1216  /*
1217  * Is it a tag report? If so, print it out.
1218  */
1219  if(&CRO_ACCESS_REPORT::s_typeDescriptor == pType)
1220  {
1221  CRO_ACCESS_REPORT * pNtf;
1222 
1223  pNtf = (CRO_ACCESS_REPORT *) pMessage;
1224 
1225  printTagReportData(pNtf);
1226  }
1227 
1228  /*
1229  * Is it a reader event? This example only recognizes
1230  * AntennaEvents.
1231  */
1232  else if(&CREADER_EVENT_NOTIFICATION::s_typeDescriptor == pType)
1233  {
1235  CReaderEventNotificationData *pNtfData;
1236 
1237  pNtf = (CREADER_EVENT_NOTIFICATION *) pMessage;
1238 
1239  pNtfData = pNtf->getReaderEventNotificationData();
1240  if(NULL != pNtfData)
1241  {
1242  handleReaderEventNotification(pNtfData);
1243  }
1244  else
1245  {
1246  /*
1247  * This should never happen. Using continue
1248  * to keep indent depth down.
1249  */
1250  printf("WARNING: READER_EVENT_NOTIFICATION without data\n");
1251  }
1252  }
1253 
1254  /*
1255  * Hmmm. Something unexpected. Just tattle and keep going.
1256  */
1257  else
1258  {
1259  printf("WARNING: Ignored unexpected message during monitor: %s\n",
1260  pType->m_pName);
1261  }
1262 
1263  /*
1264  * Done with the received message
1265  */
1266  delete pMessage;
1267  }
1268 
1269  return retVal;
1270 }
1271 
1272 
1287 void
1288 CMyApplication::printTagReportData (
1289  CRO_ACCESS_REPORT * pRO_ACCESS_REPORT)
1290 {
1291  std::list<CTagReportData *>::iterator Cur;
1292 
1293  unsigned int nEntry = 0;
1294 
1295  /*
1296  * Loop through and count the number of entries
1297  */
1298  for(
1299  Cur = pRO_ACCESS_REPORT->beginTagReportData();
1300  Cur != pRO_ACCESS_REPORT->endTagReportData();
1301  Cur++)
1302  {
1303  nEntry++;
1304  }
1305 
1306  if(m_Verbose)
1307  {
1308  printf("INFO: %u tag report entries\n", nEntry);
1309  }
1310 
1311  /*
1312  * Loop through again and print each entry.
1313  */
1314  for(
1315  Cur = pRO_ACCESS_REPORT->beginTagReportData();
1316  Cur != pRO_ACCESS_REPORT->endTagReportData();
1317  Cur++)
1318  {
1319  printOneTagReportData(*Cur);
1320  }
1321 }
1322 
1323 
1332 void
1333 CMyApplication::formatOneEPC (
1334  CParameter *pEPCParameter,
1335  char *buf,
1336  int buflen)
1337 {
1338  char * p = buf;
1339  int bufsize = buflen;
1340  int written = 0;
1341 
1342  if(NULL != pEPCParameter)
1343  {
1344  const CTypeDescriptor * pType;
1345  llrp_u96_t my_u96;
1346  llrp_u1v_t my_u1v;
1347  llrp_u8_t * pValue = NULL;
1348  unsigned int n, i;
1349 
1350  pType = pEPCParameter->m_pType;
1351  if(&CEPC_96::s_typeDescriptor == pType)
1352  {
1353  CEPC_96 *pEPC_96;
1354 
1355  pEPC_96 = (CEPC_96 *) pEPCParameter;
1356  my_u96 = pEPC_96->getEPC();
1357  pValue = my_u96.m_aValue;
1358  n = 12u;
1359  }
1360  else if(&CEPCData::s_typeDescriptor == pType)
1361  {
1362  CEPCData * pEPCData;
1363 
1364  pEPCData = (CEPCData *) pEPCParameter;
1365  my_u1v = pEPCData->getEPC();
1366  pValue = my_u1v.m_pValue;
1367  n = (my_u1v.m_nBit + 7u) / 8u;
1368  }
1369 
1370  if(NULL != pValue)
1371  {
1372  for(i = 0; i < n; i++)
1373  {
1374  if(0 < i && i%2 == 0 && 1 < bufsize)
1375  {
1376  *p++ = '-';
1377  bufsize--;
1378  }
1379  if(bufsize > 2)
1380  {
1381  written = snprintf(p, bufsize, "%02X", pValue[i]);
1382  bufsize -= written;
1383  p+= written;
1384  }
1385  }
1386  }
1387  else
1388  {
1389  written = snprintf(p, bufsize, "%s", "---unknown-epc-data-type---");
1390  bufsize -= written;
1391  p += written;
1392  }
1393  }
1394  else
1395  {
1396  written = snprintf(p, bufsize, "%s", "--null epc---");
1397  bufsize -= written;
1398  p += written;
1399  }
1400 
1401  // null terminate this for good practice
1402  buf[buflen-1] = '\0';
1403 
1404 }
1405 
1414 void
1415 CMyApplication::printOneTagReportData (
1416  CTagReportData * pTagReportData)
1417 {
1418  char aBuf[64];
1419 
1420  /*
1421  * Print the EPC. It could be an 96-bit EPC_96 parameter
1422  * or an variable length EPCData parameter.
1423  */
1424 
1425  CParameter * pEPCParameter =
1426  pTagReportData->getEPCParameter();
1427 
1428  formatOneEPC(pEPCParameter, aBuf, 64);
1429 
1430  /*
1431  * End of line
1432  */
1433  printf("EPC: %s\n", aBuf);
1434 }
1435 
1436 
1450 void
1451 CMyApplication::handleReaderEventNotification (
1452  CReaderEventNotificationData *pNtfData)
1453 {
1454  CAntennaEvent * pAntennaEvent;
1455  CReaderExceptionEvent * pReaderExceptionEvent;
1456  int nReported = 0;
1457 
1458  pAntennaEvent = pNtfData->getAntennaEvent();
1459  if(NULL != pAntennaEvent)
1460  {
1461  handleAntennaEvent(pAntennaEvent);
1462  nReported++;
1463  }
1464 
1465  pReaderExceptionEvent = pNtfData->getReaderExceptionEvent();
1466  if(NULL != pReaderExceptionEvent)
1467  {
1468  handleReaderExceptionEvent(pReaderExceptionEvent);
1469  nReported++;
1470  }
1471 
1472  /*
1473  * Similarly handle other events here:
1474  * HoppingEvent
1475  * GPIEvent
1476  * ROSpecEvent
1477  * ReportBufferLevelWarningEvent
1478  * ReportBufferOverflowErrorEvent
1479  * RFSurveyEvent
1480  * AISpecEvent
1481  * ConnectionAttemptEvent
1482  * ConnectionCloseEvent
1483  * Custom
1484  */
1485 
1486  if(0 == nReported)
1487  {
1488  printf("NOTICE: Unexpected (unhandled) ReaderEvent\n");
1489  }
1490 }
1491 
1492 
1504 void
1505 CMyApplication::handleAntennaEvent (
1506  CAntennaEvent * pAntennaEvent)
1507 {
1508  EAntennaEventType eEventType;
1509  llrp_u16_t AntennaID;
1510  char * pStateStr;
1511 
1512  eEventType = pAntennaEvent->getEventType();
1513  AntennaID = pAntennaEvent->getAntennaID();
1514 
1515  switch(eEventType)
1516  {
1517  case AntennaEventType_Antenna_Disconnected:
1518  pStateStr = "disconnected";
1519  break;
1520 
1521  case AntennaEventType_Antenna_Connected:
1522  pStateStr = "connected";
1523  break;
1524 
1525  default:
1526  pStateStr = "?unknown-event?";
1527  break;
1528  }
1529 
1530  printf("NOTICE: Antenna %d is %s\n", AntennaID, pStateStr);
1531 }
1532 
1533 
1546 void
1547 CMyApplication::handleReaderExceptionEvent (
1548  CReaderExceptionEvent * pReaderExceptionEvent)
1549 {
1550  llrp_utf8v_t Message;
1551 
1552  Message = pReaderExceptionEvent->getMessage();
1553 
1554  if(0 < Message.m_nValue && NULL != Message.m_pValue)
1555  {
1556  printf("NOTICE: ReaderException '%.*s'\n",
1557  Message.m_nValue, Message.m_pValue);
1558  }
1559  else
1560  {
1561  printf("NOTICE: ReaderException but no message\n");
1562  }
1563 }
1564 
1565 
1584 int
1585 CMyApplication::checkLLRPStatus (
1586  CLLRPStatus * pLLRPStatus,
1587  char * pWhatStr)
1588 {
1589  /*
1590  * The LLRPStatus parameter is mandatory in all responses.
1591  * If it is missing there should have been a decode error.
1592  * This just makes sure (remember, this program is a
1593  * diagnostic and suppose to catch LTKC mistakes).
1594  */
1595  if(NULL == pLLRPStatus)
1596  {
1597  printf("ERROR: %s missing LLRP status\n", pWhatStr);
1598  return -1;
1599  }
1600 
1601  /*
1602  * Make sure the status is M_Success.
1603  * If it isn't, print the error string if one.
1604  * This does not try to pretty-print the status
1605  * code. To get that, run this program with -vv
1606  * and examine the XML output.
1607  */
1608  if(StatusCode_M_Success != pLLRPStatus->getStatusCode())
1609  {
1610  llrp_utf8v_t ErrorDesc;
1611 
1612  ErrorDesc = pLLRPStatus->getErrorDescription();
1613 
1614  if(0 == ErrorDesc.m_nValue)
1615  {
1616  printf("ERROR: %s failed, no error description given\n",
1617  pWhatStr);
1618  }
1619  else
1620  {
1621  printf("ERROR: %s failed, %.*s\n",
1622  pWhatStr, ErrorDesc.m_nValue, ErrorDesc.m_pValue);
1623  }
1624  return -2;
1625  }
1626 
1627  /*
1628  * Victory. Everything is fine.
1629  */
1630  return 0;
1631 }
1632 
1633 
1657 CMessage *
1658 CMyApplication::transact (
1659  CMessage * pSendMsg)
1660 {
1661  CConnection * pConn = m_pConnectionToReader;
1662  CMessage * pRspMsg;
1663 
1664  /*
1665  * Print the XML text for the outbound message if
1666  * verbosity is 2 or higher.
1667  */
1668  if(1 < m_Verbose)
1669  {
1670  printf("\n===================================\n");
1671  printf("INFO: Transact sending\n");
1672  printXMLMessage(pSendMsg);
1673  }
1674 
1675  /*
1676  * Send the message, expect the response of certain type.
1677  * If LLRP::CConnection::transact() returns NULL then there was
1678  * an error. In that case we try to print the error details.
1679  */
1680  pRspMsg = pConn->transact(pSendMsg, 5000);
1681 
1682  if(NULL == pRspMsg)
1683  {
1684  const CErrorDetails * pError = pConn->getTransactError();
1685 
1686  printf("ERROR: %s transact failed, %s\n",
1687  pSendMsg->m_pType->m_pName,
1688  pError->m_pWhatStr ? pError->m_pWhatStr : "no reason given");
1689 
1690  if(NULL != pError->m_pRefType)
1691  {
1692  printf("ERROR: ... reference type %s\n",
1693  pError->m_pRefType->m_pName);
1694  }
1695 
1696  if(NULL != pError->m_pRefField)
1697  {
1698  printf("ERROR: ... reference field %s\n",
1699  pError->m_pRefField->m_pName);
1700  }
1701 
1702  return NULL;
1703  }
1704 
1705  /*
1706  * Print the XML text for the inbound message if
1707  * verbosity is 2 or higher.
1708  */
1709  if(1 < m_Verbose)
1710  {
1711  printf("\n- - - - - - - - - - - - - - - - - -\n");
1712  printf("INFO: Transact received response\n");
1713  printXMLMessage(pRspMsg);
1714  }
1715 
1716  /*
1717  * If it is an ERROR_MESSAGE (response from reader
1718  * when it can't understand the request), tattle
1719  * and declare defeat.
1720  */
1721  if(&CERROR_MESSAGE::s_typeDescriptor == pRspMsg->m_pType)
1722  {
1723  const CTypeDescriptor * pResponseType;
1724 
1725  pResponseType = pSendMsg->m_pType->m_pResponseType;
1726 
1727  printf("ERROR: Received ERROR_MESSAGE instead of %s\n",
1728  pResponseType->m_pName);
1729  delete pRspMsg;
1730  pRspMsg = NULL;
1731  }
1732 
1733  return pRspMsg;
1734 }
1735 
1736 
1761 CMessage *
1762 CMyApplication::recvMessage (
1763  int nMaxMS)
1764 {
1765  CConnection * pConn = m_pConnectionToReader;
1766  CMessage * pMessage;
1767 
1768  /*
1769  * Receive the message subject to a time limit
1770  */
1771  pMessage = pConn->recvMessage(nMaxMS);
1772 
1773  /*
1774  * If LLRP::CConnection::recvMessage() returns NULL then there was
1775  * an error. In that case we try to print the error details.
1776  */
1777  if(NULL == pMessage)
1778  {
1779  const CErrorDetails * pError = pConn->getRecvError();
1780 
1781  /* don't warn on timeout since this is a polling example */
1782  if(pError->m_eResultCode != RC_RecvTimeout)
1783  {
1784  printf("ERROR: recvMessage failed, %s\n",
1785  pError->m_pWhatStr ? pError->m_pWhatStr : "no reason given");
1786  }
1787 
1788  if(NULL != pError->m_pRefType)
1789  {
1790  printf("ERROR: ... reference type %s\n",
1791  pError->m_pRefType->m_pName);
1792  }
1793 
1794  if(NULL != pError->m_pRefField)
1795  {
1796  printf("ERROR: ... reference field %s\n",
1797  pError->m_pRefField->m_pName);
1798  }
1799 
1800  return NULL;
1801  }
1802 
1803  /*
1804  * Print the XML text for the inbound message if
1805  * verbosity is 2 or higher.
1806  */
1807  if(1 < m_Verbose)
1808  {
1809  printf("\n===================================\n");
1810  printf("INFO: Message received\n");
1811  printXMLMessage(pMessage);
1812  }
1813 
1814  return pMessage;
1815 }
1816 
1817 
1835 int
1836 CMyApplication::sendMessage (
1837  CMessage * pSendMsg)
1838 {
1839  CConnection * pConn = m_pConnectionToReader;
1840 
1841  /*
1842  * Print the XML text for the outbound message if
1843  * verbosity is 2 or higher.
1844  */
1845  if(1 < m_Verbose)
1846  {
1847  printf("\n===================================\n");
1848  printf("INFO: Sending\n");
1849  printXMLMessage(pSendMsg);
1850  }
1851 
1852  /*
1853  * If LLRP::CConnection::sendMessage() returns other than RC_OK
1854  * then there was an error. In that case we try to print
1855  * the error details.
1856  */
1857  if(RC_OK != pConn->sendMessage(pSendMsg))
1858  {
1859  const CErrorDetails * pError = pConn->getSendError();
1860 
1861  printf("ERROR: %s sendMessage failed, %s\n",
1862  pSendMsg->m_pType->m_pName,
1863  pError->m_pWhatStr ? pError->m_pWhatStr : "no reason given");
1864 
1865  if(NULL != pError->m_pRefType)
1866  {
1867  printf("ERROR: ... reference type %s\n",
1868  pError->m_pRefType->m_pName);
1869  }
1870 
1871  if(NULL != pError->m_pRefField)
1872  {
1873  printf("ERROR: ... reference field %s\n",
1874  pError->m_pRefField->m_pName);
1875  }
1876 
1877  return -1;
1878  }
1879 
1880  /*
1881  * Victory
1882  */
1883  return 0;
1884 }
1885 
1886 
1900 void
1901 CMyApplication::printXMLMessage (
1902  CMessage * pMessage)
1903 {
1904  char aBuf[100*1024];
1905 
1906  /*
1907  * Convert the message to an XML string.
1908  * This fills the buffer with either the XML string
1909  * or an error message. The return value could
1910  * be checked.
1911  */
1912 
1913  pMessage->toXMLString(aBuf, sizeof aBuf);
1914 
1915  /*
1916  * Print the XML Text to the standard output.
1917  */
1918  printf("%s", aBuf);
1919 }
llrp_utf8v_t getMessage(void)
Get accessor functions for the LLRP Message field.
void setROSpecID(llrp_u32_t value)
Set accessor functions for the LLRP ROSpecID field.
Class Definition CConnectionAttemptEvent for LLRP parameter ConnectionAttemptEvent.
char * m_pName
String name of field (e.g. "ROSpecID")
Definition: ltkcpp_base.h:840
const CTypeDescriptor * m_pType
The type descriptor desribing this element.
Definition: ltkcpp_base.h:972
Class Definition CEPC_96 for LLRP parameter EPC_96.
CLLRPStatus * getLLRPStatus(void)
Get accessor functions for the LLRP LLRPStatus sub-parameter.
llrp_u8_t * m_pValue
Pointer to the first array element.
Definition: ltkcpp_base.h:443
Class for LLRP basic type u16v (List of unsigned 16-bit values)
Definition: ltkcpp_base.h:179
Class Definition CIMPINJ_ENABLE_EXTENSIONS_RESPONSE for LLRP message IMPINJ_ENABLE_EXTENSIONS_RESPONS...
void setDurationTrigger(llrp_u32_t value)
Set accessor functions for the LLRP DurationTrigger field.
Class Definition CSTART_ROSPEC_RESPONSE for LLRP message START_ROSPEC_RESPONSE.
void usage(char *pProgName)
Print usage message and exit.
Definition: docsample2.cpp:288
const CFieldDescriptor * m_pRefField
If non-NULL this is the field descriptors for the errored field.
Definition: ltkcpp_base.h:641
void setDurationTriggerValue(llrp_u32_t value)
Set accessor functions for the LLRP DurationTriggerValue field.
Class Definition CENABLE_ROSPEC for LLRP message ENABLE_ROSPEC.
const CTypeDescriptor * m_pRefType
If non-NULL this is the type descriptors for the errored type.
Definition: ltkcpp_base.h:639
CParameter * getEPCParameter(void)
Get accessor functions for the LLRP EPCParameter sub-parameter.
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
Class Definition CAntennaEvent for LLRP parameter AntennaEvent.
Class Definition CSTOP_ROSPEC_RESPONSE for LLRP message STOP_ROSPEC_RESPONSE.
void setAISpecStopTriggerType(EAISpecStopTriggerType value)
Set accessor functions for the LLRP AISpecStopTriggerType field.
void enrollImpinjTypesIntoRegistry(CTypeRegistry *pTypeRegistry)
Enrolls the types for Impinj into the LTKCPP registry.
llrp_u96_t getEPC(void)
Get accessor functions for the LLRP EPC field.
const char * m_pWhatStr
Descriptive printable error string.
Definition: ltkcpp_base.h:637
EResultCode toXMLString(char *pBuffer, int nBuffer)
A wrapper around LLRP::toXMLString()
void setROSpecID(llrp_u32_t value)
Set accessor functions for the LLRP ROSpecID field.
EStatusCode getStatusCode(void)
Get accessor functions for the LLRP StatusCode field.
llrp_u16_t m_nValue
The number of arrray elements.
Definition: ltkcpp_base.h:484
int closeConnectionToReader(void)
Close connection to reader, allow reuse of instance.
Class Definition CROSpecStartTrigger for LLRP parameter ROSpecStartTrigger.
EAntennaEventType getEventType(void)
Get accessor functions for the LLRP EventType field.
A collection of pointers to CTypeDescriptors.
Definition: ltkcpp_base.h:885
CAntennaEvent * getAntennaEvent(void)
Get accessor functions for the LLRP AntennaEvent sub-parameter.
const CErrorDetails * getTransactError(void)
Get the details that explains transact() error.
EResultCode setROBoundarySpec(CROBoundarySpec *pValue)
Set accessor functions for the LLRP ROBoundarySpec sub-parameter.
Class Definition CRO_ACCESS_REPORT for LLRP message RO_ACCESS_REPORT.
Class Definition CAISpec for LLRP parameter AISpec.
Class Definition CROSpec for LLRP parameter ROSpec.
void setROSpecID(llrp_u32_t value)
Set accessor functions for the LLRP ROSpecID field.
Class Definition CInventoryParameterSpec for LLRP parameter InventoryParameterSpec.
Class Definition CSET_READER_CONFIG_RESPONSE for LLRP message SET_READER_CONFIG_RESPONSE.
CLLRPStatus * getLLRPStatus(void)
Get accessor functions for the LLRP LLRPStatus sub-parameter.
CReaderExceptionEvent * getReaderExceptionEvent(void)
Get accessor functions for the LLRP ReaderExceptionEvent sub-parameter.
Class Definition CReaderExceptionEvent for LLRP parameter ReaderExceptionEvent.
Class Definition CLLRPStatus for LLRP parameter LLRPStatus.
CLLRPStatus * getLLRPStatus(void)
Get accessor functions for the LLRP LLRPStatus sub-parameter.
EResultCode addSpecParameter(CParameter *pValue)
Add a SpecParameter to the LLRP sub-parameter list.
Class Definition CEPCData for LLRP parameter EPCData.
Class Definition CREADER_EVENT_NOTIFICATION for LLRP message READER_EVENT_NOTIFICATION.
CMessage * recvMessage(int nMaxMS)
Receive a message from a connection.
std::list< CTagReportData * >::iterator beginTagReportData(void)
Returns the first element of the TagReportData sub-parameter list.
EResultCode setAISpecStopTrigger(CAISpecStopTrigger *pValue)
Set accessor functions for the LLRP AISpecStopTrigger sub-parameter.
File that includes all Impinj Custom extension classes and types.
void setROSpecStartTriggerType(EROSpecStartTriggerType value)
Set accessor functions for the LLRP ROSpecStartTriggerType field.
llrp_u1v_t getEPC(void)
Get accessor functions for the LLRP EPC field.
Class Definition CSET_READER_CONFIG for LLRP message SET_READER_CONFIG.
CMessage * transact(CMessage *pSendMessage, int nMaxMS)
Transact a LLRP request and response to a connection.
CLLRPStatus * getLLRPStatus(void)
Get accessor functions for the LLRP LLRPStatus sub-parameter.
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
llrp_u16_t m_nBit
The number of arrray elements.
Definition: ltkcpp_base.h:441
Class for LLRP basic type u1v (vector of unsigned 1-bit values)
Definition: ltkcpp_base.h:437
void setAntennaIDs(llrp_u16v_t value)
Set accessor functions for the LLRP AntennaIDs field.
int openConnectionToReader(const char *pReaderHostName)
Open a connection to the reader over an unencrypted socket.
Class Definition CENABLE_ROSPEC_RESPONSE for LLRP message ENABLE_ROSPEC_RESPONSE. ...
const CTypeDescriptor * m_pResponseType
For messages (bIsMessage==TRUE), this is the type descriptor for the corresponding response...
Definition: ltkcpp_base.h:776
void setProtocolID(EAirProtocols value)
Set accessor functions for the LLRP ProtocolID field.
int main(int ac, char *av[])
Command main routine.
Definition: docsample2.cpp:206
EResultCode sendMessage(CMessage *pMessage)
Send a LLRP message to a connection.
std::list< CTagReportData * >::iterator endTagReportData(void)
Returns the last element of the TagReportData sub-parameter list.
Class to return error details in LTKCPP operations.
Definition: ltkcpp_base.h:631
Class Definition CTagReportData for LLRP parameter TagReportData.
char * m_pName
String name of parameter/message type (e.g. "ROSpec")
Definition: ltkcpp_base.h:762
EResultCode setROSpec(CROSpec *pValue)
Set accessor functions for the LLRP ROSpec sub-parameter.
llrp_u16_t getAntennaID(void)
Get accessor functions for the LLRP AntennaID field.
File that includes all LLRP classes and types.
Class Definition CADD_ROSPEC for LLRP message ADD_ROSPEC.
Class Definition CSTART_ROSPEC for LLRP message START_ROSPEC.
void setROSpecStopTriggerType(EROSpecStopTriggerType value)
Set accessor functions for the LLRP ROSpecStopTriggerType field.
Class Definition CIMPINJ_ENABLE_EXTENSIONS for LLRP message IMPINJ_ENABLE_EXTENSIONS.
EResultCode setROSpecStopTrigger(CROSpecStopTrigger *pValue)
Set accessor functions for the LLRP ROSpecStopTrigger sub-parameter.
Class Definition CROSpecStopTrigger for LLRP parameter ROSpecStopTrigger.
void setInventoryParameterSpecID(llrp_u16_t value)
Set accessor functions for the LLRP InventoryParameterSpecID field.
llrp_u16_t * m_pValue
Pointer to the first array element.
Definition: ltkcpp_base.h:185
CLLRPStatus * getLLRPStatus(void)
Get accessor functions for the LLRP LLRPStatus sub-parameter.
llrp_u8_t m_aValue[12]
Simple array of basic type llrp_u8_t.
Definition: ltkcpp_base.h:570
Base Class for All LLRP LTK Parameters.
Definition: ltkcpp_base.h:1125
Base Class for All LLRP LTK Messages.
Definition: ltkcpp_base.h:1088
CLLRPStatus * getLLRPStatus(void)
Get accessor functions for the LLRP LLRPStatus sub-parameter.
Class Definition CADD_ROSPEC_RESPONSE for LLRP message ADD_ROSPEC_RESPONSE.
Class Definition CAISpecStopTrigger for LLRP parameter AISpecStopTrigger.
const char * getConnectError(void)
Get the string that explains openReaderConnection() error.
void setROSpecID(llrp_u32_t value)
Set accessor functions for the LLRP ROSpecID field.
CReaderEventNotificationData * getReaderEventNotificationData(void)
Get accessor functions for the LLRP ReaderEventNotificationData sub-parameter.
void setResetToFactoryDefault(llrp_u1_t value)
Set accessor functions for the LLRP ResetToFactoryDefault field.
Definition: ltkcpp.h:45
EResultCode setROSpecStartTrigger(CROSpecStartTrigger *pValue)
Set accessor functions for the LLRP ROSpecStartTrigger sub-parameter.
llrp_utf8v_t getErrorDescription(void)
Get accessor functions for the LLRP ErrorDescription field.
Class Definition CSTOP_ROSPEC for LLRP message STOP_ROSPEC.
LLRP connection class.
void setCurrentState(EROSpecState value)
Set accessor functions for the LLRP CurrentState field.
llrp_utf8_t * m_pValue
Pointer to the first array element.
Definition: ltkcpp_base.h:486
EResultCode addInventoryParameterSpec(CInventoryParameterSpec *pValue)
Add a InventoryParameterSpec to the LLRP sub-parameter list.
void setPriority(llrp_u8_t value)
Set accessor functions for the LLRP Priority field.
Class Definition CROBoundarySpec for LLRP parameter ROBoundarySpec.
CConnectionAttemptEvent * getConnectionAttemptEvent(void)
Get accessor functions for the LLRP ConnectionAttemptEvent sub-parameter.
Describes a message or parameter type.
Definition: ltkcpp_base.h:755
const CErrorDetails * getSendError(void)
Get the details that explains sendMessage() error.
EConnectionAttemptStatusType getStatus(void)
Get accessor functions for the LLRP Status field.
Class Definition CReaderEventNotificationData for LLRP parameter ReaderEventNotificationData.