From: Gerhard Sittig Date: Fri, 28 Sep 2018 17:38:23 +0000 (+0200) Subject: serial-dmm: add EEVblog 121GW device entry (-d eevblog-121gw:conn=) X-Git-Url: https://sigrok.org/gitweb/?a=commitdiff_plain;h=015df4ae8f4ca2e9fbfd2a9d61a44af5b5f490b8;p=libsigrok.git serial-dmm: add EEVblog 121GW device entry (-d eevblog-121gw:conn=) 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. --- diff --git a/src/hardware/serial-dmm/api.c b/src/hardware/serial-dmm/api.c index bcff1913..3c501ade 100644 --- a/src/hardware/serial-dmm/api.c +++ b/src/hardware/serial-dmm/api.c @@ -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, diff --git a/src/libsigrok-internal.h b/src/libsigrok-internal.h index 1dcdc992..6a420c66 100644 --- a/src/libsigrok-internal.h +++ b/src/libsigrok-internal.h @@ -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);