]>
Commit | Line | Data |
---|---|---|
7dc55d93 | 1 | /* |
50985c20 | 2 | * This file is part of the libsigrok project. |
7dc55d93 AG |
3 | * |
4 | * Copyright (C) 2012 Bert Vermeulen <bert@biot.com> | |
5 | * Copyright (C) 2012 Alexandru Gagniuc <mr.nuke.me@gmail.com> | |
729b01f9 | 6 | * Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.de> |
7dc55d93 AG |
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 | ||
6ec6c43b | 22 | #include <config.h> |
7dc55d93 AG |
23 | #include <sys/types.h> |
24 | #include <sys/stat.h> | |
25 | #include <fcntl.h> | |
26 | #include <string.h> | |
22f54192 | 27 | #include <glib.h> |
c1aae900 | 28 | #include <libsigrok/libsigrok.h> |
bbabddbd UH |
29 | #include "libsigrok-internal.h" |
30 | #include "protocol.h" | |
7dc55d93 | 31 | |
a0e0bb41 | 32 | static const uint32_t scanopts[] = { |
1953564a BV |
33 | SR_CONF_CONN, |
34 | SR_CONF_SERIALCOMM, | |
7dc55d93 AG |
35 | }; |
36 | ||
05199c0a | 37 | static const uint32_t drvopts[] = { |
1953564a | 38 | SR_CONF_MULTIMETER, |
05199c0a UH |
39 | }; |
40 | ||
41 | static const uint32_t devopts[] = { | |
1953564a | 42 | SR_CONF_CONTINUOUS, |
5827f61b BV |
43 | SR_CONF_LIMIT_SAMPLES | SR_CONF_SET, |
44 | SR_CONF_LIMIT_MSEC | SR_CONF_SET, | |
7dc55d93 AG |
45 | }; |
46 | ||
bcbef5ed | 47 | static GSList *scan(struct sr_dev_driver *di, GSList *options) |
7dc55d93 | 48 | { |
1a863916 | 49 | struct dmm_info *dmm; |
bcbef5ed ML |
50 | struct sr_config *src; |
51 | GSList *l, *devices; | |
52 | const char *conn, *serialcomm; | |
7dc55d93 | 53 | struct sr_dev_inst *sdi; |
7dc55d93 | 54 | struct dev_context *devc; |
d35afa87 | 55 | struct sr_serial_dev_inst *serial; |
2546b05c AG |
56 | int dropped, ret; |
57 | size_t len; | |
58 | uint8_t buf[128]; | |
556a926d GS |
59 | size_t ch_idx; |
60 | char ch_name[12]; | |
7dc55d93 | 61 | |
1a863916 UH |
62 | dmm = (struct dmm_info *)di; |
63 | ||
0527cc3a | 64 | conn = dmm->conn; |
09c650d5 | 65 | serialcomm = dmm->serialcomm; |
bcbef5ed ML |
66 | for (l = options; l; l = l->next) { |
67 | src = l->data; | |
68 | switch (src->key) { | |
69 | case SR_CONF_CONN: | |
70 | conn = g_variant_get_string(src->data, NULL); | |
71 | break; | |
72 | case SR_CONF_SERIALCOMM: | |
73 | serialcomm = g_variant_get_string(src->data, NULL); | |
74 | break; | |
75 | } | |
76 | } | |
77 | if (!conn) | |
78 | return NULL; | |
79 | ||
91219afc | 80 | serial = sr_serial_dev_inst_new(conn, serialcomm); |
d35afa87 | 81 | |
2e360339 | 82 | if (serial_open(serial, SERIAL_RDWR) != SR_OK) |
7dc55d93 | 83 | return NULL; |
7dc55d93 | 84 | |
22f54192 | 85 | sr_info("Probing serial port %s.", conn); |
7dc55d93 | 86 | |
7dc55d93 | 87 | devices = NULL; |
bbabddbd | 88 | |
ce3777ad | 89 | /* Request a packet if the DMM requires this. */ |
bcbef5ed ML |
90 | if (dmm->packet_request) { |
91 | if ((ret = dmm->packet_request(serial)) < 0) { | |
ce3777ad UH |
92 | sr_err("Failed to request packet: %d.", ret); |
93 | return FALSE; | |
94 | } | |
95 | } | |
96 | ||
22f54192 UH |
97 | /* |
98 | * There's no way to get an ID from the multimeter. It just sends data | |
99 | * periodically (or upon request), so the best we can do is check if | |
100 | * the packets match the expected format. | |
101 | */ | |
102 | ||
103 | /* Let's get a bit of data and see if we can find a packet. */ | |
104 | len = sizeof(buf); | |
bcbef5ed | 105 | ret = serial_stream_detect(serial, buf, &len, dmm->packet_size, |
d03815a0 | 106 | dmm->packet_valid, 3000); |
2546b05c AG |
107 | if (ret != SR_OK) |
108 | goto scan_cleanup; | |
7dc55d93 | 109 | |
2546b05c AG |
110 | /* |
111 | * If we dropped more than two packets worth of data, something is | |
112 | * wrong. We shouldn't quit however, since the dropped bytes might be | |
113 | * just zeroes at the beginning of the stream. Those can occur as a | |
22f54192 UH |
114 | * combination of the nonstandard cable that ships with some devices |
115 | * and the serial port or USB to serial adapter. | |
2546b05c | 116 | */ |
bcbef5ed ML |
117 | dropped = len - dmm->packet_size; |
118 | if (dropped > 2 * dmm->packet_size) | |
6bef68a7 | 119 | sr_warn("Had to drop too much data."); |
7dc55d93 | 120 | |
2546b05c | 121 | sr_info("Found device on port %s.", conn); |
7dc55d93 | 122 | |
aac29cc1 | 123 | sdi = g_malloc0(sizeof(struct sr_dev_inst)); |
0af636be | 124 | sdi->status = SR_ST_INACTIVE; |
bcbef5ed ML |
125 | sdi->vendor = g_strdup(dmm->vendor); |
126 | sdi->model = g_strdup(dmm->device); | |
f57d8ffe | 127 | devc = g_malloc0(sizeof(struct dev_context)); |
9f51c463 | 128 | sr_sw_limits_init(&devc->limits); |
1e1bfcd0 UH |
129 | sdi->inst_type = SR_INST_SERIAL; |
130 | sdi->conn = serial; | |
2546b05c | 131 | sdi->priv = devc; |
556a926d | 132 | dmm->channel_count = 1; |
400bc4ff GS |
133 | if (dmm->packet_parse == sr_brymen_bm52x_parse) |
134 | dmm->channel_count = BRYMEN_BM52X_DISPLAY_COUNT; | |
0759e2f5 GS |
135 | if (dmm->packet_parse == sr_brymen_bm86x_parse) |
136 | dmm->channel_count = BRYMEN_BM86X_DISPLAY_COUNT; | |
015df4ae GS |
137 | if (dmm->packet_parse == sr_eev121gw_3displays_parse) { |
138 | dmm->channel_count = EEV121GW_DISPLAY_COUNT; | |
139 | dmm->channel_formats = eev121gw_channel_formats; | |
140 | } | |
db3aac1a GS |
141 | if (dmm->packet_parse == sr_metex14_4packets_parse) |
142 | dmm->channel_count = 4; | |
dcd212f7 VV |
143 | if (dmm->packet_parse == sr_ms2115b_parse) { |
144 | dmm->channel_count = MS2115B_DISPLAY_COUNT; | |
145 | dmm->channel_formats = ms2115b_channel_formats; | |
146 | } | |
556a926d | 147 | for (ch_idx = 0; ch_idx < dmm->channel_count; ch_idx++) { |
48e2992f | 148 | size_t ch_num; |
7d40b5ee GS |
149 | const char *fmt; |
150 | fmt = "P%zu"; | |
151 | if (dmm->channel_formats && dmm->channel_formats[ch_idx]) | |
152 | fmt = dmm->channel_formats[ch_idx]; | |
48e2992f | 153 | ch_num = ch_idx + 1; |
7d40b5ee | 154 | snprintf(ch_name, sizeof(ch_name), fmt, ch_num); |
556a926d GS |
155 | sr_channel_new(sdi, ch_idx, SR_CHANNEL_ANALOG, TRUE, ch_name); |
156 | } | |
2546b05c AG |
157 | devices = g_slist_append(devices, sdi); |
158 | ||
159 | scan_cleanup: | |
d35afa87 | 160 | serial_close(serial); |
2546b05c | 161 | |
15a5bfe4 | 162 | return std_scan_complete(di, devices); |
7dc55d93 AG |
163 | } |
164 | ||
dd7a72ea UH |
165 | static int config_set(uint32_t key, GVariant *data, |
166 | const struct sr_dev_inst *sdi, const struct sr_channel_group *cg) | |
7dc55d93 AG |
167 | { |
168 | struct dev_context *devc; | |
169 | ||
53b4680f | 170 | (void)cg; |
8f996b89 | 171 | |
b0baddef | 172 | devc = sdi->priv; |
7dc55d93 | 173 | |
9f51c463 | 174 | return sr_sw_limits_config_set(&devc->limits, key, data); |
7dc55d93 AG |
175 | } |
176 | ||
dd7a72ea UH |
177 | static int config_list(uint32_t key, GVariant **data, |
178 | const struct sr_dev_inst *sdi, const struct sr_channel_group *cg) | |
a1c743fc | 179 | { |
05199c0a | 180 | return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts); |
a1c743fc BV |
181 | } |
182 | ||
695dc859 | 183 | static int dev_acquisition_start(const struct sr_dev_inst *sdi) |
7dc55d93 | 184 | { |
7dc55d93 | 185 | struct dev_context *devc; |
1e1bfcd0 | 186 | struct sr_serial_dev_inst *serial; |
7dc55d93 | 187 | |
208c1d35 | 188 | devc = sdi->priv; |
7dc55d93 | 189 | |
9f51c463 | 190 | sr_sw_limits_acquisition_start(&devc->limits); |
bee2b016 | 191 | std_session_send_df_header(sdi); |
7dc55d93 | 192 | |
1e1bfcd0 | 193 | serial = sdi->conn; |
102f1239 | 194 | serial_source_add(sdi->session, serial, G_IO_IN, 50, |
bcbef5ed | 195 | receive_data, (void *)sdi); |
7dc55d93 AG |
196 | |
197 | return SR_OK; | |
198 | } | |
199 | ||
0527cc3a GS |
200 | #define DMM_CONN(ID, CHIPSET, VENDOR, MODEL, \ |
201 | CONN, SERIALCOMM, PACKETSIZE, TIMEOUT, DELAY, \ | |
202 | REQUEST, VALID, PARSE, DETAILS) \ | |
dd5c48a6 | 203 | &((struct dmm_info) { \ |
bcbef5ed ML |
204 | { \ |
205 | .name = ID, \ | |
206 | .longname = VENDOR " " MODEL, \ | |
207 | .api_version = 1, \ | |
c2fdcc25 | 208 | .init = std_init, \ |
700d6b64 | 209 | .cleanup = std_cleanup, \ |
bcbef5ed | 210 | .scan = scan, \ |
c01bf34c | 211 | .dev_list = std_dev_list, \ |
f778bf02 | 212 | .dev_clear = std_dev_clear, \ |
bcbef5ed ML |
213 | .config_get = NULL, \ |
214 | .config_set = config_set, \ | |
215 | .config_list = config_list, \ | |
216 | .dev_open = std_serial_dev_open, \ | |
217 | .dev_close = std_serial_dev_close, \ | |
218 | .dev_acquisition_start = dev_acquisition_start, \ | |
4b1a9d5d | 219 | .dev_acquisition_stop = std_serial_dev_acquisition_stop, \ |
41812aca | 220 | .context = NULL, \ |
bcbef5ed | 221 | }, \ |
0527cc3a | 222 | VENDOR, MODEL, CONN, SERIALCOMM, PACKETSIZE, TIMEOUT, DELAY, \ |
7d40b5ee | 223 | REQUEST, 1, NULL, VALID, PARSE, DETAILS, sizeof(struct CHIPSET##_info) \ |
dd5c48a6 | 224 | }).di |
3098b390 | 225 | |
0527cc3a GS |
226 | #define DMM(ID, CHIPSET, VENDOR, MODEL, SERIALCOMM, PACKETSIZE, TIMEOUT, \ |
227 | DELAY, REQUEST, VALID, PARSE, DETAILS) \ | |
228 | DMM_CONN(ID, CHIPSET, VENDOR, MODEL, NULL, SERIALCOMM, PACKETSIZE, \ | |
229 | TIMEOUT, DELAY, REQUEST, VALID, PARSE, DETAILS) | |
230 | ||
dd5c48a6 | 231 | SR_REGISTER_DEV_DRIVER_LIST(serial_dmm_drivers, |
c0678584 GS |
232 | /* |
233 | * The items are sorted by chipset first and then model name. | |
234 | * | |
235 | * This reflects the developer's perspective and is preferrable | |
236 | * during maintenance, as a vendor/product based sort order does | |
237 | * not work well for rebranded models, and from a support point | |
238 | * of view it's more important to identify similarities between | |
239 | * models and compatible devices. | |
240 | * | |
241 | * Fold marks {{{ }}} with matching braces were added, to further | |
242 | * speed up navigation in the long list. | |
243 | */ | |
dc5895cb GS |
244 | /* asycii based meters {{{ */ |
245 | DMM( | |
246 | "metrix-mx56c", asycii, "Metrix", "MX56C", | |
10cfb048 | 247 | "2400/8n1", ASYCII_PACKET_SIZE, 0, 0, NULL, |
dc5895cb GS |
248 | sr_asycii_packet_valid, sr_asycii_parse, NULL |
249 | ), | |
250 | /* }}} */ | |
c0678584 GS |
251 | /* bm25x based meters {{{ */ |
252 | DMM( | |
253 | "brymen-bm25x", bm25x, | |
254 | "Brymen", "BM25x", "9600/8n1/rts=1/dtr=1", | |
10cfb048 | 255 | BRYMEN_BM25X_PACKET_SIZE, 0, 0, NULL, |
c0678584 GS |
256 | sr_brymen_bm25x_packet_valid, sr_brymen_bm25x_parse, |
257 | NULL | |
258 | ), | |
259 | /* }}} */ | |
400bc4ff GS |
260 | /* bm52x based meters {{{ */ |
261 | DMM_CONN( | |
262 | "brymen-bm52x", brymen_bm52x, "Brymen", "BM52x", | |
263 | "hid/bu86x", NULL, BRYMEN_BM52X_PACKET_SIZE, 4000, 500, | |
264 | sr_brymen_bm52x_packet_request, | |
265 | sr_brymen_bm52x_packet_valid, sr_brymen_bm52x_parse, | |
266 | NULL | |
267 | ), | |
268 | /* }}} */ | |
0759e2f5 GS |
269 | /* bm86x based meters {{{ */ |
270 | DMM_CONN( | |
271 | "brymen-bm86x", brymen_bm86x, "Brymen", "BM86x", | |
b800667d | 272 | "hid/bu86x", NULL, BRYMEN_BM86X_PACKET_SIZE, 500, 100, |
0759e2f5 GS |
273 | sr_brymen_bm86x_packet_request, |
274 | sr_brymen_bm86x_packet_valid, sr_brymen_bm86x_parse, | |
275 | NULL | |
276 | ), | |
277 | /* }}} */ | |
440a374f GS |
278 | /* dtm0660 based meters {{{ */ |
279 | DMM( | |
280 | "peaktech-3415", dtm0660, | |
6c62c605 | 281 | "PeakTech", "3415", "2400/8n1/rts=0/dtr=1", |
10cfb048 | 282 | DTM0660_PACKET_SIZE, 0, 0, NULL, |
440a374f GS |
283 | sr_dtm0660_packet_valid, sr_dtm0660_parse, NULL |
284 | ), | |
285 | DMM( | |
286 | "velleman-dvm4100", dtm0660, | |
287 | "Velleman", "DVM4100", "2400/8n1/rts=0/dtr=1", | |
10cfb048 | 288 | DTM0660_PACKET_SIZE, 0, 0, NULL, |
440a374f GS |
289 | sr_dtm0660_packet_valid, sr_dtm0660_parse, NULL |
290 | ), | |
291 | /* }}} */ | |
015df4ae GS |
292 | /* eev121gw based meters {{{ */ |
293 | DMM( | |
294 | "eevblog-121gw", eev121gw, "EEVblog", "121GW", | |
10cfb048 | 295 | "115200/8n1", EEV121GW_PACKET_SIZE, 0, 0, NULL, |
015df4ae GS |
296 | sr_eev121gw_packet_valid, sr_eev121gw_3displays_parse, NULL |
297 | ), | |
298 | /* }}} */ | |
7532f61d GS |
299 | /* es519xx based meters {{{ */ |
300 | DMM( | |
301 | "iso-tech-idm103n", es519xx, | |
302 | "ISO-TECH", "IDM103N", "2400/7o1/rts=0/dtr=1", | |
10cfb048 | 303 | ES519XX_11B_PACKET_SIZE, 0, 0, NULL, |
7532f61d GS |
304 | sr_es519xx_2400_11b_packet_valid, sr_es519xx_2400_11b_parse, |
305 | NULL | |
306 | ), | |
d5b1b76d GS |
307 | /* |
308 | * Note: ES51922 and ES51986 baudrate is actually 19230. This is | |
309 | * "out" by .15%, and so is well within the typical 1% margin | |
310 | * that is considered acceptable in UART communication, and thus | |
311 | * should not cause an issue. | |
82458e50 UH |
312 | * |
313 | * However, using 19230 as baudrate here will not work, as most DMM | |
314 | * cables do not support that baudrate! | |
d5b1b76d | 315 | */ |
7532f61d GS |
316 | DMM( |
317 | "tenma-72-7750-ser", es519xx, | |
7532f61d | 318 | "Tenma", "72-7750 (UT-D02 cable)", "19200/7o1/rts=0/dtr=1", |
10cfb048 | 319 | ES519XX_11B_PACKET_SIZE, 0, 0, NULL, |
7532f61d GS |
320 | sr_es519xx_19200_11b_packet_valid, sr_es519xx_19200_11b_parse, |
321 | NULL | |
322 | ), | |
323 | DMM( | |
7532f61d GS |
324 | "uni-t-ut60g-ser", es519xx, |
325 | "UNI-T", "UT60G (UT-D02 cable)", "19200/7o1/rts=0/dtr=1", | |
10cfb048 | 326 | ES519XX_11B_PACKET_SIZE, 0, 0, NULL, |
7532f61d GS |
327 | sr_es519xx_19200_11b_packet_valid, sr_es519xx_19200_11b_parse, |
328 | NULL | |
329 | ), | |
330 | DMM( | |
331 | "uni-t-ut61e-ser", es519xx, | |
7532f61d | 332 | "UNI-T", "UT61E (UT-D02 cable)", "19200/7o1/rts=0/dtr=1", |
10cfb048 | 333 | ES519XX_14B_PACKET_SIZE, 0, 0, NULL, |
7532f61d GS |
334 | sr_es519xx_19200_14b_packet_valid, sr_es519xx_19200_14b_parse, |
335 | NULL | |
336 | ), | |
337 | /* }}} */ | |
289e1f4e | 338 | /* fs9721 based meters {{{ */ |
bcbef5ed ML |
339 | DMM( |
340 | "digitek-dt4000zc", fs9721, | |
10cfb048 | 341 | "Digitek", "DT4000ZC", "2400/8n1/dtr=1", |
bcbef5ed ML |
342 | FS9721_PACKET_SIZE, 0, 0, NULL, |
343 | sr_fs9721_packet_valid, sr_fs9721_parse, | |
344 | sr_fs9721_10_temp_c | |
345 | ), | |
bcbef5ed ML |
346 | DMM( |
347 | "mastech-ms8250b", fs9721, | |
348 | "MASTECH", "MS8250B", "2400/8n1/rts=0/dtr=1", | |
10cfb048 | 349 | FS9721_PACKET_SIZE, 0, 0, NULL, |
bcbef5ed ML |
350 | sr_fs9721_packet_valid, sr_fs9721_parse, |
351 | NULL | |
352 | ), | |
353 | DMM( | |
1cd40b57 | 354 | "pce-pce-dm32", fs9721, |
10cfb048 | 355 | "PCE", "PCE-DM32", "2400/8n1", |
bcbef5ed ML |
356 | FS9721_PACKET_SIZE, 0, 0, NULL, |
357 | sr_fs9721_packet_valid, sr_fs9721_parse, | |
1cd40b57 | 358 | sr_fs9721_01_10_temp_f_c |
bcbef5ed | 359 | ), |
289e1f4e | 360 | DMM( |
1cd40b57 | 361 | "peaktech-3330", fs9721, |
10cfb048 | 362 | "PeakTech", "3330", "2400/8n1/dtr=1", |
289e1f4e GS |
363 | FS9721_PACKET_SIZE, 0, 0, NULL, |
364 | sr_fs9721_packet_valid, sr_fs9721_parse, | |
365 | sr_fs9721_01_10_temp_f_c | |
366 | ), | |
367 | DMM( | |
368 | "tecpel-dmm-8061-ser", fs9721, | |
369 | "Tecpel", "DMM-8061 (UT-D02 cable)", "2400/8n1/rts=0/dtr=1", | |
10cfb048 | 370 | FS9721_PACKET_SIZE, 0, 0, NULL, |
289e1f4e GS |
371 | sr_fs9721_packet_valid, sr_fs9721_parse, |
372 | sr_fs9721_00_temp_c | |
373 | ), | |
374 | DMM( | |
1cd40b57 | 375 | "tekpower-tp4000ZC", fs9721, |
10cfb048 | 376 | "TekPower", "TP4000ZC", "2400/8n1/dtr=1", |
1cd40b57 | 377 | FS9721_PACKET_SIZE, 0, 0, NULL, |
289e1f4e | 378 | sr_fs9721_packet_valid, sr_fs9721_parse, |
1cd40b57 | 379 | sr_fs9721_10_temp_c |
289e1f4e GS |
380 | ), |
381 | DMM( | |
1cd40b57 GS |
382 | "tenma-72-7745-ser", fs9721, |
383 | "Tenma", "72-7745 (UT-D02 cable)", "2400/8n1/rts=0/dtr=1", | |
10cfb048 | 384 | FS9721_PACKET_SIZE, 0, 0, NULL, |
289e1f4e GS |
385 | sr_fs9721_packet_valid, sr_fs9721_parse, |
386 | sr_fs9721_00_temp_c | |
387 | ), | |
388 | DMM( | |
389 | "uni-t-ut60a-ser", fs9721, | |
390 | "UNI-T", "UT60A (UT-D02 cable)", "2400/8n1/rts=0/dtr=1", | |
10cfb048 | 391 | FS9721_PACKET_SIZE, 0, 0, NULL, |
289e1f4e GS |
392 | sr_fs9721_packet_valid, sr_fs9721_parse, |
393 | NULL | |
394 | ), | |
395 | DMM( | |
396 | "uni-t-ut60e-ser", fs9721, | |
397 | "UNI-T", "UT60E (UT-D02 cable)", "2400/8n1/rts=0/dtr=1", | |
10cfb048 | 398 | FS9721_PACKET_SIZE, 0, 0, NULL, |
289e1f4e GS |
399 | sr_fs9721_packet_valid, sr_fs9721_parse, |
400 | sr_fs9721_00_temp_c | |
401 | ), | |
402 | DMM( | |
1cd40b57 | 403 | "va-va18b", fs9721, |
10cfb048 | 404 | "V&A", "VA18B", "2400/8n1", |
1cd40b57 | 405 | FS9721_PACKET_SIZE, 0, 0, NULL, |
289e1f4e | 406 | sr_fs9721_packet_valid, sr_fs9721_parse, |
1cd40b57 | 407 | sr_fs9721_01_temp_c |
289e1f4e GS |
408 | ), |
409 | DMM( | |
1cd40b57 | 410 | "va-va40b", fs9721, |
10cfb048 | 411 | "V&A", "VA40B", "2400/8n1", |
289e1f4e GS |
412 | FS9721_PACKET_SIZE, 0, 0, NULL, |
413 | sr_fs9721_packet_valid, sr_fs9721_parse, | |
1cd40b57 GS |
414 | sr_fs9721_max_c_min |
415 | ), | |
416 | DMM( | |
417 | "voltcraft-vc820-ser", fs9721, | |
418 | "Voltcraft", "VC-820 (UT-D02 cable)", "2400/8n1/rts=0/dtr=1", | |
10cfb048 | 419 | FS9721_PACKET_SIZE, 0, 0, NULL, |
1cd40b57 GS |
420 | sr_fs9721_packet_valid, sr_fs9721_parse, |
421 | NULL | |
422 | ), | |
423 | DMM( | |
424 | "voltcraft-vc840-ser", fs9721, | |
425 | "Voltcraft", "VC-840 (UT-D02 cable)", "2400/8n1/rts=0/dtr=1", | |
10cfb048 | 426 | FS9721_PACKET_SIZE, 0, 0, NULL, |
1cd40b57 GS |
427 | sr_fs9721_packet_valid, sr_fs9721_parse, |
428 | sr_fs9721_00_temp_c | |
289e1f4e GS |
429 | ), |
430 | /* }}} */ | |
0e27643f | 431 | /* fs9922 based meters {{{ */ |
a3ec8a9a TK |
432 | DMM( |
433 | "gwinstek-gdm-397", fs9922, | |
434 | "GW Instek", "GDM-397", "2400/8n1/rts=0/dtr=1", | |
435 | FS9922_PACKET_SIZE, 0, 0, NULL, | |
436 | sr_fs9922_packet_valid, sr_fs9922_parse, NULL | |
437 | ), | |
f97c1595 R |
438 | DMM( |
439 | "sparkfun-70c", fs9922, | |
440 | "SparkFun", "70C", "2400/8n1/rts=0/dtr=1", | |
10cfb048 | 441 | FS9922_PACKET_SIZE, 0, 0, NULL, |
f97c1595 R |
442 | sr_fs9922_packet_valid, sr_fs9922_parse, NULL |
443 | ), | |
0e27643f GS |
444 | DMM( |
445 | "uni-t-ut61b-ser", fs9922, | |
446 | "UNI-T", "UT61B (UT-D02 cable)", "2400/8n1/rts=0/dtr=1", | |
10cfb048 | 447 | FS9922_PACKET_SIZE, 0, 0, NULL, |
0e27643f GS |
448 | sr_fs9922_packet_valid, sr_fs9922_parse, NULL |
449 | ), | |
450 | DMM( | |
451 | "uni-t-ut61c-ser", fs9922, | |
452 | "UNI-T", "UT61C (UT-D02 cable)", "2400/8n1/rts=0/dtr=1", | |
10cfb048 | 453 | FS9922_PACKET_SIZE, 0, 0, NULL, |
0e27643f GS |
454 | sr_fs9922_packet_valid, sr_fs9922_parse, NULL |
455 | ), | |
456 | DMM( | |
457 | "uni-t-ut61d-ser", fs9922, | |
458 | "UNI-T", "UT61D (UT-D02 cable)", "2400/8n1/rts=0/dtr=1", | |
10cfb048 | 459 | FS9922_PACKET_SIZE, 0, 0, NULL, |
0e27643f GS |
460 | sr_fs9922_packet_valid, sr_fs9922_parse, NULL |
461 | ), | |
03f169b3 GS |
462 | DMM_CONN( |
463 | "victor-dmm", fs9922, "Victor", "Victor DMMs", | |
464 | "hid/victor", "2400/8n1", FS9922_PACKET_SIZE, 0, 0, NULL, | |
388aa0fb TW |
465 | sr_fs9922_packet_valid, sr_fs9922_parse, NULL |
466 | ), | |
0e27643f GS |
467 | DMM( |
468 | /* | |
469 | * Note: The VC830 doesn't set the 'volt' and 'diode' bits of | |
470 | * the FS9922 protocol. Instead, it only sets the user-defined | |
471 | * bit "z1" to indicate "diode mode" and "voltage". | |
472 | */ | |
473 | "voltcraft-vc830-ser", fs9922, | |
474 | "Voltcraft", "VC-830 (UT-D02 cable)", "2400/8n1/rts=0/dtr=1", | |
10cfb048 | 475 | FS9922_PACKET_SIZE, 0, 0, NULL, |
0e27643f GS |
476 | sr_fs9922_packet_valid, sr_fs9922_parse, |
477 | &sr_fs9922_z1_diode | |
478 | ), | |
479 | /* }}} */ | |
9d12555f | 480 | /* m2110 based meters {{{ */ |
289e1f4e | 481 | DMM( |
9d12555f | 482 | "bbcgm-2010", m2110, |
10cfb048 | 483 | "BBC Goertz Metrawatt", "M2110", "1200/7n2", |
289e1f4e GS |
484 | BBCGM_M2110_PACKET_SIZE, 0, 0, NULL, |
485 | sr_m2110_packet_valid, sr_m2110_parse, | |
486 | NULL | |
487 | ), | |
9d12555f | 488 | /* }}} */ |
dcd212f7 VV |
489 | /* ms2115b based meters {{{ */ |
490 | DMM( | |
491 | "mastech-ms2115b", ms2115b, | |
492 | "MASTECH", "MS2115B", "1200/8n1", | |
10cfb048 | 493 | MS2115B_PACKET_SIZE, 0, 0, NULL, |
dcd212f7 VV |
494 | sr_ms2115b_packet_valid, sr_ms2115b_parse, |
495 | NULL | |
496 | ), | |
497 | /* }}} */ | |
67070942 M |
498 | /* ms8250d based meters {{{ */ |
499 | DMM( | |
500 | "mastech-ms8250d", ms8250d, | |
501 | "MASTECH", "MS8250D", "2400/8n1/rts=0/dtr=1", | |
10cfb048 | 502 | MS8250D_PACKET_SIZE, 0, 0, NULL, |
67070942 M |
503 | sr_ms8250d_packet_valid, sr_ms8250d_parse, |
504 | NULL | |
505 | ), | |
506 | /* }}} */ | |
9d12555f | 507 | /* metex14 based meters {{{ */ |
289e1f4e | 508 | DMM( |
b35d0023 | 509 | "mastech-mas345", metex14, |
10cfb048 | 510 | "MASTECH", "MAS345", "600/7n2/rts=0/dtr=1", |
289e1f4e GS |
511 | METEX14_PACKET_SIZE, 0, 0, sr_metex14_packet_request, |
512 | sr_metex14_packet_valid, sr_metex14_parse, | |
513 | NULL | |
514 | ), | |
515 | DMM( | |
b35d0023 | 516 | "metex-m3640d", metex14, |
10cfb048 | 517 | "Metex", "M-3640D", "1200/7n2/rts=0/dtr=1", |
289e1f4e GS |
518 | METEX14_PACKET_SIZE, 0, 0, sr_metex14_packet_request, |
519 | sr_metex14_packet_valid, sr_metex14_parse, | |
520 | NULL | |
521 | ), | |
fcc73918 FS |
522 | DMM( |
523 | "metex-m3860m", metex14, | |
10cfb048 | 524 | "Metex", "M-3860M", "9600/7n2/rts=0/dtr=1", |
556a926d GS |
525 | 4 * METEX14_PACKET_SIZE, 0, 0, sr_metex14_packet_request, |
526 | sr_metex14_4packets_valid, sr_metex14_4packets_parse, | |
fcc73918 FS |
527 | NULL |
528 | ), | |
289e1f4e | 529 | DMM( |
b35d0023 | 530 | "metex-m4650cr", metex14, |
10cfb048 | 531 | "Metex", "M-4650CR", "1200/7n2/rts=0/dtr=1", |
289e1f4e GS |
532 | METEX14_PACKET_SIZE, 0, 0, sr_metex14_packet_request, |
533 | sr_metex14_packet_valid, sr_metex14_parse, | |
534 | NULL | |
535 | ), | |
6d2e3070 TF |
536 | DMM( |
537 | "metex-me21", metex14, | |
538 | "Metex", "ME-21", "2400/7n2/rts=0/dtr=1", | |
539 | METEX14_PACKET_SIZE, 0, 0, sr_metex14_packet_request, | |
540 | sr_metex14_packet_valid, sr_metex14_parse, | |
541 | NULL | |
542 | ), | |
bcbef5ed | 543 | DMM( |
b35d0023 | 544 | "metex-me31", metex14, |
10cfb048 | 545 | "Metex", "ME-31", "600/7n2/rts=0/dtr=1", |
bcbef5ed ML |
546 | METEX14_PACKET_SIZE, 0, 0, sr_metex14_packet_request, |
547 | sr_metex14_packet_valid, sr_metex14_parse, | |
548 | NULL | |
549 | ), | |
550 | DMM( | |
b35d0023 | 551 | "peaktech-3410", metex14, |
10cfb048 | 552 | "PeakTech", "3410", "600/7n2/rts=0/dtr=1", |
bcbef5ed ML |
553 | METEX14_PACKET_SIZE, 0, 0, sr_metex14_packet_request, |
554 | sr_metex14_packet_valid, sr_metex14_parse, | |
555 | NULL | |
556 | ), | |
557 | DMM( | |
558 | "peaktech-4370", metex14, | |
10cfb048 | 559 | "PeakTech", "4370", "1200/7n2/rts=0/dtr=1", |
bcbef5ed ML |
560 | METEX14_PACKET_SIZE, 0, 0, sr_metex14_packet_request, |
561 | sr_metex14_packet_valid, sr_metex14_parse, | |
562 | NULL | |
563 | ), | |
19c9b176 UH |
564 | DMM( |
565 | "peaktech-4390a", metex14, | |
10cfb048 | 566 | "PeakTech", "4390A", "9600/7n2/rts=0/dtr=1", |
556a926d GS |
567 | 4 * METEX14_PACKET_SIZE, 0, 0, sr_metex14_packet_request, |
568 | sr_metex14_4packets_valid, sr_metex14_4packets_parse, | |
19c9b176 UH |
569 | NULL |
570 | ), | |
bcbef5ed ML |
571 | DMM( |
572 | "radioshack-22-168", metex14, | |
10cfb048 | 573 | "RadioShack", "22-168", "1200/7n2/rts=0/dtr=1", |
bcbef5ed ML |
574 | METEX14_PACKET_SIZE, 0, 0, sr_metex14_packet_request, |
575 | sr_metex14_packet_valid, sr_metex14_parse, | |
576 | NULL | |
577 | ), | |
578 | DMM( | |
579 | "radioshack-22-805", metex14, | |
10cfb048 | 580 | "RadioShack", "22-805", "600/7n2/rts=0/dtr=1", |
bcbef5ed ML |
581 | METEX14_PACKET_SIZE, 0, 0, sr_metex14_packet_request, |
582 | sr_metex14_packet_valid, sr_metex14_parse, | |
583 | NULL | |
584 | ), | |
bcbef5ed ML |
585 | DMM( |
586 | "voltcraft-m3650cr", metex14, | |
10cfb048 | 587 | "Voltcraft", "M-3650CR", "1200/7n2/rts=0/dtr=1", |
bcbef5ed ML |
588 | METEX14_PACKET_SIZE, 150, 20, sr_metex14_packet_request, |
589 | sr_metex14_packet_valid, sr_metex14_parse, | |
590 | NULL | |
591 | ), | |
592 | DMM( | |
593 | "voltcraft-m3650d", metex14, | |
10cfb048 | 594 | "Voltcraft", "M-3650D", "1200/7n2/rts=0/dtr=1", |
bcbef5ed ML |
595 | METEX14_PACKET_SIZE, 0, 0, sr_metex14_packet_request, |
596 | sr_metex14_packet_valid, sr_metex14_parse, | |
597 | NULL | |
598 | ), | |
599 | DMM( | |
600 | "voltcraft-m4650cr", metex14, | |
10cfb048 | 601 | "Voltcraft", "M-4650CR", "1200/7n2/rts=0/dtr=1", |
bcbef5ed ML |
602 | METEX14_PACKET_SIZE, 0, 0, sr_metex14_packet_request, |
603 | sr_metex14_packet_valid, sr_metex14_parse, | |
604 | NULL | |
605 | ), | |
606 | DMM( | |
607 | "voltcraft-me42", metex14, | |
10cfb048 | 608 | "Voltcraft", "ME-42", "600/7n2/rts=0/dtr=1", |
bcbef5ed ML |
609 | METEX14_PACKET_SIZE, 250, 60, sr_metex14_packet_request, |
610 | sr_metex14_packet_valid, sr_metex14_parse, | |
611 | NULL | |
612 | ), | |
ab34156b | 613 | /* }}} */ |
92496488 | 614 | /* rs9lcd based meters {{{ */ |
ab34156b GS |
615 | DMM( |
616 | "radioshack-22-812", rs9lcd, | |
10cfb048 | 617 | "RadioShack", "22-812", "4800/8n1/rts=0/dtr=1", |
ab34156b GS |
618 | RS9LCD_PACKET_SIZE, 0, 0, NULL, |
619 | sr_rs9lcd_packet_valid, sr_rs9lcd_parse, | |
620 | NULL | |
621 | ), | |
92496488 | 622 | /* }}} */ |
6c6e5e47 | 623 | /* ut71x based meters {{{ */ |
bcbef5ed | 624 | DMM( |
53e875ab GS |
625 | "tenma-72-7730-ser", ut71x, |
626 | "Tenma", "72-7730 (UT-D02 cable)", "2400/7o1/rts=0/dtr=1", | |
10cfb048 | 627 | UT71X_PACKET_SIZE, 0, 0, NULL, |
bcbef5ed ML |
628 | sr_ut71x_packet_valid, sr_ut71x_parse, NULL |
629 | ), | |
630 | DMM( | |
53e875ab GS |
631 | "tenma-72-7732-ser", ut71x, |
632 | "Tenma", "72-7732 (UT-D02 cable)", "2400/7o1/rts=0/dtr=1", | |
10cfb048 | 633 | UT71X_PACKET_SIZE, 0, 0, NULL, |
bcbef5ed ML |
634 | sr_ut71x_packet_valid, sr_ut71x_parse, NULL |
635 | ), | |
636 | DMM( | |
53e875ab GS |
637 | "tenma-72-9380a-ser", ut71x, |
638 | "Tenma", "72-9380A (UT-D02 cable)", "2400/7o1/rts=0/dtr=1", | |
10cfb048 | 639 | UT71X_PACKET_SIZE, 0, 0, NULL, |
bcbef5ed ML |
640 | sr_ut71x_packet_valid, sr_ut71x_parse, NULL |
641 | ), | |
bcbef5ed ML |
642 | DMM( |
643 | "uni-t-ut71a-ser", ut71x, | |
644 | "UNI-T", "UT71A (UT-D02 cable)", "2400/7o1/rts=0/dtr=1", | |
10cfb048 | 645 | UT71X_PACKET_SIZE, 0, 0, NULL, |
bcbef5ed ML |
646 | sr_ut71x_packet_valid, sr_ut71x_parse, NULL |
647 | ), | |
648 | DMM( | |
649 | "uni-t-ut71b-ser", ut71x, | |
650 | "UNI-T", "UT71B (UT-D02 cable)", "2400/7o1/rts=0/dtr=1", | |
10cfb048 | 651 | UT71X_PACKET_SIZE, 0, 0, NULL, |
bcbef5ed ML |
652 | sr_ut71x_packet_valid, sr_ut71x_parse, NULL |
653 | ), | |
654 | DMM( | |
655 | "uni-t-ut71c-ser", ut71x, | |
656 | "UNI-T", "UT71C (UT-D02 cable)", "2400/7o1/rts=0/dtr=1", | |
10cfb048 | 657 | UT71X_PACKET_SIZE, 0, 0, NULL, |
bcbef5ed ML |
658 | sr_ut71x_packet_valid, sr_ut71x_parse, NULL |
659 | ), | |
660 | DMM( | |
661 | "uni-t-ut71d-ser", ut71x, | |
662 | "UNI-T", "UT71D (UT-D02 cable)", "2400/7o1/rts=0/dtr=1", | |
10cfb048 | 663 | UT71X_PACKET_SIZE, 0, 0, NULL, |
bcbef5ed ML |
664 | sr_ut71x_packet_valid, sr_ut71x_parse, NULL |
665 | ), | |
666 | DMM( | |
667 | "uni-t-ut71e-ser", ut71x, | |
668 | "UNI-T", "UT71E (UT-D02 cable)", "2400/7o1/rts=0/dtr=1", | |
10cfb048 | 669 | UT71X_PACKET_SIZE, 0, 0, NULL, |
bcbef5ed ML |
670 | sr_ut71x_packet_valid, sr_ut71x_parse, NULL |
671 | ), | |
ca7d4426 EE |
672 | DMM( |
673 | "uni-t-ut804-ser", ut71x, | |
674 | "UNI-T", "UT804", "2400/7o1/rts=0/dtr=1", | |
675 | UT71X_PACKET_SIZE, 0, 0, NULL, | |
676 | sr_ut71x_packet_valid, sr_ut71x_parse, NULL | |
677 | ), | |
b1cadcfb | 678 | DMM( |
53e875ab GS |
679 | "voltcraft-vc920-ser", ut71x, |
680 | "Voltcraft", "VC-920 (UT-D02 cable)", "2400/7o1/rts=0/dtr=1", | |
10cfb048 | 681 | UT71X_PACKET_SIZE, 0, 0, NULL, |
b1cadcfb KP |
682 | sr_ut71x_packet_valid, sr_ut71x_parse, NULL |
683 | ), | |
0a4549ff | 684 | DMM( |
53e875ab GS |
685 | "voltcraft-vc940-ser", ut71x, |
686 | "Voltcraft", "VC-940 (UT-D02 cable)", "2400/7o1/rts=0/dtr=1", | |
10cfb048 | 687 | UT71X_PACKET_SIZE, 0, 0, NULL, |
0a4549ff UH |
688 | sr_ut71x_packet_valid, sr_ut71x_parse, NULL |
689 | ), | |
20f9f1fb | 690 | DMM( |
53e875ab GS |
691 | "voltcraft-vc960-ser", ut71x, |
692 | "Voltcraft", "VC-960 (UT-D02 cable)", "2400/7o1/rts=0/dtr=1", | |
10cfb048 | 693 | UT71X_PACKET_SIZE, 0, 0, NULL, |
20f9f1fb UH |
694 | sr_ut71x_packet_valid, sr_ut71x_parse, NULL |
695 | ), | |
6c6e5e47 | 696 | /* }}} */ |
89a3d8af | 697 | /* vc870 based meters {{{ */ |
6c6e5e47 GS |
698 | DMM( |
699 | "voltcraft-vc870-ser", vc870, | |
700 | "Voltcraft", "VC-870 (UT-D02 cable)", "9600/8n1/rts=0/dtr=1", | |
10cfb048 | 701 | VC870_PACKET_SIZE, 0, 0, NULL, |
6c6e5e47 GS |
702 | sr_vc870_packet_valid, sr_vc870_parse, NULL |
703 | ), | |
89a3d8af | 704 | /* }}} */ |
c5c6fa0f UH |
705 | /* vc96 based meters {{{ */ |
706 | DMM( | |
707 | "voltcraft-vc96", vc96, | |
10cfb048 | 708 | "Voltcraft", "VC-96", "1200/8n2", |
c5c6fa0f UH |
709 | VC96_PACKET_SIZE, 0, 0, NULL, |
710 | sr_vc96_packet_valid, sr_vc96_parse, | |
711 | NULL | |
712 | ), | |
713 | /* }}} */ | |
89a3d8af GS |
714 | /* |
715 | * The list is sorted. Add new items in the respective chip's group. | |
716 | */ | |
dd5c48a6 | 717 | ); |