]> sigrok.org Git - libsigrok.git/commitdiff
serial-dmm: add EEVblog 121GW device entry (-d eevblog-121gw:conn=<uart>)
authorGerhard Sittig <redacted>
Fri, 28 Sep 2018 17:38:23 +0000 (19:38 +0200)
committerUwe Hermann <redacted>
Sun, 14 Oct 2018 16:21:56 +0000 (18:21 +0200)
Add an "eevblog-121gw" subdriver entry for the EEVblog 121GW multimeter.
Use device dependent channel names instead of the default "P1" etc names.

It's assumed that the device's binary packet data is available at a COM
port. This means that an external BT to UART gateway is required until
BLE communication will be one of libsigrok's native connection types.

src/hardware/serial-dmm/api.c
src/libsigrok-internal.h

index bcff1913f5ee4d1e6db73e80acca88169dad6f75..3c501ade1e2654945227f42a3c3736534266a045 100644 (file)
@@ -136,6 +136,10 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        dmm->channel_count = 1;
        if (dmm->packet_parse == sr_metex14_4packets_parse)
                dmm->channel_count = 4;
+       if (dmm->packet_parse == sr_eev121gw_3displays_parse) {
+               dmm->channel_count = EEV121GW_DISPLAY_COUNT;
+               dmm->channel_formats = eev121gw_channel_formats;
+       }
        for (ch_idx = 0; ch_idx < dmm->channel_count; ch_idx++) {
                size_t ch_num;
                const char *fmt;
@@ -257,6 +261,13 @@ SR_REGISTER_DEV_DRIVER_LIST(serial_dmm_drivers,
                sr_dtm0660_packet_valid, sr_dtm0660_parse, NULL
        ),
        /* }}} */
+       /* eev121gw based meters {{{ */
+       DMM(
+               "eevblog-121gw", eev121gw, "EEVblog", "121GW",
+               "115200/8n1", 115200, EEV121GW_PACKET_SIZE, 0, 0, NULL,
+               sr_eev121gw_packet_valid, sr_eev121gw_3displays_parse, NULL
+       ),
+       /* }}} */
        /* es519xx based meters {{{ */
        DMM(
                "iso-tech-idm103n", es519xx,
index 1dcdc992fd9cb7e2c64a68b26697657129ce50b3..6a420c66519a7b1b932d0a248f2c25b57be3a64c 100644 (file)
@@ -1487,6 +1487,7 @@ struct eev121gw_info {
        gboolean is_auto_poweroff, is_low_batt;
 };
 
+extern SR_PRIV const char *eev121gw_channel_formats[];
 SR_PRIV gboolean sr_eev121gw_packet_valid(const uint8_t *buf);
 SR_PRIV int sr_eev121gw_parse(const uint8_t *buf, float *floatval,
                             struct sr_datafeed_analog *analog, void *info);