]> sigrok.org Git - libsigrok.git/blame_incremental - hardware/common/scpi.c
Don't define names ending with _t (POSIX reserved).
[libsigrok.git] / hardware / common / scpi.c
... / ...
CommitLineData
1/*
2 * This file is part of the libsigrok project.
3 *
4 * Copyright (C) 2013 poljar (Damir Jelić) <poljarinho@gmail.com>
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#include "libsigrok.h"
21#include "libsigrok-internal.h"
22
23#include <glib.h>
24#include <string.h>
25
26#define LOG_PREFIX "scpi"
27
28#define SCPI_READ_RETRIES 100
29#define SCPI_READ_RETRY_TIMEOUT 10000
30
31/**
32 * Parse a string representation of a boolean-like value into a gboolean.
33 * Similar to sr_parse_boolstring but rejects strings which do not represent
34 * a boolean-like value.
35 *
36 * @param str String to convert.
37 * @param ret Pointer to a gboolean where the result of the conversion will be
38 * stored.
39 *
40 * @return SR_OK on success, SR_ERR on failure.
41 */
42static int parse_strict_bool(const char *str, gboolean *ret)
43{
44 if (!str)
45 return SR_ERR_ARG;
46
47 if (!g_strcmp0(str, "1") ||
48 !g_ascii_strncasecmp(str, "y", 1) ||
49 !g_ascii_strncasecmp(str, "t", 1) ||
50 !g_ascii_strncasecmp(str, "yes", 3) ||
51 !g_ascii_strncasecmp(str, "true", 4) ||
52 !g_ascii_strncasecmp(str, "on", 2)) {
53 *ret = TRUE;
54 return SR_OK;
55 } else if (!g_strcmp0(str, "0") ||
56 !g_ascii_strncasecmp(str, "n", 1) ||
57 !g_ascii_strncasecmp(str, "f", 1) ||
58 !g_ascii_strncasecmp(str, "no", 2) ||
59 !g_ascii_strncasecmp(str, "false", 5) ||
60 !g_ascii_strncasecmp(str, "off", 3)) {
61 *ret = FALSE;
62 return SR_OK;
63 }
64
65 return SR_ERR;
66}
67
68SR_PRIV extern const struct sr_scpi_dev_inst scpi_serial_dev;
69SR_PRIV extern const struct sr_scpi_dev_inst scpi_tcp_raw_dev;
70SR_PRIV extern const struct sr_scpi_dev_inst scpi_tcp_rigol_dev;
71/* SR_PRIV extern const struct sr_scpi_dev_inst scpi_usbtmc_dev; */
72SR_PRIV extern const struct sr_scpi_dev_inst scpi_usbtmc_libusb_dev;
73SR_PRIV extern const struct sr_scpi_dev_inst scpi_vxi_dev;
74SR_PRIV extern const struct sr_scpi_dev_inst scpi_visa_dev;
75
76static const struct sr_scpi_dev_inst *scpi_devs[] = {
77 &scpi_tcp_raw_dev,
78 &scpi_tcp_rigol_dev,
79 /* &scpi_usbtmc_dev, */
80#ifdef HAVE_LIBUSB_1_0
81 &scpi_usbtmc_libusb_dev,
82#endif
83#if HAVE_RPC
84 &scpi_vxi_dev,
85#endif
86#ifdef HAVE_LIBREVISA
87 &scpi_visa_dev,
88#endif
89#ifdef HAVE_LIBSERIALPORT
90 &scpi_serial_dev, /* must be last as it matches any resource */
91#endif
92};
93
94static GSList *sr_scpi_scan_resource(struct drv_context *drvc,
95 const char *resource, const char *serialcomm,
96 struct sr_dev_inst *(*probe_device)(struct sr_scpi_dev_inst *scpi))
97{
98 struct sr_scpi_dev_inst *scpi;
99 struct sr_dev_inst *sdi;
100
101 if (!(scpi = scpi_dev_inst_new(drvc, resource, serialcomm)))
102 return NULL;
103
104 if (sr_scpi_open(scpi) != SR_OK) {
105 sr_info("Couldn't open SCPI device.");
106 sr_scpi_free(scpi);
107 return NULL;
108 };
109
110 if ((sdi = probe_device(scpi)))
111 return g_slist_append(NULL, sdi);
112
113 sr_scpi_close(scpi);
114 sr_scpi_free(scpi);
115 return NULL;
116}
117
118SR_PRIV GSList *sr_scpi_scan(struct drv_context *drvc, GSList *options,
119 struct sr_dev_inst *(*probe_device)(struct sr_scpi_dev_inst *scpi))
120{
121 GSList *resources, *l, *d, *devices = NULL;
122 const char *resource = NULL;
123 const char *serialcomm = NULL;
124 gchar **res;
125 unsigned i;
126
127 for (l = options; l; l = l->next) {
128 struct sr_config *src = l->data;
129 switch (src->key) {
130 case SR_CONF_CONN:
131 resource = g_variant_get_string(src->data, NULL);
132 break;
133 case SR_CONF_SERIALCOMM:
134 serialcomm = g_variant_get_string(src->data, NULL);
135 break;
136 }
137 }
138
139 for (i = 0; i < ARRAY_SIZE(scpi_devs); i++) {
140 if ((resource && strcmp(resource, scpi_devs[i]->prefix))
141 || !scpi_devs[i]->scan)
142 continue;
143 resources = scpi_devs[i]->scan(drvc);
144 for (l = resources; l; l = l->next) {
145 res = g_strsplit(l->data, ":", 2);
146 if (res[0] && (d = sr_scpi_scan_resource(drvc, res[0],
147 serialcomm ? serialcomm : res[1], probe_device)))
148 devices = g_slist_concat(devices, d);
149 g_strfreev(res);
150 }
151 g_slist_free_full(resources, g_free);
152 }
153
154 if (!devices && resource)
155 devices = sr_scpi_scan_resource(drvc, resource, serialcomm,
156 probe_device);
157
158 /* Tack a copy of the newly found devices onto the driver list. */
159 if (devices)
160 drvc->instances = g_slist_concat(drvc->instances,
161 g_slist_copy(devices));
162
163 return devices;
164}
165
166SR_PRIV struct sr_scpi_dev_inst *scpi_dev_inst_new(struct drv_context *drvc,
167 const char *resource, const char *serialcomm)
168{
169 struct sr_scpi_dev_inst *scpi = NULL;
170 const struct sr_scpi_dev_inst *scpi_dev;
171 gchar **params;
172 unsigned i;
173
174 for (i = 0; i < ARRAY_SIZE(scpi_devs); i++) {
175 scpi_dev = scpi_devs[i];
176 if (!strncmp(resource, scpi_dev->prefix, strlen(scpi_dev->prefix))) {
177 sr_dbg("Opening %s device %s.", scpi_dev->name, resource);
178 scpi = g_malloc(sizeof(*scpi));
179 *scpi = *scpi_dev;
180 scpi->priv = g_malloc0(scpi->priv_size);
181 params = g_strsplit(resource, "/", 0);
182 if (scpi->dev_inst_new(scpi->priv, drvc, resource,
183 params, serialcomm) != SR_OK) {
184 sr_scpi_free(scpi);
185 scpi = NULL;
186 }
187 g_strfreev(params);
188 break;
189 }
190 }
191
192 return scpi;
193}
194
195/**
196 * Open SCPI device.
197 *
198 * @param scpi Previously initialized SCPI device structure.
199 *
200 * @return SR_OK on success, SR_ERR on failure.
201 */
202SR_PRIV int sr_scpi_open(struct sr_scpi_dev_inst *scpi)
203{
204 return scpi->open(scpi->priv);
205}
206
207/**
208 * Add an event source for an SCPI device.
209 *
210 * @param scpi Previously initialized SCPI device structure.
211 * @param events Events to check for.
212 * @param timeout Max time to wait before the callback is called, ignored if 0.
213 * @param cb Callback function to add. Must not be NULL.
214 * @param cb_data Data for the callback function. Can be NULL.
215 *
216 * @return SR_OK upon success, SR_ERR_ARG upon invalid arguments, or
217 * SR_ERR_MALLOC upon memory allocation errors.
218 */
219SR_PRIV int sr_scpi_source_add(struct sr_scpi_dev_inst *scpi, int events,
220 int timeout, sr_receive_data_callback cb, void *cb_data)
221{
222 return scpi->source_add(scpi->priv, events, timeout, cb, cb_data);
223}
224
225/**
226 * Remove event source for an SCPI device.
227 *
228 * @param scpi Previously initialized SCPI device structure.
229 *
230 * @return SR_OK upon success, SR_ERR_ARG upon invalid arguments, or
231 * SR_ERR_MALLOC upon memory allocation errors, SR_ERR_BUG upon
232 * internal errors.
233 */
234SR_PRIV int sr_scpi_source_remove(struct sr_scpi_dev_inst *scpi)
235{
236 return scpi->source_remove(scpi->priv);
237}
238
239/**
240 * Send a SCPI command.
241 *
242 * @param scpi Previously initialized SCPI device structure.
243 * @param format Format string, to be followed by any necessary arguments.
244 *
245 * @return SR_OK on success, SR_ERR on failure.
246 */
247SR_PRIV int sr_scpi_send(struct sr_scpi_dev_inst *scpi,
248 const char *format, ...)
249{
250 va_list args;
251 int ret;
252
253 va_start(args, format);
254 ret = sr_scpi_send_variadic(scpi, format, args);
255 va_end(args);
256
257 return ret;
258}
259
260/**
261 * Send a SCPI command with a variadic argument list.
262 *
263 * @param scpi Previously initialized SCPI device structure.
264 * @param format Format string.
265 * @param args Argument list.
266 *
267 * @return SR_OK on success, SR_ERR on failure.
268 */
269SR_PRIV int sr_scpi_send_variadic(struct sr_scpi_dev_inst *scpi,
270 const char *format, va_list args)
271{
272 va_list args_copy;
273 char *buf;
274 int len, ret;
275
276 /* Get length of buffer required. */
277 va_copy(args_copy, args);
278 len = vsnprintf(NULL, 0, format, args_copy);
279 va_end(args_copy);
280
281 /* Allocate buffer and write out command. */
282 buf = g_malloc(len + 1);
283 vsprintf(buf, format, args);
284
285 /* Send command. */
286 ret = scpi->send(scpi->priv, buf);
287
288 /* Free command buffer. */
289 g_free(buf);
290
291 return ret;
292}
293
294/**
295 * Begin receiving an SCPI reply.
296 *
297 * @param scpi Previously initialised SCPI device structure.
298 *
299 * @return SR_OK on success, SR_ERR on failure.
300 */
301SR_PRIV int sr_scpi_read_begin(struct sr_scpi_dev_inst *scpi)
302{
303 return scpi->read_begin(scpi->priv);
304}
305
306/**
307 * Read part of a response from SCPI device.
308 *
309 * @param scpi Previously initialised SCPI device structure.
310 * @param buf Buffer to store result.
311 * @param maxlen Maximum number of bytes to read.
312 *
313 * @return Number of bytes read, or SR_ERR upon failure.
314 */
315SR_PRIV int sr_scpi_read_data(struct sr_scpi_dev_inst *scpi,
316 char *buf, int maxlen)
317{
318 return scpi->read_data(scpi->priv, buf, maxlen);
319}
320
321/**
322 * Check whether a complete SCPI response has been received.
323 *
324 * @param scpi Previously initialised SCPI device structure.
325 *
326 * @return 1 if complete, 0 otherwise.
327 */
328SR_PRIV int sr_scpi_read_complete(struct sr_scpi_dev_inst *scpi)
329{
330 return scpi->read_complete(scpi->priv);
331}
332
333/**
334 * Close SCPI device.
335 *
336 * @param scpi Previously initialized SCPI device structure.
337 *
338 * @return SR_OK on success, SR_ERR on failure.
339 */
340SR_PRIV int sr_scpi_close(struct sr_scpi_dev_inst *scpi)
341{
342 return scpi->close(scpi->priv);
343}
344
345/**
346 * Free SCPI device.
347 *
348 * @param scpi Previously initialized SCPI device structure.
349 *
350 * @return SR_OK on success, SR_ERR on failure.
351 */
352SR_PRIV void sr_scpi_free(struct sr_scpi_dev_inst *scpi)
353{
354 scpi->free(scpi->priv);
355 g_free(scpi->priv);
356 g_free(scpi);
357}
358
359/**
360 * Send a SCPI command, receive the reply and store the reply in scpi_response.
361 *
362 * @param scpi Previously initialised SCPI device structure.
363 * @param command The SCPI command to send to the device (can be NULL).
364 * @param scpi_response Pointer where to store the SCPI response.
365 *
366 * @return SR_OK on success, SR_ERR on failure.
367 */
368SR_PRIV int sr_scpi_get_string(struct sr_scpi_dev_inst *scpi,
369 const char *command, char **scpi_response)
370{
371 char buf[256];
372 int len;
373 GString *response;
374
375 if (command)
376 if (sr_scpi_send(scpi, command) != SR_OK)
377 return SR_ERR;
378
379 if (sr_scpi_read_begin(scpi) != SR_OK)
380 return SR_ERR;
381
382 response = g_string_new("");
383
384 *scpi_response = NULL;
385
386 while (!sr_scpi_read_complete(scpi)) {
387 len = sr_scpi_read_data(scpi, buf, sizeof(buf));
388 if (len < 0) {
389 g_string_free(response, TRUE);
390 return SR_ERR;
391 }
392 g_string_append_len(response, buf, len);
393 }
394
395 /* Get rid of trailing linefeed if present */
396 if (response->len >= 1 && response->str[response->len - 1] == '\n')
397 g_string_truncate(response, response->len - 1);
398
399 *scpi_response = response->str;
400 g_string_free(response, FALSE);
401
402 sr_spew("Got response: '%.70s'.", *scpi_response);
403
404 return SR_OK;
405}
406
407/**
408 * Send a SCPI command, read the reply, parse it as a bool value and store the
409 * result in scpi_response.
410 *
411 * @param scpi Previously initialised SCPI device structure.
412 * @param command The SCPI command to send to the device (can be NULL).
413 * @param scpi_response Pointer where to store the parsed result.
414 *
415 * @return SR_OK on success, SR_ERR on failure.
416 */
417SR_PRIV int sr_scpi_get_bool(struct sr_scpi_dev_inst *scpi,
418 const char *command, gboolean *scpi_response)
419{
420 int ret;
421 char *response;
422
423 response = NULL;
424
425 if (sr_scpi_get_string(scpi, command, &response) != SR_OK)
426 if (!response)
427 return SR_ERR;
428
429 if (parse_strict_bool(response, scpi_response) == SR_OK)
430 ret = SR_OK;
431 else
432 ret = SR_ERR;
433
434 g_free(response);
435
436 return ret;
437}
438
439/**
440 * Send a SCPI command, read the reply, parse it as an integer and store the
441 * result in scpi_response.
442 *
443 * @param scpi Previously initialised SCPI device structure.
444 * @param command The SCPI command to send to the device (can be NULL).
445 * @param scpi_response Pointer where to store the parsed result.
446 *
447 * @return SR_OK on success, SR_ERR on failure.
448 */
449SR_PRIV int sr_scpi_get_int(struct sr_scpi_dev_inst *scpi,
450 const char *command, int *scpi_response)
451{
452 int ret;
453 char *response;
454
455 response = NULL;
456
457 if (sr_scpi_get_string(scpi, command, &response) != SR_OK)
458 if (!response)
459 return SR_ERR;
460
461 if (sr_atoi(response, scpi_response) == SR_OK)
462 ret = SR_OK;
463 else
464 ret = SR_ERR;
465
466 g_free(response);
467
468 return ret;
469}
470
471/**
472 * Send a SCPI command, read the reply, parse it as a float and store the
473 * result in scpi_response.
474 *
475 * @param scpi Previously initialised SCPI device structure.
476 * @param command The SCPI command to send to the device (can be NULL).
477 * @param scpi_response Pointer where to store the parsed result.
478 *
479 * @return SR_OK on success, SR_ERR on failure.
480 */
481SR_PRIV int sr_scpi_get_float(struct sr_scpi_dev_inst *scpi,
482 const char *command, float *scpi_response)
483{
484 int ret;
485 char *response;
486
487 response = NULL;
488
489 if (sr_scpi_get_string(scpi, command, &response) != SR_OK)
490 if (!response)
491 return SR_ERR;
492
493 if (sr_atof_ascii(response, scpi_response) == SR_OK)
494 ret = SR_OK;
495 else
496 ret = SR_ERR;
497
498 g_free(response);
499
500 return ret;
501}
502
503/**
504 * Send a SCPI command, read the reply, parse it as a double and store the
505 * result in scpi_response.
506 *
507 * @param scpi Previously initialised SCPI device structure.
508 * @param command The SCPI command to send to the device (can be NULL).
509 * @param scpi_response Pointer where to store the parsed result.
510 *
511 * @return SR_OK on success, SR_ERR on failure.
512 */
513SR_PRIV int sr_scpi_get_double(struct sr_scpi_dev_inst *scpi,
514 const char *command, double *scpi_response)
515{
516 int ret;
517 char *response;
518
519 response = NULL;
520
521 if (sr_scpi_get_string(scpi, command, &response) != SR_OK)
522 if (!response)
523 return SR_ERR;
524
525 if (sr_atod(response, scpi_response) == SR_OK)
526 ret = SR_OK;
527 else
528 ret = SR_ERR;
529
530 g_free(response);
531
532 return ret;
533}
534
535/**
536 * Send a SCPI *OPC? command, read the reply and return the result of the
537 * command.
538 *
539 * @param scpi Previously initialised SCPI device structure.
540 *
541 * @return SR_OK on success, SR_ERR on failure.
542 */
543SR_PRIV int sr_scpi_get_opc(struct sr_scpi_dev_inst *scpi)
544{
545 unsigned int i;
546 gboolean opc;
547
548 for (i = 0; i < SCPI_READ_RETRIES; ++i) {
549 sr_scpi_get_bool(scpi, SCPI_CMD_OPC, &opc);
550 if (opc)
551 return SR_OK;
552 g_usleep(SCPI_READ_RETRY_TIMEOUT);
553 }
554
555 return SR_ERR;
556}
557
558/**
559 * Send a SCPI command, read the reply, parse it as comma separated list of
560 * floats and store the as an result in scpi_response.
561 *
562 * @param scpi Previously initialised SCPI device structure.
563 * @param command The SCPI command to send to the device (can be NULL).
564 * @param scpi_response Pointer where to store the parsed result.
565 *
566 * @return SR_OK upon successfully parsing all values, SR_ERR upon a parsing
567 * error or upon no response. The allocated response must be freed by
568 * the caller in the case of an SR_OK as well as in the case of
569 * parsing error.
570 */
571SR_PRIV int sr_scpi_get_floatv(struct sr_scpi_dev_inst *scpi,
572 const char *command, GArray **scpi_response)
573{
574 int ret;
575 float tmp;
576 char *response;
577 gchar **ptr, **tokens;
578 GArray *response_array;
579
580 ret = SR_OK;
581 response = NULL;
582 tokens = NULL;
583
584 if (sr_scpi_get_string(scpi, command, &response) != SR_OK)
585 if (!response)
586 return SR_ERR;
587
588 tokens = g_strsplit(response, ",", 0);
589 ptr = tokens;
590
591 response_array = g_array_sized_new(TRUE, FALSE, sizeof(float), 256);
592
593 while (*ptr) {
594 if (sr_atof_ascii(*ptr, &tmp) == SR_OK)
595 response_array = g_array_append_val(response_array,
596 tmp);
597 else
598 ret = SR_ERR;
599
600 ptr++;
601 }
602 g_strfreev(tokens);
603 g_free(response);
604
605 if (ret == SR_ERR && response_array->len == 0) {
606 g_array_free(response_array, TRUE);
607 *scpi_response = NULL;
608 return SR_ERR;
609 }
610
611 *scpi_response = response_array;
612
613 return ret;
614}
615
616/**
617 * Send a SCPI command, read the reply, parse it as comma separated list of
618 * unsigned 8 bit integers and store the as an result in scpi_response.
619 *
620 * @param scpi Previously initialised SCPI device structure.
621 * @param command The SCPI command to send to the device (can be NULL).
622 * @param scpi_response Pointer where to store the parsed result.
623 *
624 * @return SR_OK upon successfully parsing all values, SR_ERR upon a parsing
625 * error or upon no response. The allocated response must be freed by
626 * the caller in the case of an SR_OK as well as in the case of
627 * parsing error.
628 */
629SR_PRIV int sr_scpi_get_uint8v(struct sr_scpi_dev_inst *scpi,
630 const char *command, GArray **scpi_response)
631{
632 int tmp, ret;
633 char *response;
634 gchar **ptr, **tokens;
635 GArray *response_array;
636
637 ret = SR_OK;
638 response = NULL;
639 tokens = NULL;
640
641 if (sr_scpi_get_string(scpi, command, &response) != SR_OK)
642 if (!response)
643 return SR_ERR;
644
645 tokens = g_strsplit(response, ",", 0);
646 ptr = tokens;
647
648 response_array = g_array_sized_new(TRUE, FALSE, sizeof(uint8_t), 256);
649
650 while (*ptr) {
651 if (sr_atoi(*ptr, &tmp) == SR_OK)
652 response_array = g_array_append_val(response_array,
653 tmp);
654 else
655 ret = SR_ERR;
656
657 ptr++;
658 }
659 g_strfreev(tokens);
660 g_free(response);
661
662 if (response_array->len == 0) {
663 g_array_free(response_array, TRUE);
664 *scpi_response = NULL;
665 return SR_ERR;
666 }
667
668 *scpi_response = response_array;
669
670 return ret;
671}
672
673/**
674 * Send the *IDN? SCPI command, receive the reply, parse it and store the
675 * reply as a sr_scpi_hw_info structure in the supplied scpi_response pointer.
676 *
677 * The hw_info structure must be freed by the caller via sr_scpi_hw_info_free().
678 *
679 * @param scpi Previously initialised SCPI device structure.
680 * @param scpi_response Pointer where to store the hw_info structure.
681 *
682 * @return SR_OK upon success, SR_ERR on failure.
683 */
684SR_PRIV int sr_scpi_get_hw_id(struct sr_scpi_dev_inst *scpi,
685 struct sr_scpi_hw_info **scpi_response)
686{
687 int num_tokens;
688 char *response;
689 gchar **tokens;
690 struct sr_scpi_hw_info *hw_info;
691
692 response = NULL;
693 tokens = NULL;
694
695 if (sr_scpi_get_string(scpi, SCPI_CMD_IDN, &response) != SR_OK)
696 if (!response)
697 return SR_ERR;
698
699 sr_info("Got IDN string: '%s'", response);
700
701 /*
702 * The response to a '*IDN?' is specified by the SCPI spec. It contains
703 * a comma-separated list containing the manufacturer name, instrument
704 * model, serial number of the instrument and the firmware version.
705 */
706 tokens = g_strsplit(response, ",", 0);
707
708 for (num_tokens = 0; tokens[num_tokens] != NULL; num_tokens++);
709
710 if (num_tokens != 4) {
711 sr_dbg("IDN response not according to spec: %80.s.", response);
712 g_strfreev(tokens);
713 g_free(response);
714 return SR_ERR;
715 }
716 g_free(response);
717
718 hw_info = g_try_malloc(sizeof(struct sr_scpi_hw_info));
719 if (!hw_info) {
720 g_strfreev(tokens);
721 return SR_ERR_MALLOC;
722 }
723
724 hw_info->manufacturer = g_strdup(tokens[0]);
725 hw_info->model = g_strdup(tokens[1]);
726 hw_info->serial_number = g_strdup(tokens[2]);
727 hw_info->firmware_version = g_strdup(tokens[3]);
728
729 g_strfreev(tokens);
730
731 *scpi_response = hw_info;
732
733 return SR_OK;
734}
735
736/**
737 * Free a sr_scpi_hw_info struct.
738 *
739 * @param hw_info Pointer to the struct to free.
740 *
741 * This function is safe to call with a NULL pointer.
742 */
743SR_PRIV void sr_scpi_hw_info_free(struct sr_scpi_hw_info *hw_info)
744{
745 if (hw_info) {
746 g_free(hw_info->manufacturer);
747 g_free(hw_info->model);
748 g_free(hw_info->serial_number);
749 g_free(hw_info->firmware_version);
750 g_free(hw_info);
751 }
752}