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

Function dummy_set_level

rigs/dummy/dummy.c:1295–1325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1293
1294
1295static int dummy_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
1296{
1297 struct dummy_priv_data *priv = (struct dummy_priv_data *)STATE(rig)->priv;
1298 channel_t *curr = priv->curr;
1299 int idx;
1300 char lstr[32];
1301
1302 ENTERFUNC;
1303 idx = rig_setting2idx(level);
1304
1305 if (idx >= RIG_SETTING_MAX)
1306 {
1307 RETURNFUNC(-RIG_EINVAL);
1308 }
1309
1310 curr->levels[idx] = val;
1311
1312 if (RIG_LEVEL_IS_FLOAT(level))
1313 {
1314 SNPRINTF(lstr, sizeof(lstr), "%f", val.f);
1315 }
1316 else
1317 {
1318 SNPRINTF(lstr, sizeof(lstr), "%d", val.i);
1319 }
1320
1321 rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s %s\n", __func__,
1322 rig_strlevel(level), lstr);
1323
1324 RETURNFUNC(RIG_OK);
1325}
1326
1327
1328static int dummy_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)

Callers

nothing calls this directly

Calls 3

rig_setting2idxFunction · 0.85
rig_debugFunction · 0.85
rig_strlevelFunction · 0.85

Tested by

no test coverage detected