COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
gige_list.cpp File Reference
#include "device/general/gige_lib.h"
#include "agent/agentclass.h"
#include "support/datalib.h"
#include "time.h"
#include "support/elapsedtime.h"
Include dependency graph for gige_list.cpp:

Functions

int main (int argc, char *argv[])
 

Function Documentation

int main ( int  argc,
char *  argv[] 
)
37 {
38  std::vector<gige_acknowledge_ack> gige_list;
39  double wait_time = 0.;
40 
41  if (argc == 2)
42  {
43  wait_time = atof(argv[1]);
44  }
45 
47  et.start();
48  do
49  {
50  gige_list = gige_discover();
51  } while (gige_list.size() == 0 && et.split() < wait_time);
52 
53  if (!gige_list.size())
54  {
55  printf("Couldn't find any cameras\n");
56  exit(1);
57  }
58 
59  for (uint16_t i=0; i<gige_list.size(); ++i)
60  {
61  printf("Camera %u: %s %s %s\n", i, gige_value_to_address(gige_list[i].address), gige_list[i].serial_number, gige_list[i].manufacturer);
62  }
63 
64  exit(0);
65 }
int i
Definition: rw_test.cpp:37
vector< gige_acknowledge_ack > gige_discover()
Discover GIGE Camera.
Definition: gige_lib.cpp:332
ElapsedTime et
Definition: agent_cpu_device_test.cpp:51
char address[]
Definition: netperf_listen.cpp:69
void start()
ElapsedTime::start.
Definition: elapsedtime.cpp:203
char * gige_value_to_address(uint32_t value)
IP Value to address.
Definition: gige_lib.cpp:418
Definition: elapsedtime.h:62
double split()
ElapsedTime::split, gets the current elapsed time since the start()
Definition: elapsedtime.cpp:234