LTKCPP-- LLRP Toolkit C Plus Plus Library
example1.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,2008. All rights reserved. *
12  * *
13  *****************************************************************************/
14 
45 #include <stdio.h>
46 
47 #include "ltkcpp.h"
48 
49 using namespace LLRP;
50 
51 
52 class CMyApplication
53 {
54  public:
56  int m_Verbose;
57 
59  CConnection * m_pConnectionToReader;
60 
61  inline
62  CMyApplication (void)
63  : m_Verbose(0), m_pConnectionToReader(NULL)
64  {}
65 
66  int
67  run (
68  char * pReaderHostName);
69 
70  int
71  checkConnectionStatus (void);
72 
73  int
74  scrubConfiguration (void);
75 
76  int
77  resetConfigurationToFactoryDefaults (void);
78 
79  int
80  deleteAllROSpecs (void);
81 
82  int
83  addROSpec (void);
84 
85  int
86  enableROSpec (void);
87 
88  int
89  startROSpec (void);
90 
91  int
92  awaitAndPrintReport (void);
93 
94  void
95  printTagReportData (
96  CRO_ACCESS_REPORT * pRO_ACCESS_REPORT);
97 
98  void
99  printOneTagReportData (
100  CTagReportData * pTagReportData);
101 
102  void
103  handleReaderEventNotification (
104  CReaderEventNotificationData *pNtfData);
105 
106  void
107  handleAntennaEvent (
108  CAntennaEvent * pAntennaEvent);
109 
110  void
111  handleReaderExceptionEvent (
112  CReaderExceptionEvent * pReaderExceptionEvent);
113 
114  int
115  checkLLRPStatus (
116  CLLRPStatus * pLLRPStatus,
117  char * pWhatStr);
118 
119  CMessage *
120  transact (
121  CMessage * pSendMsg);
122 
123  CMessage *
124  recvMessage (
125  int nMaxMS);
126 
127  int
128  sendMessage (
129  CMessage * pSendMsg);
130 
131  void
132  printXMLMessage (
133  CMessage * pMessage);
134 };
135 
136 
137 /* BEGIN forward declarations */
138 int
139 main (
140  int ac,
141  char * av[]);
142 
143 void
144 usage (
145  char * pProgName);
146 /* END forward declarations */
147 
148 
164 int
166  int ac,
167  char * av[])
168 {
169  CMyApplication myApp;
170  char * pReaderHostName;
171  int rc;
172 
173  /*
174  * Process comand arguments, determine reader name
175  * and verbosity level.
176  */
177  if(ac == 2)
178  {
179  pReaderHostName = av[1];
180  }
181  else if(ac == 3)
182  {
183  char * p = av[1];
184 
185  while(*p)
186  {
187  switch(*p++)
188  {
189  case '-': /* linux conventional option warn char */
190  case '/': /* Windows/DOS conventional option warn char */
191  break;
192 
193  case 'v':
194  case 'V':
195  myApp.m_Verbose++;
196  break;
197 
198  default:
199  usage(av[0]);
200  /* no return */
201  break;
202  }
203  }
204 
205  pReaderHostName = av[2];
206  }
207  else
208  {
209  usage(av[0]);
210  /* no return */
211  }
212 
213  /*
214  * Run application, capture return value for exit status
215  */
216  rc = myApp.run(pReaderHostName);
217 
218  printf("INFO: Done\n");
219 
220  /*
221  * Exit with the right status.
222  */
223  if(0 == rc)
224  {
225  exit(0);
226  }
227  else
228  {
229  exit(2);
230  }
231  /*NOTREACHED*/
232 }
233 
234 
246 void
248  char * pProgName)
249 {
250 #ifdef linux
251  printf("Usage: %s [-v[v]] READERHOSTNAME\n", pProgName);
252  printf("\n");
253  printf("Each -v increases verbosity level\n");
254 #endif /* linux */
255 #ifdef WIN32
256  printf("Usage: %s [/v[v]] READERHOSTNAME\n", pProgName);
257  printf("\n");
258  printf("Each /v increases verbosity level\n");
259 #endif /* WIN32 */
260  exit(1);
261 }
262 
263 
294 int
295 CMyApplication::run (
296  char * pReaderHostName)
297 {
298  CTypeRegistry * pTypeRegistry;
299  CConnection * pConn;
300  int rc;
301 
302  /*
303  * Allocate the type registry. This is needed
304  * by the connection to decode.
305  */
306  pTypeRegistry = getTheTypeRegistry();
307  if(NULL == pTypeRegistry)
308  {
309  printf("ERROR: getTheTypeRegistry failed\n");
310  return -1;
311  }
312 
313  /*
314  * Construct a connection (LLRP::CConnection).
315  * Using a 32kb max frame size for send/recv.
316  * The connection object is ready for business
317  * but not actually connected to the reader yet.
318  */
319  pConn = new CConnection(pTypeRegistry, 32u*1024u);
320  if(NULL == pConn)
321  {
322  printf("ERROR: new CConnection failed\n");
323  return -2;
324  }
325 
326  /*
327  * Open the connection to the reader
328  */
329  if(m_Verbose)
330  {
331  printf("INFO: Connecting to %s....\n", pReaderHostName);
332  }
333 
334  rc = pConn->openConnectionToReader(pReaderHostName);
335  if(0 != rc)
336  {
337  printf("ERROR: connect: %s (%d)\n", pConn->getConnectError(), rc);
338  delete pConn;
339  return -3;
340  }
341 
342  /*
343  * Record the pointer to the connection object so other
344  * routines can use it.
345  */
346  m_pConnectionToReader = pConn;
347 
348  if(m_Verbose)
349  {
350  printf("INFO: Connected, checking status....\n");
351  }
352 
353  /*
354  * Commence the sequence and check for errors as we go.
355  * See comments for each routine for details.
356  * Each routine prints messages.
357  */
358  rc = 1;
359  if(0 == checkConnectionStatus())
360  {
361  rc = 2;
362  if(0 == scrubConfiguration())
363  {
364  rc = 3;
365  if(0 == addROSpec())
366  {
367  rc = 4;
368  if(0 == enableROSpec())
369  {
370  int i;
371 
372  rc = 5;
373 
374  for(i = 1; i <= 5; i++)
375  {
376  printf("INFO: Starting run %d ================\n", i);
377  if(0 != startROSpec())
378  {
379  /* already tattled */
380  break;
381  }
382  if(0 != awaitAndPrintReport())
383  {
384  /* already tattled */
385  break;
386  }
387  }
388 
389  if(5 == i)
390  {
391  rc = 0;
392  }
393  }
394  }
395 
396  /*
397  * After we're done, try to leave the reader
398  * in a clean state for next use. This is best
399  * effort and no checking of the result is done.
400  */
401  if(m_Verbose)
402  {
403  printf("INFO: Clean up reader configuration...\n");
404  }
405  scrubConfiguration();
406  }
407  }
408 
409  if(m_Verbose)
410  {
411  printf("INFO: Finished\n");
412  }
413 
414  /*
415  * Close the connection and release its resources
416  */
417  pConn->closeConnectionToReader();
418  delete pConn;
419 
420  /*
421  * Done with the registry.
422  */
423  delete pTypeRegistry;
424 
425  /*
426  * When we get here all allocated memory should have been deallocated.
427  */
428 
429  return rc;
430 }
431 
432 
463 int
464 CMyApplication::checkConnectionStatus (void)
465 {
466  CMessage * pMessage;
469  CConnectionAttemptEvent * pEvent;
470 
471  /*
472  * Expect the notification within 10 seconds.
473  * It is suppose to be the very first message sent.
474  */
475  pMessage = recvMessage(10000);
476 
477  /*
478  * recvMessage() returns NULL if something went wrong.
479  */
480  if(NULL == pMessage)
481  {
482  /* recvMessage already tattled */
483  goto fail;
484  }
485 
486  /*
487  * Check to make sure the message is of the right type.
488  * The type label (pointer) in the message should be
489  * the type descriptor for READER_EVENT_NOTIFICATION.
490  */
491  if(&CREADER_EVENT_NOTIFICATION::s_typeDescriptor != pMessage->m_pType)
492  {
493  goto fail;
494  }
495 
496  /*
497  * Now that we are sure it is a READER_EVENT_NOTIFICATION,
498  * traverse to the ReaderEventNotificationData parameter.
499  */
500  pNtf = (CREADER_EVENT_NOTIFICATION *) pMessage;
501  pNtfData = pNtf->getReaderEventNotificationData();
502  if(NULL == pNtfData)
503  {
504  goto fail;
505  }
506 
507  /*
508  * The ConnectionAttemptEvent parameter must be present.
509  */
510  pEvent = pNtfData->getConnectionAttemptEvent();
511  if(NULL == pEvent)
512  {
513  goto fail;
514  }
515 
516  /*
517  * The status in the ConnectionAttemptEvent parameter
518  * must indicate connection success.
519  */
521  {
522  goto fail;
523  }
524 
525  /*
526  * Done with the message
527  */
528  delete pMessage;
529 
530  if(m_Verbose)
531  {
532  printf("INFO: Connection status OK\n");
533  }
534 
535  /*
536  * Victory.
537  */
538  return 0;
539 
540  fail:
541  /*
542  * Something went wrong. Tattle. Clean up. Return error.
543  */
544  printf("ERROR: checkConnectionStatus failed\n");
545  delete pMessage;
546  return -1;
547 }
548 
549 
566 int
567 CMyApplication::scrubConfiguration (void)
568 {
569  if(0 != resetConfigurationToFactoryDefaults())
570  {
571  return -1;
572  }
573 
574  if(0 != deleteAllROSpecs())
575  {
576  return -2;
577  }
578 
579  return 0;
580 }
581 
582 
603 int
604 CMyApplication::resetConfigurationToFactoryDefaults (void)
605 {
606  CSET_READER_CONFIG * pCmd;
607  CMessage * pRspMsg;
609 
610  /*
611  * Compose the command message
612  */
613  pCmd = new CSET_READER_CONFIG();
614  pCmd->setMessageID(101);
615  pCmd->setResetToFactoryDefault(1);
616 
617  /*
618  * Send the message, expect the response of certain type
619  */
620  pRspMsg = transact(pCmd);
621 
622  /*
623  * Done with the command message
624  */
625  delete pCmd;
626 
627  /*
628  * transact() returns NULL if something went wrong.
629  */
630  if(NULL == pRspMsg)
631  {
632  /* transact already tattled */
633  return -1;
634  }
635 
636  /*
637  * Cast to a SET_READER_CONFIG_RESPONSE message.
638  */
639  pRsp = (CSET_READER_CONFIG_RESPONSE *) pRspMsg;
640 
641  /*
642  * Check the LLRPStatus parameter.
643  */
644  if(0 != checkLLRPStatus(pRsp->getLLRPStatus(),
645  "resetConfigurationToFactoryDefaults"))
646  {
647  /* checkLLRPStatus already tattled */
648  delete pRspMsg;
649  return -1;
650  }
651 
652  /*
653  * Done with the response message.
654  */
655  delete pRspMsg;
656 
657  /*
658  * Tattle progress, maybe
659  */
660  if(m_Verbose)
661  {
662  printf("INFO: Configuration reset to factory defaults\n");
663  }
664 
665  /*
666  * Victory.
667  */
668  return 0;
669 }
670 
671 
691 int
692 CMyApplication::deleteAllROSpecs (void)
693 {
694  CDELETE_ROSPEC * pCmd;
695  CMessage * pRspMsg;
697 
698  /*
699  * Compose the command message
700  */
701  pCmd = new CDELETE_ROSPEC();
702  pCmd->setMessageID(102);
703  pCmd->setROSpecID(0); /* All */
704 
705  /*
706  * Send the message, expect the response of certain type
707  */
708  pRspMsg = transact(pCmd);
709 
710  /*
711  * Done with the command message
712  */
713  delete pCmd;
714 
715  /*
716  * transact() returns NULL if something went wrong.
717  */
718  if(NULL == pRspMsg)
719  {
720  /* transact already tattled */
721  return -1;
722  }
723 
724  /*
725  * Cast to a DELETE_ROSPEC_RESPONSE message.
726  */
727  pRsp = (CDELETE_ROSPEC_RESPONSE *) pRspMsg;
728 
729  /*
730  * Check the LLRPStatus parameter.
731  */
732  if(0 != checkLLRPStatus(pRsp->getLLRPStatus(), "deleteAllROSpecs"))
733  {
734  /* checkLLRPStatus already tattled */
735  delete pRspMsg;
736  return -1;
737  }
738 
739  /*
740  * Done with the response message.
741  */
742  delete pRspMsg;
743 
744  /*
745  * Tattle progress, maybe
746  */
747  if(m_Verbose)
748  {
749  printf("INFO: All ROSpecs are deleted\n");
750  }
751 
752  /*
753  * Victory.
754  */
755  return 0;
756 }
757 
758 
830 int
831 CMyApplication::addROSpec (void)
832 {
833  CROSpecStartTrigger * pROSpecStartTrigger =
834  new CROSpecStartTrigger();
835  pROSpecStartTrigger->setROSpecStartTriggerType(
837 
838  CROSpecStopTrigger * pROSpecStopTrigger = new CROSpecStopTrigger();
840  pROSpecStopTrigger->setDurationTriggerValue(0); /* n/a */
841 
842  CROBoundarySpec * pROBoundarySpec = new CROBoundarySpec();
843  pROBoundarySpec->setROSpecStartTrigger(pROSpecStartTrigger);
844  pROBoundarySpec->setROSpecStopTrigger(pROSpecStopTrigger);
845 
846  CAISpecStopTrigger * pAISpecStopTrigger = new CAISpecStopTrigger();
847  pAISpecStopTrigger->setAISpecStopTriggerType(
849  pAISpecStopTrigger->setDurationTrigger(5000);
850 
851  CInventoryParameterSpec * pInventoryParameterSpec =
853  pInventoryParameterSpec->setInventoryParameterSpecID(1234);
854  pInventoryParameterSpec->setProtocolID(AirProtocols_EPCGlobalClass1Gen2);
855 
856  llrp_u16v_t AntennaIDs = llrp_u16v_t(1);
857  AntennaIDs.m_pValue[0] = 0; /* All */
858 
859  CAISpec * pAISpec = new CAISpec();
860  pAISpec->setAntennaIDs(AntennaIDs);
861  pAISpec->setAISpecStopTrigger(pAISpecStopTrigger);
862  pAISpec->addInventoryParameterSpec(pInventoryParameterSpec);
863 
864  CTagReportContentSelector * pTagReportContentSelector =
866  pTagReportContentSelector->setEnableROSpecID(FALSE);
867  pTagReportContentSelector->setEnableSpecIndex(FALSE);
868  pTagReportContentSelector->setEnableInventoryParameterSpecID(FALSE);
869  pTagReportContentSelector->setEnableAntennaID(FALSE);
870  pTagReportContentSelector->setEnableChannelIndex(FALSE);
871  pTagReportContentSelector->setEnablePeakRSSI(FALSE);
872  pTagReportContentSelector->setEnableFirstSeenTimestamp(FALSE);
873  pTagReportContentSelector->setEnableLastSeenTimestamp(FALSE);
874  pTagReportContentSelector->setEnableTagSeenCount(FALSE);
875  pTagReportContentSelector->setEnableAccessSpecID(FALSE);
876 
877  CROReportSpec * pROReportSpec = new CROReportSpec();
878  pROReportSpec->setROReportTrigger(
880  pROReportSpec->setN(0); /* Unlimited */
881  pROReportSpec->setTagReportContentSelector(pTagReportContentSelector);
882 
883  CROSpec * pROSpec = new CROSpec();
884  pROSpec->setROSpecID(123);
885  pROSpec->setPriority(0);
887  pROSpec->setROBoundarySpec(pROBoundarySpec);
888  pROSpec->addSpecParameter(pAISpec);
889  pROSpec->setROReportSpec(pROReportSpec);
890 
891  CADD_ROSPEC * pCmd;
892  CMessage * pRspMsg;
893  CADD_ROSPEC_RESPONSE * pRsp;
894 
895  /*
896  * Compose the command message.
897  * N.B.: After the message is composed, all the parameters
898  * constructed, immediately above, are considered "owned"
899  * by the command message. When it is destructed so
900  * too will the parameters be.
901  */
902  pCmd = new CADD_ROSPEC();
903  pCmd->setMessageID(201);
904  pCmd->setROSpec(pROSpec);
905 
906  /*
907  * Send the message, expect the response of certain type
908  */
909  pRspMsg = transact(pCmd);
910 
911  /*
912  * Done with the command message.
913  * N.B.: And the parameters
914  */
915  delete pCmd;
916 
917  /*
918  * transact() returns NULL if something went wrong.
919  */
920  if(NULL == pRspMsg)
921  {
922  /* transact already tattled */
923  return -1;
924  }
925 
926  /*
927  * Cast to a ADD_ROSPEC_RESPONSE message.
928  */
929  pRsp = (CADD_ROSPEC_RESPONSE *) pRspMsg;
930 
931  /*
932  * Check the LLRPStatus parameter.
933  */
934  if(0 != checkLLRPStatus(pRsp->getLLRPStatus(), "addROSpec"))
935  {
936  /* checkLLRPStatus already tattled */
937  delete pRspMsg;
938  return -1;
939  }
940 
941  /*
942  * Done with the response message.
943  */
944  delete pRspMsg;
945 
946  /*
947  * Tattle progress, maybe
948  */
949  if(m_Verbose)
950  {
951  printf("INFO: ROSpec added\n");
952  }
953 
954  /*
955  * Victory.
956  */
957  return 0;
958 }
959 
960 
978 int
979 CMyApplication::enableROSpec (void)
980 {
981  CENABLE_ROSPEC * pCmd;
982  CMessage * pRspMsg;
984 
985  /*
986  * Compose the command message
987  */
988  pCmd = new CENABLE_ROSPEC();
989  pCmd->setMessageID(202);
990  pCmd->setROSpecID(123);
991 
992  /*
993  * Send the message, expect the response of certain type
994  */
995  pRspMsg = transact(pCmd);
996 
997  /*
998  * Done with the command message
999  */
1000  delete pCmd;
1001 
1002  /*
1003  * transact() returns NULL if something went wrong.
1004  */
1005  if(NULL == pRspMsg)
1006  {
1007  /* transact already tattled */
1008  return -1;
1009  }
1010 
1011  /*
1012  * Cast to a ENABLE_ROSPEC_RESPONSE message.
1013  */
1014  pRsp = (CENABLE_ROSPEC_RESPONSE *) pRspMsg;
1015 
1016  /*
1017  * Check the LLRPStatus parameter.
1018  */
1019  if(0 != checkLLRPStatus(pRsp->getLLRPStatus(), "enableROSpec"))
1020  {
1021  /* checkLLRPStatus already tattled */
1022  delete pRspMsg;
1023  return -1;
1024  }
1025 
1026  /*
1027  * Done with the response message.
1028  */
1029  delete pRspMsg;
1030 
1031  /*
1032  * Tattle progress, maybe
1033  */
1034  if(m_Verbose)
1035  {
1036  printf("INFO: ROSpec enabled\n");
1037  }
1038 
1039  /*
1040  * Victory.
1041  */
1042  return 0;
1043 }
1044 
1045 
1063 int
1064 CMyApplication::startROSpec (void)
1065 {
1066  CSTART_ROSPEC * pCmd;
1067  CMessage * pRspMsg;
1068  CSTART_ROSPEC_RESPONSE * pRsp;
1069 
1070  /*
1071  * Compose the command message
1072  */
1073  pCmd = new CSTART_ROSPEC();
1074  pCmd->setMessageID(202);
1075  pCmd->setROSpecID(123);
1076 
1077  /*
1078  * Send the message, expect the response of certain type
1079  */
1080  pRspMsg = transact(pCmd);
1081 
1082  /*
1083  * Done with the command message
1084  */
1085  delete pCmd;
1086 
1087  /*
1088  * transact() returns NULL if something went wrong.
1089  */
1090  if(NULL == pRspMsg)
1091  {
1092  /* transact already tattled */
1093  return -1;
1094  }
1095 
1096  /*
1097  * Cast to a START_ROSPEC_RESPONSE message.
1098  */
1099  pRsp = (CSTART_ROSPEC_RESPONSE *) pRspMsg;
1100 
1101  /*
1102  * Check the LLRPStatus parameter.
1103  */
1104  if(0 != checkLLRPStatus(pRsp->getLLRPStatus(), "startROSpec"))
1105  {
1106  /* checkLLRPStatus already tattled */
1107  delete pRspMsg;
1108  return -1;
1109  }
1110 
1111  /*
1112  * Done with the response message.
1113  */
1114  delete pRspMsg;
1115 
1116  /*
1117  * Tattle progress
1118  */
1119  if(m_Verbose)
1120  {
1121  printf("INFO: ROSpec started\n");
1122  }
1123 
1124  /*
1125  * Victory.
1126  */
1127  return 0;
1128 }
1129 
1130 
1146 int
1147 CMyApplication::awaitAndPrintReport (void)
1148 {
1149  int bDone = 0;
1150  int retVal = 0;
1151 
1152  /*
1153  * Keep receiving messages until done or until
1154  * something bad happens.
1155  */
1156  while(!bDone)
1157  {
1158  CMessage * pMessage;
1159  const CTypeDescriptor * pType;
1160 
1161  /*
1162  * Wait up to 7 seconds for a message. The report
1163  * should occur within 5 seconds.
1164  */
1165  pMessage = recvMessage(7000);
1166  if(NULL == pMessage)
1167  {
1168  /*
1169  * Did not receive a message within a reasonable
1170  * amount of time. recvMessage() already tattled
1171  */
1172  retVal = -2;
1173  bDone = 1;
1174  continue;
1175  }
1176 
1177  /*
1178  * What happens depends on what kind of message
1179  * received. Use the type label (m_pType) to
1180  * discriminate message types.
1181  */
1182  pType = pMessage->m_pType;
1183 
1184  /*
1185  * Is it a tag report? If so, print it out.
1186  */
1187  if(&CRO_ACCESS_REPORT::s_typeDescriptor == pType)
1188  {
1189  CRO_ACCESS_REPORT * pNtf;
1190 
1191  pNtf = (CRO_ACCESS_REPORT *) pMessage;
1192 
1193  printTagReportData(pNtf);
1194  bDone = 1;
1195  retVal = 0;
1196  }
1197 
1198  /*
1199  * Is it a reader event? This example only recognizes
1200  * AntennaEvents.
1201  */
1202  else if(&CREADER_EVENT_NOTIFICATION::s_typeDescriptor == pType)
1203  {
1205  CReaderEventNotificationData *pNtfData;
1206 
1207  pNtf = (CREADER_EVENT_NOTIFICATION *) pMessage;
1208 
1209  pNtfData = pNtf->getReaderEventNotificationData();
1210  if(NULL != pNtfData)
1211  {
1212  handleReaderEventNotification(pNtfData);
1213  }
1214  else
1215  {
1216  /*
1217  * This should never happen. Using continue
1218  * to keep indent depth down.
1219  */
1220  printf("WARNING: READER_EVENT_NOTIFICATION without data\n");
1221  }
1222  }
1223 
1224  /*
1225  * Hmmm. Something unexpected. Just tattle and keep going.
1226  */
1227  else
1228  {
1229  printf("WARNING: Ignored unexpected message during monitor: %s\n",
1230  pType->m_pName);
1231  }
1232 
1233  /*
1234  * Done with the received message
1235  */
1236  delete pMessage;
1237  }
1238 
1239  return retVal;
1240 }
1241 
1242 
1257 void
1258 CMyApplication::printTagReportData (
1259  CRO_ACCESS_REPORT * pRO_ACCESS_REPORT)
1260 {
1261  std::list<CTagReportData *>::iterator Cur;
1262  unsigned int nEntry = 0;
1263 
1264  /*
1265  * Loop through and count the number of entries
1266  */
1267  for(
1268  Cur = pRO_ACCESS_REPORT->beginTagReportData();
1269  Cur != pRO_ACCESS_REPORT->endTagReportData();
1270  Cur++)
1271  {
1272  nEntry++;
1273  }
1274 
1275  printf("INFO: %u tag report entries\n", nEntry);
1276 
1277  /*
1278  * Loop through again and print each entry.
1279  */
1280  for(
1281  Cur = pRO_ACCESS_REPORT->beginTagReportData();
1282  Cur != pRO_ACCESS_REPORT->endTagReportData();
1283  Cur++)
1284  {
1285  printOneTagReportData(*Cur);
1286  }
1287 }
1288 
1289 
1299 void
1300 CMyApplication::printOneTagReportData (
1301  CTagReportData * pTagReportData)
1302 {
1303  const CTypeDescriptor * pType;
1304  char aBuf[100*1024];
1305 
1306  /*
1307  * Print the EPC. It could be an 96-bit EPC_96 parameter
1308  * or an variable length EPCData parameter.
1309  */
1310 
1311  CParameter * pEPCParameter =
1312  pTagReportData->getEPCParameter();
1313 
1314  if(NULL != pEPCParameter)
1315  {
1316  char * p = aBuf;
1317  llrp_u96_t my_u96;
1318  llrp_u1v_t my_u1v;
1319  llrp_u8_t * pValue = NULL;
1320  unsigned int n, i;
1321 
1322  pType = pEPCParameter->m_pType;
1323  if(&CEPC_96::s_typeDescriptor == pType)
1324  {
1325  CEPC_96 *pEPC_96;
1326 
1327  pEPC_96 = (CEPC_96 *) pEPCParameter;
1328  my_u96 = pEPC_96->getEPC();
1329  pValue = my_u96.m_aValue;
1330  n = 12u;
1331  }
1332  else if(&CEPCData::s_typeDescriptor == pType)
1333  {
1334  CEPCData * pEPCData;
1335 
1336  pEPCData = (CEPCData *) pEPCParameter;
1337  my_u1v = pEPCData->getEPC();
1338  pValue = my_u1v.m_pValue;
1339  n = (my_u1v.m_nBit + 7u) / 8u;
1340  }
1341 
1342  if(NULL != pValue)
1343  {
1344  for(i = 0; i < n; i++)
1345  {
1346  if(0 < i && i%2 == 0)
1347  {
1348  *p++ = '-';
1349  }
1350  sprintf(p, "%02X", pValue[i]);
1351  while(*p) p++;
1352  }
1353  }
1354  else
1355  {
1356  strcpy(aBuf, "---unknown-epc-data-type---");
1357  }
1358  }
1359  else
1360  {
1361  strcpy(aBuf, "---missing-epc-data---");
1362  }
1363  printf("%-32s", aBuf);
1364 
1365  /*
1366  * End of line
1367  */
1368  printf("\n");
1369 }
1370 
1371 
1385 void
1386 CMyApplication::handleReaderEventNotification (
1387  CReaderEventNotificationData *pNtfData)
1388 {
1389  CAntennaEvent * pAntennaEvent;
1390  CReaderExceptionEvent * pReaderExceptionEvent;
1391  int nReported = 0;
1392 
1393  pAntennaEvent = pNtfData->getAntennaEvent();
1394  if(NULL != pAntennaEvent)
1395  {
1396  handleAntennaEvent(pAntennaEvent);
1397  nReported++;
1398  }
1399 
1400  pReaderExceptionEvent = pNtfData->getReaderExceptionEvent();
1401  if(NULL != pReaderExceptionEvent)
1402  {
1403  handleReaderExceptionEvent(pReaderExceptionEvent);
1404  nReported++;
1405  }
1406 
1407  /*
1408  * Similarly handle other events here:
1409  * HoppingEvent
1410  * GPIEvent
1411  * ROSpecEvent
1412  * ReportBufferLevelWarningEvent
1413  * ReportBufferOverflowErrorEvent
1414  * RFSurveyEvent
1415  * AISpecEvent
1416  * ConnectionAttemptEvent
1417  * ConnectionCloseEvent
1418  * Custom
1419  */
1420 
1421  if(0 == nReported)
1422  {
1423  printf("NOTICE: Unexpected (unhandled) ReaderEvent\n");
1424  }
1425 }
1426 
1427 
1439 void
1440 CMyApplication::handleAntennaEvent (
1441  CAntennaEvent * pAntennaEvent)
1442 {
1443  EAntennaEventType eEventType;
1444  llrp_u16_t AntennaID;
1445  char * pStateStr;
1446 
1447  eEventType = pAntennaEvent->getEventType();
1448  AntennaID = pAntennaEvent->getAntennaID();
1449 
1450  switch(eEventType)
1451  {
1453  pStateStr = "disconnected";
1454  break;
1455 
1457  pStateStr = "connected";
1458  break;
1459 
1460  default:
1461  pStateStr = "?unknown-event?";
1462  break;
1463  }
1464 
1465  printf("NOTICE: Antenna %d is %s\n", AntennaID, pStateStr);
1466 }
1467 
1468 
1481 void
1482 CMyApplication::handleReaderExceptionEvent (
1483  CReaderExceptionEvent * pReaderExceptionEvent)
1484 {
1485  llrp_utf8v_t Message;
1486 
1487  Message = pReaderExceptionEvent->getMessage();
1488 
1489  if(0 < Message.m_nValue && NULL != Message.m_pValue)
1490  {
1491  printf("NOTICE: ReaderException '%.*s'\n",
1492  Message.m_nValue, Message.m_pValue);
1493  }
1494  else
1495  {
1496  printf("NOTICE: ReaderException but no message\n");
1497  }
1498 }
1499 
1500 
1519 int
1520 CMyApplication::checkLLRPStatus (
1521  CLLRPStatus * pLLRPStatus,
1522  char * pWhatStr)
1523 {
1524  /*
1525  * The LLRPStatus parameter is mandatory in all responses.
1526  * If it is missing there should have been a decode error.
1527  * This just makes sure (remember, this program is a
1528  * diagnostic and suppose to catch LTKC mistakes).
1529  */
1530  if(NULL == pLLRPStatus)
1531  {
1532  printf("ERROR: %s missing LLRP status\n", pWhatStr);
1533  return -1;
1534  }
1535 
1536  /*
1537  * Make sure the status is M_Success.
1538  * If it isn't, print the error string if one.
1539  * This does not try to pretty-print the status
1540  * code. To get that, run this program with -vv
1541  * and examine the XML output.
1542  */
1543  if(StatusCode_M_Success != pLLRPStatus->getStatusCode())
1544  {
1545  llrp_utf8v_t ErrorDesc;
1546 
1547  ErrorDesc = pLLRPStatus->getErrorDescription();
1548 
1549  if(0 == ErrorDesc.m_nValue)
1550  {
1551  printf("ERROR: %s failed, no error description given\n",
1552  pWhatStr);
1553  }
1554  else
1555  {
1556  printf("ERROR: %s failed, %.*s\n",
1557  pWhatStr, ErrorDesc.m_nValue, ErrorDesc.m_pValue);
1558  }
1559  return -2;
1560  }
1561 
1562  /*
1563  * Victory. Everything is fine.
1564  */
1565  return 0;
1566 }
1567 
1568 
1592 CMessage *
1593 CMyApplication::transact (
1594  CMessage * pSendMsg)
1595 {
1596  CConnection * pConn = m_pConnectionToReader;
1597  CMessage * pRspMsg;
1598 
1599  /*
1600  * Print the XML text for the outbound message if
1601  * verbosity is 2 or higher.
1602  */
1603  if(1 < m_Verbose)
1604  {
1605  printf("\n===================================\n");
1606  printf("INFO: Transact sending\n");
1607  printXMLMessage(pSendMsg);
1608  }
1609 
1610  /*
1611  * Send the message, expect the response of certain type.
1612  * If LLRP::CConnection::transact() returns NULL then there was
1613  * an error. In that case we try to print the error details.
1614  */
1615  pRspMsg = pConn->transact(pSendMsg, 5000);
1616 
1617  if(NULL == pRspMsg)
1618  {
1619  const CErrorDetails * pError = pConn->getTransactError();
1620 
1621  printf("ERROR: %s transact failed, %s\n",
1622  pSendMsg->m_pType->m_pName,
1623  pError->m_pWhatStr ? pError->m_pWhatStr : "no reason given");
1624 
1625  if(NULL != pError->m_pRefType)
1626  {
1627  printf("ERROR: ... reference type %s\n",
1628  pError->m_pRefType->m_pName);
1629  }
1630 
1631  if(NULL != pError->m_pRefField)
1632  {
1633  printf("ERROR: ... reference field %s\n",
1634  pError->m_pRefField->m_pName);
1635  }
1636 
1637  return NULL;
1638  }
1639 
1640  /*
1641  * Print the XML text for the inbound message if
1642  * verbosity is 2 or higher.
1643  */
1644  if(1 < m_Verbose)
1645  {
1646  printf("\n- - - - - - - - - - - - - - - - - -\n");
1647  printf("INFO: Transact received response\n");
1648  printXMLMessage(pRspMsg);
1649  }
1650 
1651  /*
1652  * If it is an ERROR_MESSAGE (response from reader
1653  * when it can't understand the request), tattle
1654  * and declare defeat.
1655  */
1656  if(&CERROR_MESSAGE::s_typeDescriptor == pRspMsg->m_pType)
1657  {
1658  const CTypeDescriptor * pResponseType;
1659 
1660  pResponseType = pSendMsg->m_pType->m_pResponseType;
1661 
1662  printf("ERROR: Received ERROR_MESSAGE instead of %s\n",
1663  pResponseType->m_pName);
1664  delete pRspMsg;
1665  pRspMsg = NULL;
1666  }
1667 
1668  return pRspMsg;
1669 }
1670 
1671 
1696 CMessage *
1697 CMyApplication::recvMessage (
1698  int nMaxMS)
1699 {
1700  CConnection * pConn = m_pConnectionToReader;
1701  CMessage * pMessage;
1702 
1703  /*
1704  * Receive the message subject to a time limit
1705  */
1706  pMessage = pConn->recvMessage(nMaxMS);
1707 
1708  /*
1709  * If LLRP::CConnection::recvMessage() returns NULL then there was
1710  * an error. In that case we try to print the error details.
1711  */
1712  if(NULL == pMessage)
1713  {
1714  const CErrorDetails * pError = pConn->getRecvError();
1715 
1716  printf("ERROR: recvMessage failed, %s\n",
1717  pError->m_pWhatStr ? pError->m_pWhatStr : "no reason given");
1718 
1719  if(NULL != pError->m_pRefType)
1720  {
1721  printf("ERROR: ... reference type %s\n",
1722  pError->m_pRefType->m_pName);
1723  }
1724 
1725  if(NULL != pError->m_pRefField)
1726  {
1727  printf("ERROR: ... reference field %s\n",
1728  pError->m_pRefField->m_pName);
1729  }
1730 
1731  return NULL;
1732  }
1733 
1734  /*
1735  * Print the XML text for the inbound message if
1736  * verbosity is 2 or higher.
1737  */
1738  if(1 < m_Verbose)
1739  {
1740  printf("\n===================================\n");
1741  printf("INFO: Message received\n");
1742  printXMLMessage(pMessage);
1743  }
1744 
1745  return pMessage;
1746 }
1747 
1748 
1766 int
1767 CMyApplication::sendMessage (
1768  CMessage * pSendMsg)
1769 {
1770  CConnection * pConn = m_pConnectionToReader;
1771 
1772  /*
1773  * Print the XML text for the outbound message if
1774  * verbosity is 2 or higher.
1775  */
1776  if(1 < m_Verbose)
1777  {
1778  printf("\n===================================\n");
1779  printf("INFO: Sending\n");
1780  printXMLMessage(pSendMsg);
1781  }
1782 
1783  /*
1784  * If LLRP::CConnection::sendMessage() returns other than RC_OK
1785  * then there was an error. In that case we try to print
1786  * the error details.
1787  */
1788  if(RC_OK != pConn->sendMessage(pSendMsg))
1789  {
1790  const CErrorDetails * pError = pConn->getSendError();
1791 
1792  printf("ERROR: %s sendMessage failed, %s\n",
1793  pSendMsg->m_pType->m_pName,
1794  pError->m_pWhatStr ? pError->m_pWhatStr : "no reason given");
1795 
1796  if(NULL != pError->m_pRefType)
1797  {
1798  printf("ERROR: ... reference type %s\n",
1799  pError->m_pRefType->m_pName);
1800  }
1801 
1802  if(NULL != pError->m_pRefField)
1803  {
1804  printf("ERROR: ... reference field %s\n",
1805  pError->m_pRefField->m_pName);
1806  }
1807 
1808  return -1;
1809  }
1810 
1811  /*
1812  * Victory
1813  */
1814  return 0;
1815 }
1816 
1817 
1831 void
1832 CMyApplication::printXMLMessage (
1833  CMessage * pMessage)
1834 {
1835  char aBuf[100*1024];
1836 
1837  /*
1838  * Convert the message to an XML string.
1839  * This fills the buffer with either the XML string
1840  * or an error message. The return value could
1841  * be checked.
1842  */
1843 
1844  pMessage->toXMLString(aBuf, sizeof aBuf);
1845 
1846  /*
1847  * Print the XML Text to the standard output.
1848  */
1849  printf("%s", aBuf);
1850 }
Class Definition CROBoundarySpec for LLRP parameter ROBoundarySpec.
Definition: ltkcpp.h:9540
void setDurationTrigger(llrp_u32_t value)
Set accessor functions for the LLRP DurationTrigger field.
Definition: ltkcpp.h:10523
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
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
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.
std::list< CTagReportData * >::iterator beginTagReportData(void)
Returns the first element of the TagReportData sub-parameter list.
Definition: ltkcpp.h:6187
const CFieldDescriptor * m_pRefField
If non-NULL this is the field descriptors for the errored field.
Definition: ltkcpp_base.h:641
void setROSpecID(llrp_u32_t value)
Set accessor functions for the LLRP ROSpecID field.
Definition: ltkcpp.h:2542
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
void setPriority(llrp_u8_t value)
Set accessor functions for the LLRP Priority field.
Definition: ltkcpp.h:9401
void usage(char *pProgName)
Print usage message and exit.
Definition: example1.cpp:247
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
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
void setEnableAccessSpecID(llrp_u1_t value)
Set accessor functions for the LLRP EnableAccessSpecID field.
Definition: ltkcpp.h:14081
llrp_u96_t getEPC(void)
Get accessor functions for the LLRP EPC field.
Definition: ltkcpp.h:14952
Class Definition CSTART_ROSPEC for LLRP message START_ROSPEC.
Definition: ltkcpp.h:2674
void setCurrentState(EROSpecState value)
Set accessor functions for the LLRP CurrentState field.
Definition: ltkcpp.h:9427
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 CDELETE_ROSPEC for LLRP message DELETE_ROSPEC.
Definition: ltkcpp.h:2484
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
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
Class Definition CRO_ACCESS_REPORT for LLRP message RO_ACCESS_REPORT.
Definition: ltkcpp.h:6142
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.
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.
Class Definition CConnectionAttemptEvent for LLRP parameter ConnectionAttemptEvent.
Definition: ltkcpp.h:18713
Class Definition CSTART_ROSPEC_RESPONSE for LLRP message START_ROSPEC_RESPONSE.
Definition: ltkcpp.h:2772
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
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.
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
Class Definition CDELETE_ROSPEC_RESPONSE for LLRP message DELETE_ROSPEC_RESPONSE. ...
Definition: ltkcpp.h:2582
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
EResultCode setROSpec(CROSpec *pValue)
Set accessor functions for the LLRP ROSpec sub-parameter.
CMessage * transact(CMessage *pSendMessage, int nMaxMS)
Transact a LLRP request and response to a connection.
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
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
Class Definition CENABLE_ROSPEC for LLRP message ENABLE_ROSPEC.
Definition: ltkcpp.h:3054
CLLRPStatus * getLLRPStatus(void)
Get accessor functions for the LLRP LLRPStatus sub-parameter.
Definition: ltkcpp.h:2627
int openConnectionToReader(const char *pReaderHostName)
Open a connection to the reader over an unencrypted socket.
void setProtocolID(EAirProtocols value)
Set accessor functions for the LLRP ProtocolID field.
Definition: ltkcpp.h:10891
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
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
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
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
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
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 setROSpecStopTriggerType(EROSpecStopTriggerType value)
Set accessor functions for the LLRP ROSpecStopTriggerType field.
Definition: ltkcpp.h:10159
llrp_u1v_t getEPC(void)
Get accessor functions for the LLRP EPC field.
Definition: ltkcpp.h:14854
llrp_u16_t * m_pValue
Pointer to the first array element.
Definition: ltkcpp_base.h:185
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
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.
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 CSET_READER_CONFIG_RESPONSE for LLRP message SET_READER_CONFIG_RESPONSE.
Definition: ltkcpp.h:5802
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 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 setROSpecID(llrp_u32_t value)
Set accessor functions for the LLRP ROSpecID field.
Definition: ltkcpp.h:9375
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
void setAISpecStopTriggerType(EAISpecStopTriggerType value)
Set accessor functions for the LLRP AISpecStopTriggerType field.
Definition: ltkcpp.h:10497
Class Definition CAISpecStopTrigger for LLRP parameter AISpecStopTrigger.
Definition: ltkcpp.h:10439
EResultCode addInventoryParameterSpec(CInventoryParameterSpec *pValue)
Add a InventoryParameterSpec to the LLRP sub-parameter list.
LLRP connection class.
int main(int ac, char *av[])
Command main routine.
Definition: example1.cpp:165
EAntennaEventType
Global enumeration EAntennaEventType for LLRP enumerated field AntennaEventType.
Definition: ltkcpp.h:1041
EResultCode setROReportSpec(CROReportSpec *pValue)
Set accessor functions for the LLRP ROReportSpec sub-parameter.
void setEnableInventoryParameterSpecID(llrp_u1_t value)
Set accessor functions for the LLRP EnableInventoryParameterSpecID field.
Definition: ltkcpp.h:13899
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
EAntennaEventType getEventType(void)
Get accessor functions for the LLRP EventType field.
Definition: ltkcpp.h:18640
EResultCode setAISpecStopTrigger(CAISpecStopTrigger *pValue)
Set accessor functions for the LLRP AISpecStopTrigger sub-parameter.
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.