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

Function dump_chan

tests/dumpmem.c:159–400  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157
158
159int dump_chan(RIG *rig, int chan_num)
160{
161 channel_t chan;
162 int status;
163 char freqbuf[20];
164
165 chan.vfo = RIG_VFO_MEM;
166 chan.channel_num = chan_num;
167 status = rig_get_channel(rig, RIG_VFO_NONE, &chan, 1);
168
169 if (status != RIG_OK)
170 {
171 printf("rig_get_channel: error = %s \n", rigerror(status));
172 return status;
173 }
174
175 printf("Channel: %d\n", chan.channel_num);
176
177 sprintf_freq(freqbuf, sizeof(freqbuf), chan.freq);
178 printf("Frequency: %s\n", freqbuf);
179 printf("Mode: %s\n", decode_modes(chan.mode));
180
181 sprintf_freq(freqbuf, sizeof(freqbuf), chan.width);
182 printf("Width: %s\n", freqbuf);
183 printf("VFO: %s\n", rig_strvfo(chan.vfo));
184
185 printf("Split: %d\n", chan.split);
186 sprintf_freq(freqbuf, sizeof(freqbuf), chan.tx_freq);
187 printf("TXFrequency: %s\n", freqbuf);
188 printf("TXMode: %s\n", decode_modes(chan.tx_mode));
189
190 sprintf_freq(freqbuf, sizeof(freqbuf), chan.tx_width);
191 printf("TXWidth: %s\n", freqbuf);
192
193 printf("Shift: %s\n", rig_strptrshift(chan.rptr_shift));
194 sprintf_freq(freqbuf, sizeof(freqbuf), chan.rptr_offs);
195 printf("Offset: %s%s\n", chan.rptr_offs > 0 ? "+" : "", freqbuf);
196
197 printf("Antenna: %u\n", chan.ant);
198
199 sprintf_freq(freqbuf, sizeof(freqbuf), chan.tuning_step);
200 printf("Step: %s\n", freqbuf);
201
202 sprintf_freq(freqbuf, sizeof(freqbuf), chan.rit);
203 printf("RIT: %s%s\n", chan.rit > 0 ? "+" : "", freqbuf);
204
205 sprintf_freq(freqbuf, sizeof(freqbuf), chan.xit);
206 printf("XIT: %s%s\n", chan.xit > 0 ? "+" : "", freqbuf);
207 printf("CTCSS: %u.%uHz\n", chan.ctcss_tone / 10, chan.ctcss_tone % 10);
208 printf("CTCSSsql: %u.%uHz\n", chan.ctcss_sql / 10, chan.ctcss_sql % 10);
209 printf("DCS: %u.%u\n", chan.dcs_code / 10, chan.dcs_code % 10);
210 printf("DCSsql: %u.%u\n", chan.dcs_sql / 10, chan.dcs_sql % 10);
211 printf("Name: %s\n", chan.channel_desc);
212
213 printf("Functions: ");
214
215 if (chan.funcs != 0)
216 {

Callers 1

mainFunction · 0.70

Calls 8

rig_get_channelFunction · 0.85
rigerrorFunction · 0.85
sprintf_freqFunction · 0.85
decode_modesFunction · 0.85
rig_strvfoFunction · 0.85
rig_strptrshiftFunction · 0.85
rig_has_set_levelFunction · 0.85
rig_setting2idxFunction · 0.85

Tested by

no test coverage detected