]> sigrok.org Git - libsigrok.git/blob - src/hardware/serial-dmm/api.c
drivers: Provide proper drvopts.
[libsigrok.git] / src / hardware / serial-dmm / api.c
1 /*
2  * This file is part of the libsigrok project.
3  *
4  * Copyright (C) 2012 Bert Vermeulen <bert@biot.com>
5  * Copyright (C) 2012 Alexandru Gagniuc <mr.nuke.me@gmail.com>
6  * Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.de>
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20  */
21
22 #include <config.h>
23 #include <sys/types.h>
24 #include <sys/stat.h>
25 #include <fcntl.h>
26 #include <string.h>
27 #include <glib.h>
28 #include <libsigrok/libsigrok.h>
29 #include "libsigrok-internal.h"
30 #include "protocol.h"
31
32 static const uint32_t scanopts[] = {
33         SR_CONF_CONN,
34         SR_CONF_SERIALCOMM,
35 };
36
37 static const uint32_t drvopts[] = {
38         SR_CONF_MULTIMETER,
39 };
40
41 static const uint32_t devopts[] = {
42         SR_CONF_CONTINUOUS,
43         SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
44         SR_CONF_LIMIT_MSEC | SR_CONF_SET,
45 };
46
47 static GSList *scan(struct sr_dev_driver *di, GSList *options)
48 {
49         struct dmm_info *dmm;
50         struct sr_config *src;
51         GSList *l, *devices;
52         const char *conn, *serialcomm;
53         struct sr_dev_inst *sdi;
54         struct dev_context *devc;
55         struct sr_serial_dev_inst *serial;
56         int dropped, ret;
57         size_t len;
58         uint8_t buf[128];
59
60         dmm = (struct dmm_info *)di;
61
62         conn = serialcomm = NULL;
63         for (l = options; l; l = l->next) {
64                 src = l->data;
65                 switch (src->key) {
66                 case SR_CONF_CONN:
67                         conn = g_variant_get_string(src->data, NULL);
68                         break;
69                 case SR_CONF_SERIALCOMM:
70                         serialcomm = g_variant_get_string(src->data, NULL);
71                         break;
72                 }
73         }
74         if (!conn)
75                 return NULL;
76
77         if (!serialcomm)
78                 serialcomm = dmm->conn;
79
80         serial = sr_serial_dev_inst_new(conn, serialcomm);
81
82         if (serial_open(serial, SERIAL_RDWR) != SR_OK)
83                 return NULL;
84
85         sr_info("Probing serial port %s.", conn);
86
87         devices = NULL;
88         serial_flush(serial);
89
90         /* Request a packet if the DMM requires this. */
91         if (dmm->packet_request) {
92                 if ((ret = dmm->packet_request(serial)) < 0) {
93                         sr_err("Failed to request packet: %d.", ret);
94                         return FALSE;
95                 }
96         }
97
98         /*
99          * There's no way to get an ID from the multimeter. It just sends data
100          * periodically (or upon request), so the best we can do is check if
101          * the packets match the expected format.
102          */
103
104         /* Let's get a bit of data and see if we can find a packet. */
105         len = sizeof(buf);
106         ret = serial_stream_detect(serial, buf, &len, dmm->packet_size,
107                                    dmm->packet_valid, 3000,
108                                    dmm->baudrate);
109         if (ret != SR_OK)
110                 goto scan_cleanup;
111
112         /*
113          * If we dropped more than two packets worth of data, something is
114          * wrong. We shouldn't quit however, since the dropped bytes might be
115          * just zeroes at the beginning of the stream. Those can occur as a
116          * combination of the nonstandard cable that ships with some devices
117          * and the serial port or USB to serial adapter.
118          */
119         dropped = len - dmm->packet_size;
120         if (dropped > 2 * dmm->packet_size)
121                 sr_warn("Had to drop too much data.");
122
123         sr_info("Found device on port %s.", conn);
124
125         sdi = g_malloc0(sizeof(struct sr_dev_inst));
126         sdi->status = SR_ST_INACTIVE;
127         sdi->vendor = g_strdup(dmm->vendor);
128         sdi->model = g_strdup(dmm->device);
129         devc = g_malloc0(sizeof(struct dev_context));
130         sr_sw_limits_init(&devc->limits);
131         sdi->inst_type = SR_INST_SERIAL;
132         sdi->conn = serial;
133         sdi->priv = devc;
134         sr_channel_new(sdi, 0, SR_CHANNEL_ANALOG, TRUE, "P1");
135         devices = g_slist_append(devices, sdi);
136
137 scan_cleanup:
138         serial_close(serial);
139
140         return std_scan_complete(di, devices);
141 }
142
143 static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
144                 const struct sr_channel_group *cg)
145 {
146         struct dev_context *devc;
147
148         (void)cg;
149
150         devc = sdi->priv;
151
152         return sr_sw_limits_config_set(&devc->limits, key, data);
153 }
154
155 static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
156                 const struct sr_channel_group *cg)
157 {
158         return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts);
159 }
160
161 static int dev_acquisition_start(const struct sr_dev_inst *sdi)
162 {
163         struct dev_context *devc;
164         struct sr_serial_dev_inst *serial;
165
166         devc = sdi->priv;
167
168         sr_sw_limits_acquisition_start(&devc->limits);
169         std_session_send_df_header(sdi);
170
171         /* Poll every 50ms, or whenever some data comes in. */
172         serial = sdi->conn;
173         serial_source_add(sdi->session, serial, G_IO_IN, 50,
174                       receive_data, (void *)sdi);
175
176         return SR_OK;
177 }
178
179 #define DMM(ID, CHIPSET, VENDOR, MODEL, CONN, BAUDRATE, PACKETSIZE, TIMEOUT, \
180                         DELAY, REQUEST, VALID, PARSE, DETAILS) \
181         &((struct dmm_info) { \
182                 { \
183                         .name = ID, \
184                         .longname = VENDOR " " MODEL, \
185                         .api_version = 1, \
186                         .init = std_init, \
187                         .cleanup = std_cleanup, \
188                         .scan = scan, \
189                         .dev_list = std_dev_list, \
190                         .dev_clear = std_dev_clear, \
191                         .config_get = NULL, \
192                         .config_set = config_set, \
193                         .config_list = config_list, \
194                         .dev_open = std_serial_dev_open, \
195                         .dev_close = std_serial_dev_close, \
196                         .dev_acquisition_start = dev_acquisition_start, \
197                         .dev_acquisition_stop = std_serial_dev_acquisition_stop, \
198                         .context = NULL, \
199                 }, \
200                 VENDOR, MODEL, CONN, BAUDRATE, PACKETSIZE, TIMEOUT, DELAY, \
201                 REQUEST, VALID, PARSE, DETAILS, sizeof(struct CHIPSET##_info) \
202         }).di
203
204 SR_REGISTER_DEV_DRIVER_LIST(serial_dmm_drivers,
205         /*
206          * The items are sorted by chipset first and then model name.
207          *
208          * This reflects the developer's perspective and is preferrable
209          * during maintenance, as a vendor/product based sort order does
210          * not work well for rebranded models, and from a support point
211          * of view it's more important to identify similarities between
212          * models and compatible devices.
213          *
214          * Fold marks {{{ }}} with matching braces were added, to further
215          * speed up navigation in the long list.
216          */
217         /* asycii based meters {{{ */
218         DMM(
219                 "metrix-mx56c", asycii, "Metrix", "MX56C",
220                 "2400/8n1", 2400, ASYCII_PACKET_SIZE, 0, 0, NULL,
221                 sr_asycii_packet_valid, sr_asycii_parse, NULL
222         ),
223         /* }}} */
224         /* bm25x based meters {{{ */
225         DMM(
226                 "brymen-bm25x", bm25x,
227                 "Brymen", "BM25x", "9600/8n1/rts=1/dtr=1",
228                 9600, BRYMEN_BM25X_PACKET_SIZE, 0, 0, NULL,
229                 sr_brymen_bm25x_packet_valid, sr_brymen_bm25x_parse,
230                 NULL
231         ),
232         /* }}} */
233         /* dtm0660 based meters {{{ */
234         DMM(
235                 "peaktech-3415", dtm0660,
236                 "PeakTech", "3415", "2400/8n1/rts=0/dtr=1",
237                 2400, DTM0660_PACKET_SIZE, 0, 0, NULL,
238                 sr_dtm0660_packet_valid, sr_dtm0660_parse, NULL
239         ),
240         DMM(
241                 "velleman-dvm4100", dtm0660,
242                 "Velleman", "DVM4100", "2400/8n1/rts=0/dtr=1",
243                 2400, DTM0660_PACKET_SIZE, 0, 0, NULL,
244                 sr_dtm0660_packet_valid, sr_dtm0660_parse, NULL
245         ),
246         /* }}} */
247         /* es519xx based meters {{{ */
248         DMM(
249                 "iso-tech-idm103n", es519xx,
250                 "ISO-TECH", "IDM103N", "2400/7o1/rts=0/dtr=1",
251                 2400, ES519XX_11B_PACKET_SIZE, 0, 0, NULL,
252                 sr_es519xx_2400_11b_packet_valid, sr_es519xx_2400_11b_parse,
253                 NULL
254         ),
255         /*
256          * Note: ES51922 and ES51986 baudrate is actually 19230. This is
257          * "out" by .15%, and so is well within the typical 1% margin
258          * that is considered acceptable in UART communication, and thus
259          * should not cause an issue.
260          *
261          * However, using 19230 as baudrate here will not work, as most DMM
262          * cables do not support that baudrate!
263          */
264         DMM(
265                 "tenma-72-7750-ser", es519xx,
266                 "Tenma", "72-7750 (UT-D02 cable)", "19200/7o1/rts=0/dtr=1",
267                 19200, ES519XX_11B_PACKET_SIZE, 0, 0, NULL,
268                 sr_es519xx_19200_11b_packet_valid, sr_es519xx_19200_11b_parse,
269                 NULL
270         ),
271         DMM(
272                 "uni-t-ut60g-ser", es519xx,
273                 "UNI-T", "UT60G (UT-D02 cable)", "19200/7o1/rts=0/dtr=1",
274                 19200, ES519XX_11B_PACKET_SIZE, 0, 0, NULL,
275                 sr_es519xx_19200_11b_packet_valid, sr_es519xx_19200_11b_parse,
276                 NULL
277         ),
278         DMM(
279                 "uni-t-ut61e-ser", es519xx,
280                 "UNI-T", "UT61E (UT-D02 cable)", "19200/7o1/rts=0/dtr=1",
281                 19200, ES519XX_14B_PACKET_SIZE, 0, 0, NULL,
282                 sr_es519xx_19200_14b_packet_valid, sr_es519xx_19200_14b_parse,
283                 NULL
284         ),
285         /* }}} */
286         /* fs9721 based meters {{{ */
287         DMM(
288                 "digitek-dt4000zc", fs9721,
289                 "Digitek", "DT4000ZC", "2400/8n1/dtr=1", 2400,
290                 FS9721_PACKET_SIZE, 0, 0, NULL,
291                 sr_fs9721_packet_valid, sr_fs9721_parse,
292                 sr_fs9721_10_temp_c
293         ),
294         DMM(
295                 "mastech-ms8250b", fs9721,
296                 "MASTECH", "MS8250B", "2400/8n1/rts=0/dtr=1",
297                 2400, FS9721_PACKET_SIZE, 0, 0, NULL,
298                 sr_fs9721_packet_valid, sr_fs9721_parse,
299                 NULL
300         ),
301         DMM(
302                 "pce-pce-dm32", fs9721,
303                 "PCE", "PCE-DM32", "2400/8n1", 2400,
304                 FS9721_PACKET_SIZE, 0, 0, NULL,
305                 sr_fs9721_packet_valid, sr_fs9721_parse,
306                 sr_fs9721_01_10_temp_f_c
307         ),
308         DMM(
309                 "peaktech-3330", fs9721,
310                 "PeakTech", "3330", "2400/8n1/dtr=1", 2400,
311                 FS9721_PACKET_SIZE, 0, 0, NULL,
312                 sr_fs9721_packet_valid, sr_fs9721_parse,
313                 sr_fs9721_01_10_temp_f_c
314         ),
315         DMM(
316                 "tecpel-dmm-8061-ser", fs9721,
317                 "Tecpel", "DMM-8061 (UT-D02 cable)", "2400/8n1/rts=0/dtr=1",
318                 2400, FS9721_PACKET_SIZE, 0, 0, NULL,
319                 sr_fs9721_packet_valid, sr_fs9721_parse,
320                 sr_fs9721_00_temp_c
321         ),
322         DMM(
323                 "tekpower-tp4000ZC", fs9721,
324                 "TekPower", "TP4000ZC", "2400/8n1/dtr=1", 2400,
325                 FS9721_PACKET_SIZE, 0, 0, NULL,
326                 sr_fs9721_packet_valid, sr_fs9721_parse,
327                 sr_fs9721_10_temp_c
328         ),
329         DMM(
330                 "tenma-72-7745-ser", fs9721,
331                 "Tenma", "72-7745 (UT-D02 cable)", "2400/8n1/rts=0/dtr=1",
332                 2400, FS9721_PACKET_SIZE, 0, 0, NULL,
333                 sr_fs9721_packet_valid, sr_fs9721_parse,
334                 sr_fs9721_00_temp_c
335         ),
336         DMM(
337                 "uni-t-ut60a-ser", fs9721,
338                 "UNI-T", "UT60A (UT-D02 cable)", "2400/8n1/rts=0/dtr=1",
339                 2400, FS9721_PACKET_SIZE, 0, 0, NULL,
340                 sr_fs9721_packet_valid, sr_fs9721_parse,
341                 NULL
342         ),
343         DMM(
344                 "uni-t-ut60e-ser", fs9721,
345                 "UNI-T", "UT60E (UT-D02 cable)", "2400/8n1/rts=0/dtr=1",
346                 2400, FS9721_PACKET_SIZE, 0, 0, NULL,
347                 sr_fs9721_packet_valid, sr_fs9721_parse,
348                 sr_fs9721_00_temp_c
349         ),
350         DMM(
351                 "va-va18b", fs9721,
352                 "V&A", "VA18B", "2400/8n1", 2400,
353                 FS9721_PACKET_SIZE, 0, 0, NULL,
354                 sr_fs9721_packet_valid, sr_fs9721_parse,
355                 sr_fs9721_01_temp_c
356         ),
357         DMM(
358                 "va-va40b", fs9721,
359                 "V&A", "VA40B", "2400/8n1", 2400,
360                 FS9721_PACKET_SIZE, 0, 0, NULL,
361                 sr_fs9721_packet_valid, sr_fs9721_parse,
362                 sr_fs9721_max_c_min
363         ),
364         DMM(
365                 "voltcraft-vc820-ser", fs9721,
366                 "Voltcraft", "VC-820 (UT-D02 cable)", "2400/8n1/rts=0/dtr=1",
367                 2400, FS9721_PACKET_SIZE, 0, 0, NULL,
368                 sr_fs9721_packet_valid, sr_fs9721_parse,
369                 NULL
370         ),
371         DMM(
372                 "voltcraft-vc840-ser", fs9721,
373                 "Voltcraft", "VC-840 (UT-D02 cable)", "2400/8n1/rts=0/dtr=1",
374                 2400, FS9721_PACKET_SIZE, 0, 0, NULL,
375                 sr_fs9721_packet_valid, sr_fs9721_parse,
376                 sr_fs9721_00_temp_c
377         ),
378         /* }}} */
379         /* fs9922 based meters {{{ */
380         DMM(
381                 "sparkfun-70c", fs9922,
382                 "SparkFun", "70C", "2400/8n1/rts=0/dtr=1",
383                 2400, FS9922_PACKET_SIZE, 0, 0, NULL,
384                 sr_fs9922_packet_valid, sr_fs9922_parse, NULL
385         ),
386         DMM(
387                 "uni-t-ut61b-ser", fs9922,
388                 "UNI-T", "UT61B (UT-D02 cable)", "2400/8n1/rts=0/dtr=1",
389                 2400, FS9922_PACKET_SIZE, 0, 0, NULL,
390                 sr_fs9922_packet_valid, sr_fs9922_parse, NULL
391         ),
392         DMM(
393                 "uni-t-ut61c-ser", fs9922,
394                 "UNI-T", "UT61C (UT-D02 cable)", "2400/8n1/rts=0/dtr=1",
395                 2400, FS9922_PACKET_SIZE, 0, 0, NULL,
396                 sr_fs9922_packet_valid, sr_fs9922_parse, NULL
397         ),
398         DMM(
399                 "uni-t-ut61d-ser", fs9922,
400                 "UNI-T", "UT61D (UT-D02 cable)", "2400/8n1/rts=0/dtr=1",
401                 2400, FS9922_PACKET_SIZE, 0, 0, NULL,
402                 sr_fs9922_packet_valid, sr_fs9922_parse, NULL
403         ),
404         DMM(
405                 /*
406                  * Note: The VC830 doesn't set the 'volt' and 'diode' bits of
407                  * the FS9922 protocol. Instead, it only sets the user-defined
408                  * bit "z1" to indicate "diode mode" and "voltage".
409                  */
410                 "voltcraft-vc830-ser", fs9922,
411                 "Voltcraft", "VC-830 (UT-D02 cable)", "2400/8n1/rts=0/dtr=1",
412                 2400, FS9922_PACKET_SIZE, 0, 0, NULL,
413                 sr_fs9922_packet_valid, sr_fs9922_parse,
414                 &sr_fs9922_z1_diode
415         ),
416         /* }}} */
417         /* m2110 based meters {{{ */
418         DMM(
419                 "bbcgm-2010", m2110,
420                 "BBC Goertz Metrawatt", "M2110", "1200/7n2", 1200,
421                 BBCGM_M2110_PACKET_SIZE, 0, 0, NULL,
422                 sr_m2110_packet_valid, sr_m2110_parse,
423                 NULL
424         ),
425         /* }}} */
426         /* metex14 based meters {{{ */
427         DMM(
428                 "mastech-mas345", metex14,
429                 "MASTECH", "MAS345", "600/7n2/rts=0/dtr=1", 600,
430                 METEX14_PACKET_SIZE, 0, 0, sr_metex14_packet_request,
431                 sr_metex14_packet_valid, sr_metex14_parse,
432                 NULL
433         ),
434         DMM(
435                 "metex-m3640d", metex14,
436                 "Metex", "M-3640D", "1200/7n2/rts=0/dtr=1", 1200,
437                 METEX14_PACKET_SIZE, 0, 0, sr_metex14_packet_request,
438                 sr_metex14_packet_valid, sr_metex14_parse,
439                 NULL
440         ),
441         DMM(
442                 "metex-m4650cr", metex14,
443                 "Metex", "M-4650CR", "1200/7n2/rts=0/dtr=1", 1200,
444                 METEX14_PACKET_SIZE, 0, 0, sr_metex14_packet_request,
445                 sr_metex14_packet_valid, sr_metex14_parse,
446                 NULL
447         ),
448         DMM(
449                 "metex-me31", metex14,
450                 "Metex", "ME-31", "600/7n2/rts=0/dtr=1", 600,
451                 METEX14_PACKET_SIZE, 0, 0, sr_metex14_packet_request,
452                 sr_metex14_packet_valid, sr_metex14_parse,
453                 NULL
454         ),
455         DMM(
456                 "peaktech-3410", metex14,
457                 "PeakTech", "3410", "600/7n2/rts=0/dtr=1", 600,
458                 METEX14_PACKET_SIZE, 0, 0, sr_metex14_packet_request,
459                 sr_metex14_packet_valid, sr_metex14_parse,
460                 NULL
461         ),
462         DMM(
463                 "peaktech-4370", metex14,
464                 "PeakTech", "4370", "1200/7n2/rts=0/dtr=1", 1200,
465                 METEX14_PACKET_SIZE, 0, 0, sr_metex14_packet_request,
466                 sr_metex14_packet_valid, sr_metex14_parse,
467                 NULL
468         ),
469         DMM(
470                 "radioshack-22-168", metex14,
471                 "RadioShack", "22-168", "1200/7n2/rts=0/dtr=1", 1200,
472                 METEX14_PACKET_SIZE, 0, 0, sr_metex14_packet_request,
473                 sr_metex14_packet_valid, sr_metex14_parse,
474                 NULL
475         ),
476         DMM(
477                 "radioshack-22-805", metex14,
478                 "RadioShack", "22-805", "600/7n2/rts=0/dtr=1", 600,
479                 METEX14_PACKET_SIZE, 0, 0, sr_metex14_packet_request,
480                 sr_metex14_packet_valid, sr_metex14_parse,
481                 NULL
482         ),
483         DMM(
484                 "voltcraft-m3650cr", metex14,
485                 "Voltcraft", "M-3650CR", "1200/7n2/rts=0/dtr=1", 1200,
486                 METEX14_PACKET_SIZE, 150, 20, sr_metex14_packet_request,
487                 sr_metex14_packet_valid, sr_metex14_parse,
488                 NULL
489         ),
490         DMM(
491                 "voltcraft-m3650d", metex14,
492                 "Voltcraft", "M-3650D", "1200/7n2/rts=0/dtr=1", 1200,
493                 METEX14_PACKET_SIZE, 0, 0, sr_metex14_packet_request,
494                 sr_metex14_packet_valid, sr_metex14_parse,
495                 NULL
496         ),
497         DMM(
498                 "voltcraft-m4650cr", metex14,
499                 "Voltcraft", "M-4650CR", "1200/7n2/rts=0/dtr=1", 1200,
500                 METEX14_PACKET_SIZE, 0, 0, sr_metex14_packet_request,
501                 sr_metex14_packet_valid, sr_metex14_parse,
502                 NULL
503         ),
504         DMM(
505                 "voltcraft-me42", metex14,
506                 "Voltcraft", "ME-42", "600/7n2/rts=0/dtr=1", 600,
507                 METEX14_PACKET_SIZE, 250, 60, sr_metex14_packet_request,
508                 sr_metex14_packet_valid, sr_metex14_parse,
509                 NULL
510         ),
511         /* }}} */
512         /* rs9lcd based meters {{{ */
513         DMM(
514                 "radioshack-22-812", rs9lcd,
515                 "RadioShack", "22-812", "4800/8n1/rts=0/dtr=1", 4800,
516                 RS9LCD_PACKET_SIZE, 0, 0, NULL,
517                 sr_rs9lcd_packet_valid, sr_rs9lcd_parse,
518                 NULL
519         ),
520         /* }}} */
521         /* ut71x based meters {{{ */
522         DMM(
523                 "tenma-72-7730-ser", ut71x,
524                 "Tenma", "72-7730 (UT-D02 cable)", "2400/7o1/rts=0/dtr=1",
525                 2400, UT71X_PACKET_SIZE, 0, 0, NULL,
526                 sr_ut71x_packet_valid, sr_ut71x_parse, NULL
527         ),
528         DMM(
529                 "tenma-72-7732-ser", ut71x,
530                 "Tenma", "72-7732 (UT-D02 cable)", "2400/7o1/rts=0/dtr=1",
531                 2400, UT71X_PACKET_SIZE, 0, 0, NULL,
532                 sr_ut71x_packet_valid, sr_ut71x_parse, NULL
533         ),
534         DMM(
535                 "tenma-72-9380a-ser", ut71x,
536                 "Tenma", "72-9380A (UT-D02 cable)", "2400/7o1/rts=0/dtr=1",
537                 2400, UT71X_PACKET_SIZE, 0, 0, NULL,
538                 sr_ut71x_packet_valid, sr_ut71x_parse, NULL
539         ),
540         DMM(
541                 "uni-t-ut71a-ser", ut71x,
542                 "UNI-T", "UT71A (UT-D02 cable)", "2400/7o1/rts=0/dtr=1",
543                 2400, UT71X_PACKET_SIZE, 0, 0, NULL,
544                 sr_ut71x_packet_valid, sr_ut71x_parse, NULL
545         ),
546         DMM(
547                 "uni-t-ut71b-ser", ut71x,
548                 "UNI-T", "UT71B (UT-D02 cable)", "2400/7o1/rts=0/dtr=1",
549                 2400, UT71X_PACKET_SIZE, 0, 0, NULL,
550                 sr_ut71x_packet_valid, sr_ut71x_parse, NULL
551         ),
552         DMM(
553                 "uni-t-ut71c-ser", ut71x,
554                 "UNI-T", "UT71C (UT-D02 cable)", "2400/7o1/rts=0/dtr=1",
555                 2400, UT71X_PACKET_SIZE, 0, 0, NULL,
556                 sr_ut71x_packet_valid, sr_ut71x_parse, NULL
557         ),
558         DMM(
559                 "uni-t-ut71d-ser", ut71x,
560                 "UNI-T", "UT71D (UT-D02 cable)", "2400/7o1/rts=0/dtr=1",
561                 2400, UT71X_PACKET_SIZE, 0, 0, NULL,
562                 sr_ut71x_packet_valid, sr_ut71x_parse, NULL
563         ),
564         DMM(
565                 "uni-t-ut71e-ser", ut71x,
566                 "UNI-T", "UT71E (UT-D02 cable)", "2400/7o1/rts=0/dtr=1",
567                 2400, UT71X_PACKET_SIZE, 0, 0, NULL,
568                 sr_ut71x_packet_valid, sr_ut71x_parse, NULL
569         ),
570         DMM(
571                 "voltcraft-vc920-ser", ut71x,
572                 "Voltcraft", "VC-920 (UT-D02 cable)", "2400/7o1/rts=0/dtr=1",
573                 2400, UT71X_PACKET_SIZE, 0, 0, NULL,
574                 sr_ut71x_packet_valid, sr_ut71x_parse, NULL
575         ),
576         DMM(
577                 "voltcraft-vc940-ser", ut71x,
578                 "Voltcraft", "VC-940 (UT-D02 cable)", "2400/7o1/rts=0/dtr=1",
579                 2400, UT71X_PACKET_SIZE, 0, 0, NULL,
580                 sr_ut71x_packet_valid, sr_ut71x_parse, NULL
581         ),
582         DMM(
583                 "voltcraft-vc960-ser", ut71x,
584                 "Voltcraft", "VC-960 (UT-D02 cable)", "2400/7o1/rts=0/dtr=1",
585                 2400, UT71X_PACKET_SIZE, 0, 0, NULL,
586                 sr_ut71x_packet_valid, sr_ut71x_parse, NULL
587         ),
588         /* }}} */
589         /* vc870 based meters {{{ */
590         DMM(
591                 "voltcraft-vc870-ser", vc870,
592                 "Voltcraft", "VC-870 (UT-D02 cable)", "9600/8n1/rts=0/dtr=1",
593                 9600, VC870_PACKET_SIZE, 0, 0, NULL,
594                 sr_vc870_packet_valid, sr_vc870_parse, NULL
595         ),
596         /* }}} */
597         /*
598          * The list is sorted. Add new items in the respective chip's group.
599          */
600 );