if (dlm_model_get(hw_info->model, &model_name, &model_index) != SR_OK)
goto fail;
- if (!(sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, MANUFACTURER_NAME,
- model_name, NULL)))
- goto fail;
+ sdi = sr_dev_inst_new();
+ sdi->status = SR_ST_ACTIVE;
+ sdi->vendor = g_strdup(MANUFACTURER_NAME);
+ sdi->model = g_strdup(model_name);
+ sdi->version = g_strdup(hw_info->firmware_version);
+
+ sdi->serial_num = g_strdup(hw_info->serial_number);
sr_scpi_hw_info_free(hw_info);
hw_info = NULL;
return CG_INVALID;
}
-static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
int ret, cg_type;
return g_variant_builder_end(&gvb);
}
-static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
int ret, cg_type;
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
int cg_type;
model = devc->model_config;
switch (key) {
- case SR_CONF_SCAN_OPTIONS:
- *data = NULL;
- break;
case SR_CONF_DEVICE_OPTIONS:
if (cg_type == CG_NONE) {
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- model->hw_caps, model->num_hwcaps, sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ model->devopts, model->num_devopts, sizeof(uint32_t));
} else if (cg_type == CG_ANALOG) {
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- model->analog_hwcaps, model->num_analog_hwcaps, sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ model->analog_devopts, model->num_analog_devopts, sizeof(uint32_t));
} else {
- *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- NULL, 0, sizeof(int32_t));
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+ NULL, 0, sizeof(uint32_t));
}
break;
case SR_CONF_COUPLING: