#define SERIALCOMM_1X_RS232 "8228/6n1/dtr=1/rts=1/flow=0" /* =8192, closer with divider */
#define SERIALCOMM_2X_RS232 "9600/6n1/dtr=1/rts=1/flow=0"
#define SERIALCOMM_2X "9600/8n1/dtr=1/rts=1/flow=0"
-#define VENDOR_GMC "Gossen Metrawatt"
static const uint32_t scanopts[] = {
SR_CONF_CONN,
}
if (model != METRAHIT_NONE) {
- sr_spew("%s %s detected!", VENDOR_GMC, gmc_model_str(model));
+ sr_spew("%s detected!", gmc_model_str(model));
sdi = g_malloc0(sizeof(struct sr_dev_inst));
sdi->status = SR_ST_INACTIVE;
- sdi->vendor = g_strdup(VENDOR_GMC);
+ sdi->vendor = g_strdup("Gossen Metrawatt");
sdi->model = g_strdup(gmc_model_str(model));
devc = g_malloc0(sizeof(struct dev_context));
sr_sw_limits_init(&devc->limits);
sdi = g_malloc0(sizeof(struct sr_dev_inst));
sdi->status = SR_ST_INACTIVE;
- sdi->vendor = g_strdup(VENDOR_GMC);
+ sdi->vendor = g_strdup("Gossen Metrawatt");
sdi->priv = devc;
/* Send message 03 "Query multimeter version and status" */
devc->buflen = 0;
if (devc->model != METRAHIT_NONE) {
- sr_spew("%s %s detected!", VENDOR_GMC, gmc_model_str(devc->model));
+ sr_spew("%s detected!", gmc_model_str(devc->model));
sr_sw_limits_init(&devc->limits);
sdi->model = g_strdup(gmc_model_str(devc->model));
sdi->version = g_strdup_printf("Firmware %d.%d", devc->fw_ver_maj, devc->fw_ver_min);
devc = g_malloc0(sizeof(struct dev_context));
sdi = g_malloc0(sizeof(struct sr_dev_inst));
sdi->status = SR_ST_INACTIVE;
- sdi->vendor = g_strdup(VENDOR_GMC);
+ sdi->vendor = g_strdup("Gossen Metrawatt");
}
};
- /* Free last alloc if no device found */
- if (devc->model == METRAHIT_NONE) {
- g_free(devc);
- sr_dev_inst_free(sdi);
- }
+ /* Free last alloc that was done in preparation. */
+ g_free(devc);
+ sr_dev_inst_free(sdi);
return std_scan_complete(di, devices);
return std_serial_dev_close(sdi);
}
-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;
}
/** Implementation of config_list for Metrahit 1x/2x send mode */
-static int config_list_sm(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
- const struct sr_channel_group *cg)
+static int config_list_sm(uint32_t key, GVariant **data,
+ const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
{
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts_sm);
}
/** Implementation of config_list for Metrahit 2x bidirectional mode */
-static int config_list_bd(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
- const struct sr_channel_group *cg)
+static int config_list_bd(uint32_t key, GVariant **data,
+ const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
{
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts_bd);
}