MCPcopy Create free account
hub / github.com/Hamlib/Hamlib / main

Function main

tests/rigsmtr.c:70–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68
69
70int main(int argc, char *argv[])
71{
72 RIG *rig; /* handle to rig (instance) */
73 ROT *rot; /* handle to rotator (instance) */
74 rig_model_t rig_model = RIG_MODEL_DUMMY;
75 rot_model_t rot_model = ROT_MODEL_DUMMY;
76
77 int retcode; /* generic return code from functions */
78
79 int verbose = RIG_DEBUG_NONE;
80 const char *rig_file = NULL, *rot_file = NULL;
81 int serial_rate = 0;
82 int rot_serial_rate = 0;
83 char *civaddr = NULL; /* NULL means no need to set conf */
84 char rig_conf_parms[MAXCONFLEN] = "";
85 char rot_conf_parms[MAXCONFLEN] = "";
86
87 /* int with_rot = 1; */
88 azimuth_t azimuth;
89 elevation_t elevation;
90 unsigned step = 1000000; /* 1e6 us */
91
92 rig_set_debug(verbose);
93 while (1)
94 {
95 int c;
96 int option_index = 0;
97 char dummy[2];
98
99 c = getopt_long(argc, argv, SHORT_OPTIONS, long_options, &option_index);
100
101 if (c == -1)
102 {
103 break;
104 }
105
106 switch (c)
107 {
108 case 'h':
109 usage(stdout);
110 exit(0);
111
112 case 'V':
113 version();
114 exit(0);
115
116 case 'm':
117 rig_model = atoi(optarg);
118 break;
119
120 case 'r':
121 rig_file = optarg;
122 break;
123
124 case 'c':
125 civaddr = optarg;
126 break;
127

Callers

nothing calls this directly

Calls 15

rig_set_debugFunction · 0.85
getopt_longFunction · 0.85
rig_debugFunction · 0.85
set_conf_rigFunction · 0.85
rigerrorFunction · 0.85
rig_set_confFunction · 0.85
rig_token_lookupFunction · 0.85
rig_has_get_levelFunction · 0.85
rig_openFunction · 0.85
set_conf_rotFunction · 0.85
rot_openFunction · 0.85
rot_set_positionFunction · 0.85

Tested by

no test coverage detected