sr_config_free(cfg);
return ret;
-
}
/*
switch (is_secondary << 8 | buf[0]) {
case 0x001:
- return is_parallel ?
+ return is_parallel ?
SR_MQ_PARALLEL_INDUCTANCE : SR_MQ_SERIES_INDUCTANCE;
case 0x002:
return is_parallel ?
return MODEL_PAR;
else
return MODEL_SER;
-
}
static gboolean packet_valid(const uint8_t *pkt)
return TRUE;
}
-static int add_channel(struct sr_dev_inst *sdi, int idx, const char *name)
-{
- struct sr_channel *ch;
-
- ch = sr_channel_new(idx, SR_CHANNEL_ANALOG, TRUE, name);
- sdi->channels = g_slist_append(sdi->channels, ch);
-
- return SR_OK;
-}
-
static const char *const channel_names[] = { "P1", "P2" };
static int setup_channels(struct sr_dev_inst *sdi)
ret = SR_ERR_BUG;
- for (i = 0; i < ARRAY_SIZE(channel_names); i++) {
- ret = add_channel(sdi, i, channel_names[i]);
- if (ret != SR_OK)
- break;
- }
+ for (i = 0; i < ARRAY_SIZE(channel_names); i++)
+ sr_channel_new(sdi, i, SR_CHANNEL_ANALOG, TRUE, channel_names[i]);
return ret;
}