X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fscpi-pps%2Fapi.c;h=bd7e6d6e983ea48d0a1c7dcca8eed0bbdfbdd163;hb=aed4ad0beaf64062752039a13f9a95326aa1df87;hp=2f4bdc9308e93e6c36203a43b21529b900f6251a;hpb=331f56543a10dddf261ab1208ed5c28ad418463a;p=libsigrok.git diff --git a/src/hardware/scpi-pps/api.c b/src/hardware/scpi-pps/api.c index 2f4bdc93..bd7e6d6e 100644 --- a/src/hardware/scpi-pps/api.c +++ b/src/hardware/scpi-pps/api.c @@ -25,7 +25,7 @@ static struct sr_dev_driver *di = &scpi_pps_driver_info; extern unsigned int num_pps_profiles; extern const struct scpi_pps pps_profiles[]; -static const int32_t scanopts[] = { +static const uint32_t scanopts[] = { SR_CONF_CONN, SR_CONF_SERIALCOMM, }; @@ -83,7 +83,7 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi) return NULL; } - sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, vendor, hw_info->model, + sdi = sr_dev_inst_new(SR_ST_ACTIVE, vendor, hw_info->model, hw_info->firmware_version); sdi->conn = scpi; sdi->driver = di; @@ -190,7 +190,7 @@ static int cleanup(void) return SR_OK; } -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) { struct dev_context *devc; @@ -313,7 +313,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, return ret; } -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) { struct sr_channel *ch; @@ -396,7 +396,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, 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) { struct dev_context *devc; @@ -409,8 +409,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, /* Always available, even without sdi. */ if (key == SR_CONF_SCAN_OPTIONS) { - *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, - scanopts, ARRAY_SIZE(scanopts), sizeof(int32_t)); + *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, + scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t)); return SR_OK; } @@ -423,9 +423,9 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, /* No channel group: global options. */ switch (key) { case SR_CONF_DEVICE_OPTIONS: - *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, + *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, devc->device->devopts, devc->device->num_devopts, - sizeof(int32_t)); + sizeof(uint32_t)); break; case SR_CONF_OUTPUT_CHANNEL_CONFIG: /* Not used. */ @@ -460,9 +460,9 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, switch (key) { case SR_CONF_DEVICE_OPTIONS: - *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, + *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, devc->device->devopts_cg, devc->device->num_devopts_cg, - sizeof(int32_t)); + sizeof(uint32_t)); break; case SR_CONF_OUTPUT_VOLTAGE_MAX: ch_spec = &(devc->device->channels[ch->index]);