]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * This file is part of the libsigrok project. | |
3 | * | |
4 | * Copyright (C) 2013, 2014 Matthias Heidbrink <m-sigrok@heidbrink.biz> | |
5 | * | |
6 | * This program is free software: you can redistribute it and/or modify | |
7 | * it under the terms of the GNU General Public License as published by | |
8 | * the Free Software Foundation, either version 3 of the License, or | |
9 | * (at your option) any later version. | |
10 | * | |
11 | * This program is distributed in the hope that it will be useful, | |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | * GNU General Public License for more details. | |
15 | * | |
16 | * You should have received a copy of the GNU General Public License | |
17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
18 | */ | |
19 | ||
20 | /** @file | |
21 | * Gossen Metrawatt Metrahit 1x/2x drivers | |
22 | * @internal | |
23 | */ | |
24 | ||
25 | #include <string.h> | |
26 | #include "protocol.h" | |
27 | ||
28 | /* Serial communication parameters for Metrahit 1x/2x with 'RS232' adaptor */ | |
29 | #define SERIALCOMM_1X_RS232 "8228/6n1/dtr=1/rts=1/flow=0" /* =8192, closer with divider */ | |
30 | #define SERIALCOMM_2X_RS232 "9600/6n1/dtr=1/rts=1/flow=0" | |
31 | #define SERIALCOMM_2X "9600/8n1/dtr=1/rts=1/flow=0" | |
32 | #define VENDOR_GMC "Gossen Metrawatt" | |
33 | ||
34 | SR_PRIV struct sr_dev_driver gmc_mh_1x_2x_rs232_driver_info; | |
35 | SR_PRIV struct sr_dev_driver gmc_mh_2x_bd232_driver_info; | |
36 | ||
37 | static const uint32_t scanopts[] = { | |
38 | SR_CONF_CONN, | |
39 | SR_CONF_SERIALCOMM, | |
40 | }; | |
41 | ||
42 | /** Hardware capabilities for Metrahit 1x/2x devices in send mode. */ | |
43 | static const uint32_t devopts_sm[] = { | |
44 | SR_CONF_MULTIMETER, | |
45 | SR_CONF_THERMOMETER, /**< All GMC 1x/2x multimeters seem to support this */ | |
46 | SR_CONF_CONTINUOUS, | |
47 | SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET, | |
48 | SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET, | |
49 | }; | |
50 | ||
51 | /** Hardware capabilities for Metrahit 2x devices in bidirectional Mode. */ | |
52 | static const uint32_t devopts_bd[] = { | |
53 | SR_CONF_MULTIMETER, | |
54 | SR_CONF_THERMOMETER, /**< All GMC 1x/2x multimeters seem to support this */ | |
55 | SR_CONF_CONTINUOUS, | |
56 | SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET, | |
57 | SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET, | |
58 | SR_CONF_POWER_OFF | SR_CONF_GET | SR_CONF_SET, | |
59 | }; | |
60 | ||
61 | ||
62 | /* TODO: | |
63 | * - For the 29S SR_CONF_ENERGYMETER, too. | |
64 | * - SR_CONF_PATTERN_MODE for some 2x devices | |
65 | * - SR_CONF_DATALOG for 22M, 26M, 29S and storage adaptors. | |
66 | * Need to implement device-specific lists. | |
67 | */ | |
68 | ||
69 | static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx) | |
70 | { | |
71 | return std_init(sr_ctx, di, LOG_PREFIX); | |
72 | } | |
73 | ||
74 | /** | |
75 | * Read single byte from serial port. | |
76 | * | |
77 | * @retval -1 Timeout or error. | |
78 | * @retval other Byte. | |
79 | */ | |
80 | static int read_byte(struct sr_serial_dev_inst *serial, gint64 timeout) | |
81 | { | |
82 | uint8_t result = 0; | |
83 | int rc = 0; | |
84 | ||
85 | for (;;) { | |
86 | rc = serial_read_nonblocking(serial, &result, 1); | |
87 | if (rc == 1) { | |
88 | sr_spew("read: 0x%02x/%d", result, result); | |
89 | return result; | |
90 | } | |
91 | if (g_get_monotonic_time() > timeout) | |
92 | return -1; | |
93 | g_usleep(2000); | |
94 | } | |
95 | } | |
96 | ||
97 | /** | |
98 | * Try to detect GMC 1x/2x multimeter model in send mode for max. 1 second. | |
99 | * | |
100 | * @param serial Configured, open serial port. | |
101 | * | |
102 | * @retval NULL Detection failed. | |
103 | * @retval other Model code. | |
104 | */ | |
105 | static enum model scan_model_sm(struct sr_serial_dev_inst *serial) | |
106 | { | |
107 | int byte, bytecnt, cnt; | |
108 | enum model model; | |
109 | gint64 timeout_us; | |
110 | ||
111 | model = METRAHIT_NONE; | |
112 | timeout_us = g_get_monotonic_time() + 1 * 1000 * 1000; | |
113 | ||
114 | /* | |
115 | * Try to find message consisting of device code and several | |
116 | * (at least 4) data bytes. | |
117 | */ | |
118 | for (bytecnt = 0; bytecnt < 100; bytecnt++) { | |
119 | byte = read_byte(serial, timeout_us); | |
120 | if ((byte == -1) || (timeout_us < g_get_monotonic_time())) | |
121 | break; | |
122 | if ((byte & MSGID_MASK) == MSGID_INF) { | |
123 | if (!(model = gmc_decode_model_sm(byte & MSGC_MASK))) | |
124 | break; | |
125 | /* Now expect (at least) 4 data bytes. */ | |
126 | for (cnt = 0; cnt < 4; cnt++) { | |
127 | byte = read_byte(serial, timeout_us); | |
128 | if ((byte == -1) || | |
129 | ((byte & MSGID_MASK) != MSGID_DATA)) | |
130 | { | |
131 | model = METRAHIT_NONE; | |
132 | bytecnt = 100; | |
133 | break; | |
134 | } | |
135 | } | |
136 | break; | |
137 | } | |
138 | } | |
139 | ||
140 | return model; | |
141 | } | |
142 | ||
143 | /** | |
144 | * Scan for Metrahit 1x and Metrahit 2x in send mode using Gossen Metrawatt | |
145 | * 'RS232' interface. | |
146 | * | |
147 | * The older 1x models use 8192 baud and the newer 2x 9600 baud. | |
148 | * The DMM usually sends up to about 20 messages per second. However, depending | |
149 | * on configuration and measurement mode the intervals can be much larger and | |
150 | * then the detection might not work. | |
151 | */ | |
152 | static GSList *scan_1x_2x_rs232(struct sr_dev_driver *di, GSList *options) | |
153 | { | |
154 | struct sr_dev_inst *sdi; | |
155 | struct drv_context *drvc; | |
156 | struct dev_context *devc; | |
157 | struct sr_config *src; | |
158 | struct sr_serial_dev_inst *serial; | |
159 | GSList *l, *devices; | |
160 | const char *conn, *serialcomm; | |
161 | enum model model; | |
162 | gboolean serialcomm_given; | |
163 | ||
164 | devices = NULL; | |
165 | drvc = di->priv; | |
166 | drvc->instances = NULL; | |
167 | conn = serialcomm = NULL; | |
168 | model = METRAHIT_NONE; | |
169 | serialcomm_given = FALSE; | |
170 | ||
171 | sr_spew("scan_1x_2x_rs232() called!"); | |
172 | ||
173 | for (l = options; l; l = l->next) { | |
174 | src = l->data; | |
175 | switch (src->key) { | |
176 | case SR_CONF_CONN: | |
177 | conn = g_variant_get_string(src->data, NULL); | |
178 | break; | |
179 | case SR_CONF_SERIALCOMM: | |
180 | serialcomm = g_variant_get_string(src->data, NULL); | |
181 | serialcomm_given = TRUE; | |
182 | break; | |
183 | } | |
184 | } | |
185 | if (!conn) | |
186 | return NULL; | |
187 | if (!serialcomm) | |
188 | serialcomm = SERIALCOMM_2X_RS232; | |
189 | ||
190 | serial = sr_serial_dev_inst_new(conn, serialcomm); | |
191 | ||
192 | if (serial_open(serial, SERIAL_RDWR) != SR_OK) { | |
193 | sr_serial_dev_inst_free(serial); | |
194 | return NULL; | |
195 | } | |
196 | ||
197 | serial_flush(serial); | |
198 | ||
199 | model = scan_model_sm(serial); | |
200 | ||
201 | /* | |
202 | * If detection failed and no user-supplied parameters, | |
203 | * try second baud rate. | |
204 | */ | |
205 | if ((model == METRAHIT_NONE) && !serialcomm_given) { | |
206 | serialcomm = SERIALCOMM_1X_RS232; | |
207 | g_free(serial->serialcomm); | |
208 | serial->serialcomm = g_strdup(serialcomm); | |
209 | if (serial_set_paramstr(serial, serialcomm) == SR_OK) { | |
210 | serial_flush(serial); | |
211 | model = scan_model_sm(serial); | |
212 | } | |
213 | } | |
214 | ||
215 | if (model != METRAHIT_NONE) { | |
216 | sr_spew("%s %s detected!", VENDOR_GMC, gmc_model_str(model)); | |
217 | sdi = g_malloc0(sizeof(struct sr_dev_inst)); | |
218 | sdi->status = SR_ST_INACTIVE; | |
219 | sdi->vendor = g_strdup(VENDOR_GMC); | |
220 | sdi->model = g_strdup(gmc_model_str(model)); | |
221 | devc = g_malloc0(sizeof(struct dev_context)); | |
222 | devc->model = model; | |
223 | devc->limit_samples = 0; | |
224 | devc->limit_msec = 0; | |
225 | devc->num_samples = 0; | |
226 | devc->elapsed_msec = g_timer_new(); | |
227 | devc->settings_ok = FALSE; | |
228 | sdi->conn = serial; | |
229 | sdi->priv = devc; | |
230 | sdi->driver = di; | |
231 | sr_channel_new(sdi, 0, SR_CHANNEL_ANALOG, TRUE, "P1"); | |
232 | drvc->instances = g_slist_append(drvc->instances, sdi); | |
233 | devices = g_slist_append(devices, sdi); | |
234 | } | |
235 | ||
236 | return devices; | |
237 | } | |
238 | ||
239 | /** | |
240 | * Scan for Metrahit 2x in a bidirectional mode using Gossen Metrawatt | |
241 | * 'BD 232' interface. | |
242 | */ | |
243 | static GSList *scan_2x_bd232(struct sr_dev_driver *di, GSList *options) | |
244 | { | |
245 | struct sr_dev_inst *sdi; | |
246 | struct drv_context *drvc; | |
247 | struct dev_context *devc; | |
248 | struct sr_config *src; | |
249 | struct sr_serial_dev_inst *serial; | |
250 | GSList *l, *devices; | |
251 | const char *conn, *serialcomm; | |
252 | int cnt, byte; | |
253 | gint64 timeout_us; | |
254 | ||
255 | sdi = NULL; | |
256 | devc = NULL; | |
257 | conn = serialcomm = NULL; | |
258 | devices = NULL; | |
259 | ||
260 | drvc = di->priv; | |
261 | drvc->instances = NULL; | |
262 | ||
263 | sr_spew("scan_2x_bd232() called!"); | |
264 | ||
265 | for (l = options; l; l = l->next) { | |
266 | src = l->data; | |
267 | switch (src->key) { | |
268 | case SR_CONF_CONN: | |
269 | conn = g_variant_get_string(src->data, NULL); | |
270 | break; | |
271 | case SR_CONF_SERIALCOMM: | |
272 | serialcomm = g_variant_get_string(src->data, NULL); | |
273 | break; | |
274 | } | |
275 | } | |
276 | if (!conn) | |
277 | return NULL; | |
278 | if (!serialcomm) | |
279 | serialcomm = SERIALCOMM_2X; | |
280 | ||
281 | serial = sr_serial_dev_inst_new(conn, serialcomm); | |
282 | ||
283 | if (serial_open(serial, SERIAL_RDWR) != SR_OK) | |
284 | goto exit_err; | |
285 | ||
286 | devc = g_malloc0(sizeof(struct dev_context)); | |
287 | ||
288 | sdi = g_malloc0(sizeof(struct sr_dev_inst)); | |
289 | sdi->status = SR_ST_INACTIVE; | |
290 | sdi->vendor = g_strdup(VENDOR_GMC); | |
291 | sdi->priv = devc; | |
292 | ||
293 | /* Send message 03 "Query multimeter version and status" */ | |
294 | sdi->conn = serial; | |
295 | sdi->priv = devc; | |
296 | if (req_stat14(sdi, TRUE) != SR_OK) | |
297 | goto exit_err; | |
298 | ||
299 | /* Wait for reply from device(s) for up to 2s. */ | |
300 | timeout_us = g_get_monotonic_time() + 2*1000*1000; | |
301 | ||
302 | while (timeout_us > g_get_monotonic_time()) { | |
303 | /* Receive reply (14 bytes) */ | |
304 | devc->buflen = 0; | |
305 | for (cnt = 0; cnt < 14; cnt++) { | |
306 | byte = read_byte(serial, timeout_us); | |
307 | if (byte != -1) | |
308 | devc->buf[devc->buflen++] = (byte & MASK_6BITS); | |
309 | } | |
310 | ||
311 | if (devc->buflen != 14) | |
312 | continue; | |
313 | ||
314 | devc->addr = devc->buf[0]; | |
315 | process_msg14(sdi); | |
316 | devc->buflen = 0; | |
317 | ||
318 | if (devc->model != METRAHIT_NONE) { | |
319 | sr_spew("%s %s detected!", VENDOR_GMC, gmc_model_str(devc->model)); | |
320 | devc->elapsed_msec = g_timer_new(); | |
321 | sdi->model = g_strdup(gmc_model_str(devc->model)); | |
322 | sdi->version = g_strdup_printf("Firmware %d.%d", devc->fw_ver_maj, devc->fw_ver_min); | |
323 | sdi->conn = serial; | |
324 | sdi->priv = devc; | |
325 | sdi->driver = di; | |
326 | sr_channel_new(sdi, 0, SR_CHANNEL_ANALOG, TRUE, "P1"); | |
327 | drvc->instances = g_slist_append(drvc->instances, sdi); | |
328 | devices = g_slist_append(devices, sdi); | |
329 | devc = g_malloc0(sizeof(struct dev_context)); | |
330 | sdi = g_malloc0(sizeof(struct sr_dev_inst)); | |
331 | sdi->status = SR_ST_INACTIVE; | |
332 | sdi->vendor = g_strdup(VENDOR_GMC); | |
333 | } | |
334 | }; | |
335 | ||
336 | /* Free last alloc if no device found */ | |
337 | if (devc->model == METRAHIT_NONE) { | |
338 | g_free(devc); | |
339 | sr_dev_inst_free(sdi); | |
340 | } | |
341 | ||
342 | return devices; | |
343 | ||
344 | exit_err: | |
345 | sr_info("scan_2x_bd232(): Error!"); | |
346 | ||
347 | if (serial) | |
348 | sr_serial_dev_inst_free(serial); | |
349 | if (devc) | |
350 | g_free(devc); | |
351 | if (sdi) | |
352 | sr_dev_inst_free(sdi); | |
353 | ||
354 | return NULL; | |
355 | } | |
356 | ||
357 | static GSList *dev_list(const struct sr_dev_driver *di) | |
358 | { | |
359 | return ((struct drv_context *)(di->priv))->instances; | |
360 | } | |
361 | ||
362 | static int dev_close(struct sr_dev_inst *sdi) | |
363 | { | |
364 | struct dev_context *devc; | |
365 | ||
366 | std_serial_dev_close(sdi); | |
367 | ||
368 | sdi->status = SR_ST_INACTIVE; | |
369 | ||
370 | /* Free dynamically allocated resources. */ | |
371 | if ((devc = sdi->priv) && devc->elapsed_msec) { | |
372 | g_timer_destroy(devc->elapsed_msec); | |
373 | devc->elapsed_msec = NULL; | |
374 | devc->model = METRAHIT_NONE; | |
375 | } | |
376 | ||
377 | return SR_OK; | |
378 | } | |
379 | ||
380 | static int cleanup(const struct sr_dev_driver *di) | |
381 | { | |
382 | return std_dev_clear(di, NULL); | |
383 | } | |
384 | ||
385 | static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi, | |
386 | const struct sr_channel_group *cg) | |
387 | { | |
388 | int ret; | |
389 | struct dev_context *devc; | |
390 | ||
391 | (void)cg; | |
392 | ||
393 | ret = SR_OK; | |
394 | ||
395 | if (!sdi || !(devc = sdi->priv)) | |
396 | return SR_ERR_ARG; | |
397 | ||
398 | ret = SR_OK; | |
399 | switch (key) { | |
400 | case SR_CONF_LIMIT_SAMPLES: | |
401 | *data = g_variant_new_uint64(devc->limit_samples); | |
402 | break; | |
403 | case SR_CONF_LIMIT_MSEC: | |
404 | *data = g_variant_new_uint64(devc->limit_msec); | |
405 | break; | |
406 | case SR_CONF_POWER_OFF: | |
407 | *data = g_variant_new_boolean(FALSE); | |
408 | break; | |
409 | default: | |
410 | return SR_ERR_NA; | |
411 | } | |
412 | ||
413 | return ret; | |
414 | } | |
415 | ||
416 | /** Implementation of config_list, auxiliary function for common parts. */ | |
417 | static int config_list_common(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi, | |
418 | const struct sr_channel_group *cg) | |
419 | { | |
420 | (void)sdi; | |
421 | (void)cg; | |
422 | ||
423 | switch (key) { | |
424 | case SR_CONF_SCAN_OPTIONS: | |
425 | *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, | |
426 | scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t)); | |
427 | break; | |
428 | default: | |
429 | return SR_ERR_NA; | |
430 | } | |
431 | ||
432 | return SR_OK; | |
433 | } | |
434 | ||
435 | /** Implementation of config_list for Metrahit 1x/2x send mode */ | |
436 | static int config_list_sm(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi, | |
437 | const struct sr_channel_group *cg) | |
438 | { | |
439 | switch (key) { | |
440 | case SR_CONF_DEVICE_OPTIONS: | |
441 | *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, | |
442 | devopts_sm, ARRAY_SIZE(devopts_sm), sizeof(uint32_t)); | |
443 | break; | |
444 | default: | |
445 | return config_list_common(key, data, sdi, cg); | |
446 | } | |
447 | ||
448 | return SR_OK; | |
449 | } | |
450 | ||
451 | /** Implementation of config_list for Metrahit 2x bidirectional mode */ | |
452 | static int config_list_bd(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi, | |
453 | const struct sr_channel_group *cg) | |
454 | { | |
455 | switch (key) { | |
456 | case SR_CONF_DEVICE_OPTIONS: | |
457 | *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, | |
458 | devopts_bd, ARRAY_SIZE(devopts_bd), sizeof(uint32_t)); | |
459 | break; | |
460 | default: | |
461 | return config_list_common(key, data, sdi, cg); | |
462 | } | |
463 | ||
464 | return SR_OK; | |
465 | } | |
466 | ||
467 | static int dev_acquisition_start_1x_2x_rs232(const struct sr_dev_inst *sdi, | |
468 | void *cb_data) | |
469 | { | |
470 | struct dev_context *devc; | |
471 | struct sr_serial_dev_inst *serial; | |
472 | ||
473 | if (!sdi || !cb_data || !(devc = sdi->priv)) | |
474 | return SR_ERR_BUG; | |
475 | ||
476 | if (sdi->status != SR_ST_ACTIVE) | |
477 | return SR_ERR_DEV_CLOSED; | |
478 | ||
479 | devc->cb_data = cb_data; | |
480 | devc->settings_ok = FALSE; | |
481 | devc->buflen = 0; | |
482 | ||
483 | /* Send header packet to the session bus. */ | |
484 | std_session_send_df_header(cb_data, LOG_PREFIX); | |
485 | ||
486 | /* Start timer, if required. */ | |
487 | if (devc->limit_msec) | |
488 | g_timer_start(devc->elapsed_msec); | |
489 | ||
490 | /* Poll every 40ms, or whenever some data comes in. */ | |
491 | serial = sdi->conn; | |
492 | serial_source_add(sdi->session, serial, G_IO_IN, 40, | |
493 | gmc_mh_1x_2x_receive_data, (void *)sdi); | |
494 | ||
495 | return SR_OK; | |
496 | } | |
497 | ||
498 | static int dev_acquisition_start_2x_bd232(const struct sr_dev_inst *sdi, | |
499 | void *cb_data) | |
500 | { | |
501 | struct dev_context *devc; | |
502 | struct sr_serial_dev_inst *serial; | |
503 | ||
504 | if (!sdi || !cb_data || !(devc = sdi->priv)) | |
505 | return SR_ERR_BUG; | |
506 | ||
507 | if (sdi->status != SR_ST_ACTIVE) | |
508 | return SR_ERR_DEV_CLOSED; | |
509 | ||
510 | devc->cb_data = cb_data; | |
511 | devc->settings_ok = FALSE; | |
512 | devc->buflen = 0; | |
513 | ||
514 | /* Send header packet to the session bus. */ | |
515 | std_session_send_df_header(cb_data, LOG_PREFIX); | |
516 | ||
517 | /* Start timer, if required. */ | |
518 | if (devc->limit_msec) | |
519 | g_timer_start(devc->elapsed_msec); | |
520 | ||
521 | /* Poll every 40ms, or whenever some data comes in. */ | |
522 | serial = sdi->conn; | |
523 | serial_source_add(sdi->session, serial, G_IO_IN, 40, | |
524 | gmc_mh_2x_receive_data, (void *)sdi); | |
525 | ||
526 | /* Send start message */ | |
527 | return req_meas14(sdi); | |
528 | } | |
529 | ||
530 | static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data) | |
531 | { | |
532 | struct dev_context *devc; | |
533 | ||
534 | /* Stop timer, if required. */ | |
535 | if (sdi && (devc = sdi->priv) && devc->limit_msec) | |
536 | g_timer_stop(devc->elapsed_msec); | |
537 | ||
538 | return std_serial_dev_acquisition_stop(sdi, cb_data, dev_close, | |
539 | sdi->conn, LOG_PREFIX); | |
540 | } | |
541 | ||
542 | SR_PRIV struct sr_dev_driver gmc_mh_1x_2x_rs232_driver_info = { | |
543 | .name = "gmc-mh-1x-2x-rs232", | |
544 | .longname = "Gossen Metrawatt Metrahit 1x/2x, RS232 interface", | |
545 | .api_version = 1, | |
546 | .init = init, | |
547 | .cleanup = cleanup, | |
548 | .scan = scan_1x_2x_rs232, | |
549 | .dev_list = dev_list, | |
550 | .dev_clear = NULL, | |
551 | .config_get = config_get, | |
552 | .config_set = config_set, | |
553 | .config_list = config_list_sm, | |
554 | .dev_open = std_serial_dev_open, | |
555 | .dev_close = dev_close, | |
556 | .dev_acquisition_start = dev_acquisition_start_1x_2x_rs232, | |
557 | .dev_acquisition_stop = dev_acquisition_stop, | |
558 | .priv = NULL, | |
559 | }; | |
560 | ||
561 | SR_PRIV struct sr_dev_driver gmc_mh_2x_bd232_driver_info = { | |
562 | .name = "gmc-mh-2x-bd232", | |
563 | .longname = "Gossen Metrawatt Metrahit 2x, BD232/SI232-II interface", | |
564 | .api_version = 1, | |
565 | .init = init, | |
566 | .cleanup = cleanup, | |
567 | .scan = scan_2x_bd232, | |
568 | .dev_list = dev_list, | |
569 | .dev_clear = NULL, | |
570 | .config_get = config_get, | |
571 | .config_set = config_set, | |
572 | .config_list = config_list_bd, | |
573 | .dev_open = std_serial_dev_open, | |
574 | .dev_close = dev_close, | |
575 | .dev_acquisition_start = dev_acquisition_start_2x_bd232, | |
576 | .dev_acquisition_stop = dev_acquisition_stop, | |
577 | .priv = NULL, | |
578 | }; |