serial-dmm: add EEVblog 121GW device entry (-d eevblog-121gw:conn=<uart>)

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.
This commit is contained in:
Gerhard Sittig 2018-09-28 19:38:23 +02:00 committed by Uwe Hermann
parent 1c3098aae0
commit 015df4ae8f
2 changed files with 12 additions and 0 deletions

View 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,

View 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);