COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
gige_ffc.cpp File Reference
Include dependency graph for gige_ffc.cpp:

Functions

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

Function Documentation

int main ( int  argc,
char *  argv[] 
)
5 {
7  char ipaddress[20] = "192.168.200.32";
8  uint16_t ffc_state = 0;
9 // uint32_t iretn;
10 
11  switch (argc)
12  {
13  case 3:
14  strcpy(ipaddress, argv[2]);
15  case 2:
16  switch(argv[1][1])
17  {
18  case 'x':
19  ffc_state = 2;
20  case 'f':
21  ffc_state = 0;
22  break;
23  case 'u':
24  ffc_state = 1;
25  break;
26  case 'n':
27  ffc_state = 10;
28  break;
29  }
30  break;
31  default:
32  printf("Usage: a35_ffc {off|auto|once} [ip_address]\n");
33  exit (1);
34  break;
35  }
36 
37  if ((handle=gige_open(ipaddress,0x02,40000,5000,10000000)) == NULL)
38  {
39  printf("Couldn't open camera\n");
40  exit(1);
41  }
42 
43  printf("Current State: %d\n", gige_readreg(handle, A35_FFCMODE));
44  switch(ffc_state)
45  {
46  case 0:
47  case 1:
48  case 2:
49  gige_writereg(handle, A35_FFCMODE, ffc_state); // Set FFC to manual or auto
50  break;
51  case 10:
52  gige_writereg(handle, A35_FFCMODE, A35_FFCMODE_MANUAL); // Set FFC to manual or auto
53  gige_writereg(handle, A35_COMMAND_DOFFC, 0); // Command FFC
54  break;
55  }
56  printf("Set To: %d\n", ffc_state);
57 
58  gige_close(handle);
59 
60 }
int gige_writereg(gige_handle *handle, uint32_t address, uint32_t data)
Write Register.
Definition: gige_lib.cpp:192
uint32_t gige_readreg(gige_handle *handle, uint32_t address)
Read GIGE Register.
Definition: gige_lib.cpp:237
#define A35_FFCMODE_MANUAL
Definition: gige_lib.h:449
#define A35_COMMAND_DOFFC
Definition: gige_lib.h:428
gige_handle * handle
Definition: kpc9612p_recv.cpp:33
#define A35_FFCMODE
Definition: gige_lib.h:429
gige_handle * gige_open(char address[18], uint8_t privilege, uint32_t heartbeat_msec, uint32_t socket_usec, uint32_t streambps)
Connect to camera.
Definition: gige_lib.cpp:64
Definition: gige_lib.h:336
void gige_close(gige_handle *handle)
Close GigE Camera.
Definition: gige_lib.cpp:177