#define SERIALCOMM "2400/8n1/dtr=1/rts=1/flow=0"
-#define VENDOR_MOTECH "Motech"
-
static const uint32_t scanopts[] = {
SR_CONF_CONN,
SR_CONF_SERIALCOMM,
sdi = g_malloc0(sizeof(struct sr_dev_inst));
sdi->status = SR_ST_INACTIVE;
- sdi->vendor = g_strdup(VENDOR_MOTECH);
+ sdi->vendor = g_strdup("Motech");
sdi->model = g_strdup(models[modelid].modelstr);
sdi->version = g_strdup(verstr);
sdi->inst_type = SR_INST_SERIAL;
return std_dev_clear_with_callback(di, (std_dev_clear_callback)clear_helper);
}
-static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
- const struct sr_channel_group *cg)
+static int config_get(uint32_t key, GVariant **data,
+ const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
{
struct dev_context *devc;
struct sr_channel *ch;
return SR_OK;
}
-static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
- const struct sr_channel_group *cg)
+static int config_set(uint32_t key, GVariant *data,
+ const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
{
struct dev_context *devc;
struct sr_channel *ch;
return SR_OK;
}
-static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
- const struct sr_channel_group *cg)
+static int config_list(uint32_t key, GVariant **data,
+ const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
{
struct dev_context *devc;
struct sr_channel *ch;
*data = g_variant_new_strv(channel_modes, 1);
} else {
/* The other models support all modes. */
- *data = g_variant_new_strv(channel_modes, ARRAY_SIZE(channel_modes));
+ *data = g_variant_new_strv(ARRAY_AND_SIZE(channel_modes));
}
return SR_OK;
default:
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
if ((ch_idx == 0) || (ch_idx == 1)) /* CH1, CH2 */
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
- devopts_cg_ch12, ARRAY_SIZE(devopts_cg_ch12), sizeof(uint32_t));
+ *data = std_gvar_array_u32(ARRAY_AND_SIZE(devopts_cg_ch12));
else /* Must be CH3 */
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
- devopts_cg_ch3, ARRAY_SIZE(devopts_cg_ch3), sizeof(uint32_t));
+ *data = std_gvar_array_u32(ARRAY_AND_SIZE(devopts_cg_ch3));
break;
case SR_CONF_VOLTAGE_TARGET:
*data = std_gvar_min_max_step_array(devc->model->channels[ch_idx].voltage);