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