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