]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/serial-dmm/api.c
Add support for the Tenma 77-9380A multimeter.
[libsigrok.git] / src / hardware / serial-dmm / api.c
index 0809975334d16b101ea3381eff7488c9ea8f9eff..5f56dfde0cc8e8468f7ebc93c4d5e69fd76d696d 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <config.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <string.h>
-#include <errno.h>
 #include <glib.h>
-#include "libsigrok.h"
+#include <libsigrok/libsigrok.h>
 #include "libsigrok-internal.h"
 #include "protocol.h"
 
@@ -92,7 +92,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
        sr_info("Probing serial port %s.", conn);
 
-       drvc = di->priv;
+       drvc = di->context;
        devices = NULL;
        serial_flush(serial);
 
@@ -152,7 +152,7 @@ scan_cleanup:
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int cleanup(const struct sr_dev_driver *di)
@@ -178,13 +178,9 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
        switch (key) {
        case SR_CONF_LIMIT_SAMPLES:
                devc->limit_samples = g_variant_get_uint64(data);
-               sr_dbg("Setting sample limit to %" PRIu64 ".",
-                      devc->limit_samples);
                break;
        case SR_CONF_LIMIT_MSEC:
                devc->limit_msec = g_variant_get_uint64(data);
-               sr_dbg("Setting time limit to %" PRIu64 "ms.",
-                      devc->limit_msec);
                break;
        default:
                return SR_ERR_NA;
@@ -274,13 +270,13 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
                        .dev_close = std_serial_dev_close, \
                        .dev_acquisition_start = dev_acquisition_start, \
                        .dev_acquisition_stop = dev_acquisition_stop, \
-                       .priv = NULL, \
+                       .context = NULL, \
                }, \
                VENDOR, MODEL, CONN, BAUDRATE, PACKETSIZE, TIMEOUT, DELAY, \
                REQUEST, VALID, PARSE, DETAILS, sizeof(struct CHIPSET##_info) \
        }
 
-SR_PRIV struct dmm_info *serial_dmm_drivers[] = {
+SR_PRIV const struct dmm_info *serial_dmm_drivers[] = {
        DMM(
                "bbcgm-2010", metex14,
                "BBC Goertz Metrawatt", "M2110", "1200/7n2", 1200,
@@ -563,6 +559,18 @@ SR_PRIV struct dmm_info *serial_dmm_drivers[] = {
                sr_es519xx_2400_11b_packet_valid, sr_es519xx_2400_11b_parse,
                NULL
        ),
+       DMM(
+               "tenma-72-7730-ser", ut71x,
+               "Tenma", "72-7730 (UT-D02 cable)", "2400/7o1/rts=0/dtr=1",
+               2400, UT71X_PACKET_SIZE, 0, 0, NULL,
+               sr_ut71x_packet_valid, sr_ut71x_parse, NULL
+       ),
+       DMM(
+               "tenma-72-9380a-ser", ut71x,
+               "Tenma", "72-9380A (UT-D02 cable)", "2400/7o1/rts=0/dtr=1",
+               2400, UT71X_PACKET_SIZE, 0, 0, NULL,
+               sr_ut71x_packet_valid, sr_ut71x_parse, NULL
+       ),
        DMM(
                "tenma-72-7745-ser", fs9721,
                "Tenma", "72-7745 (UT-D02 cable)", "2400/8n1/rts=0/dtr=1",