X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fhardware%2Fnorma-dmm%2Fapi.c;h=84ca43ca8351c4761309ffc61a949b671ec9c8de;hb=02a4f485de76b401eca7d3b82aac1808a12df4fe;hp=96d69b12f1e07dfbd1c99917ef66b20a8b79ae47;hpb=05199c0ac9f15f229d43e50e86c4c1eadc55deac;p=libsigrok.git
diff --git a/src/hardware/norma-dmm/api.c b/src/hardware/norma-dmm/api.c
index 96d69b12..84ca43ca 100644
--- a/src/hardware/norma-dmm/api.c
+++ b/src/hardware/norma-dmm/api.c
@@ -17,11 +17,6 @@
* along with this program. If not, see .
*/
-/** @file
- * Norma DM9x0/Siemens B102x DMMs driver.
- * @internal
- */
-
#include
#include "protocol.h"
@@ -104,8 +99,6 @@ static GSList *scan(struct sr_dev_driver *drv, GSList *options)
if (serial_open(serial, SERIAL_RDWR) != SR_OK)
return NULL;
- serial_flush(serial);
-
buf = g_malloc(BUF_MAX);
snprintf(req, sizeof(req), "%s\r\n",
@@ -115,6 +108,7 @@ static GSList *scan(struct sr_dev_driver *drv, GSList *options)
if (serial_write_blocking(serial, req, strlen(req),
serial_timeout(serial, strlen(req))) < 0) {
sr_err("Unable to send identification request.");
+ g_free(buf);
return NULL;
}
len = BUF_MAX;
@@ -164,8 +158,8 @@ static GSList *scan(struct sr_dev_driver *drv, GSList *options)
return std_scan_complete(drv, devices);
}
-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;
@@ -176,8 +170,8 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
return sr_sw_limits_config_set(&devc->limits, key, data);
}
-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)
{
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts);
}
@@ -192,7 +186,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
sr_sw_limits_acquisition_start(&devc->limits);
std_session_send_df_header(sdi);
- /* Poll every 100ms, or whenever some data comes in. */
serial = sdi->conn;
serial_source_add(sdi->session, serial, G_IO_IN, 100,
norma_dmm_receive_data, (void *)sdi);