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

Function dumpcaps

tests/dumpcaps.c:70–974  ·  view source on GitHub ↗

* the rig may be in rig_init state, but not opened */

Source from the content-addressed store, hash-verified

68 * the rig may be in rig_init state, but not opened
69 */
70int dumpcaps(RIG *rig, FILE *fout)
71{
72 const struct rig_caps *caps;
73 struct rig_state *rs;
74 int status, i;
75 int can_esplit, can_echannel;
76 char freqbuf[20];
77 int backend_warnings = 0;
78 char warnbuf[4096];
79 char prntbuf[8192]; /* a malloc would be better.. */
80 char *label1, *label2, *label3, *label4, *label5;
81 char *labelrx1; // , *labelrx2, *labelrx3, *labelrx4, *labelrx5;
82
83 warnbuf[0] = 0;
84 prntbuf[0] = 0;
85
86 if (!rig || !rig->caps)
87 {
88 return -RIG_EINVAL;
89 }
90
91 caps = rig->caps;
92 rs = STATE(rig);
93
94 fprintf(fout, "Caps dump for model: %u\n", caps->rig_model);
95 fprintf(fout, "Model name:\t%s\n", caps->model_name);
96 fprintf(fout, "Mfg name:\t%s\n", caps->mfg_name);
97 fprintf(fout, "Hamlib version:\t%s\n", hamlib_version2);
98 fprintf(fout, "Backend version:\t%s\n", caps->version);
99 fprintf(fout, "Backend copyright:\t%s\n", caps->copyright);
100 fprintf(fout, "Backend status:\t%s\n", rig_strstatus(caps->status));
101 fprintf(fout, "Rig type:\t");
102
103 char *unknown = "Unknown";
104
105 for (i = 0; rig_type[i].type != -1; ++i)
106 {
107 if ((rig_type[i].type & caps->rig_type) == rig_type[i].type)
108 {
109 fprintf(fout, "%s ", rig_type[i].description);
110 unknown = "";
111 }
112 }
113
114 fprintf(fout, "%s\n", unknown);
115
116 if (strlen(unknown) > 0)
117 {
118 strcat(warnbuf, " RIG_TYPE");
119 backend_warnings++;
120 }
121
122 fprintf(fout, "PTT type:\t");
123
124 switch (caps->ptt_type)
125 {
126 case RIG_PTT_NONE:
127 fprintf(fout, "None\n");

Callers 6

mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
rigctl_parse.cFile · 0.85

Calls 15

rig_strstatusFunction · 0.85
rig_stragclevelFunction · 0.85
rig_sprintf_funcFunction · 0.85
rig_ext_func_foreachFunction · 0.85
rig_sprintf_level_granFunction · 0.85
rig_ext_level_foreachFunction · 0.85
rig_sprintf_parm_granFunction · 0.85
rig_ext_parm_foreachFunction · 0.85
rig_sprintf_modeFunction · 0.85
rig_sprintf_vfoFunction · 0.85
rig_sprintf_vfopFunction · 0.85
rig_sprintf_scanFunction · 0.85

Tested by

no test coverage detected