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

Function main

tests/rigswr.c:65–303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63
64
65int main(int argc, char *argv[])
66{
67 RIG *rig; /* handle to rig (instance) */
68 rig_model_t my_model = RIG_MODEL_DUMMY;
69
70 int retcode; /* generic return code from functions */
71
72 int verbose = RIG_DEBUG_NONE;
73 const char *rig_file = NULL, *ptt_file = NULL;
74 ptt_type_t ptt_type = RIG_PTT_NONE;
75 int serial_rate = 0;
76 char *civaddr = NULL; /* NULL means no need to set conf */
77 char conf_parms[MAXCONFLEN] = "";
78 freq_t freq, freqstop;
79 freq_t step = kHz(100);
80 value_t pwr;
81
82 rig_set_debug(verbose);
83 while (1)
84 {
85 int c;
86 int option_index = 0;
87 char dummy[2];
88
89 c = getopt_long(argc, argv, SHORT_OPTIONS, long_options, &option_index);
90
91 if (c == -1)
92 {
93 break;
94 }
95
96 switch (c)
97 {
98 case 'h':
99 usage(stdout);
100 exit(0);
101
102 case 'V':
103 version();
104 exit(0);
105
106 case 'm':
107 my_model = atoi(optarg);
108 break;
109
110 case 'r':
111 rig_file = optarg;
112 break;
113
114 case 'c':
115 civaddr = optarg;
116 break;
117
118 case 's':
119 if (sscanf(optarg, "%d%1s", &serial_rate, dummy) != 1)
120 {
121 fprintf(stderr, "Invalid baud rate of %s\n", optarg);
122 exit(1);

Callers

nothing calls this directly

Calls 15

rig_set_debugFunction · 0.85
getopt_longFunction · 0.85
rig_debugFunction · 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
rig_set_freqFunction · 0.85
rig_set_modeFunction · 0.85
rig_set_levelFunction · 0.85
rig_set_pttFunction · 0.85

Tested by

no test coverage detected