X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fyokogawa-dlm%2Fapi.c;h=f6f0ce8a6d7c756e993470fadda51c40c974208e;hb=dd7a72ea697a172032f5473b0ddff5e8d47222f4;hp=5bba8d9bb52085930a835365dc6249ab5d6d8d53;hpb=105df67463b84683a35f3474eccc871e5aa4ed0e;p=libsigrok.git diff --git a/src/hardware/yokogawa-dlm/api.c b/src/hardware/yokogawa-dlm/api.c index 5bba8d9b..f6f0ce8a 100644 --- a/src/hardware/yokogawa-dlm/api.c +++ b/src/hardware/yokogawa-dlm/api.c @@ -26,7 +26,6 @@ static struct sr_dev_driver yokogawa_dlm_driver_info; static const char *MANUFACTURER_ID = "YOKOGAWA"; -static const char *MANUFACTURER_NAME = "Yokogawa"; static const uint32_t scanopts[] = { SR_CONF_CONN, @@ -87,7 +86,7 @@ static struct sr_dev_inst *probe_usbtmc_device(struct sr_scpi_dev_inst *scpi) goto fail; sdi = g_malloc0(sizeof(struct sr_dev_inst)); - sdi->vendor = g_strdup(MANUFACTURER_NAME); + sdi->vendor = g_strdup("Yokogawa"); sdi->model = g_strdup(model_name); sdi->version = g_strdup(hw_info->firmware_version); @@ -183,8 +182,8 @@ static int check_channel_group(struct dev_context *devc, return CG_INVALID; } -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) { int ret, cg_type; unsigned int i; @@ -283,8 +282,8 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s return ret; } -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) { int ret, cg_type; unsigned int i, j; @@ -438,7 +437,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd } static int config_channel_set(const struct sr_dev_inst *sdi, - struct sr_channel *ch, unsigned int changes) + struct sr_channel *ch, unsigned int changes) { /* Currently we only handle SR_CHANNEL_SET_ENABLED. */ if (changes != SR_CHANNEL_SET_ENABLED) @@ -447,8 +446,8 @@ static int config_channel_set(const struct sr_dev_inst *sdi, return dlm_channel_state_set(sdi, ch->index, ch->enabled); } -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) { int cg_type = CG_NONE; struct dev_context *devc; @@ -463,7 +462,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst * case SR_CONF_DEVICE_OPTIONS: return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts); case SR_CONF_TIMEBASE: - *data = std_gvar_tuple_array(&dlm_timebases, ARRAY_SIZE(dlm_timebases)); + *data = std_gvar_tuple_array(ARRAY_AND_SIZE(dlm_timebases)); return SR_OK; case SR_CONF_TRIGGER_SOURCE: if (!model) @@ -489,9 +488,9 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst * switch (key) { case SR_CONF_DEVICE_OPTIONS: if (cg_type == CG_ANALOG) - *data = std_gvar_array_u32(devopts_cg_analog, ARRAY_SIZE(devopts_cg_analog)); + *data = std_gvar_array_u32(ARRAY_AND_SIZE(devopts_cg_analog)); else if (cg_type == CG_DIGITAL) - *data = std_gvar_array_u32(devopts_cg_digital, ARRAY_SIZE(devopts_cg_digital)); + *data = std_gvar_array_u32(ARRAY_AND_SIZE(devopts_cg_digital)); else *data = std_gvar_array_u32(NULL, 0); break; @@ -504,7 +503,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst * case SR_CONF_VDIV: if (cg_type == CG_NONE) return SR_ERR_CHANNEL_GROUP; - *data = std_gvar_tuple_array(&dlm_vdivs, ARRAY_SIZE(dlm_vdivs)); + *data = std_gvar_tuple_array(ARRAY_AND_SIZE(dlm_vdivs)); break; default: return SR_ERR_NA;