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