diff --git a/iio.h b/iio.h index 32a40262b..78fa2cadb 100644 --- a/iio.h +++ b/iio.h @@ -205,8 +205,10 @@ enum iio_modifier { /** @brief Create a scan context - * @param backend A NULL-terminated string containing the backend to use for - * scanning. If NULL, all the available backends are used. + * @param backend A NULL-terminated string containing the backend(s) to use for + * scanning (example: pre version 0.20 : "local", "ip", or "usb"; post version + * 0.20 can handle multiple, including "local:usb:", "ip:usb:", "local:usb:ip:"). + * If NULL, all the available backends are used. * @param flags Unused for now. Set to 0. * @return on success, a pointer to a iio_scan_context structure * @return On failure, NULL is returned and errno is set appropriately */ diff --git a/scan.c b/scan.c index 6aedc89c8..873dee28b 100644 --- a/scan.c +++ b/scan.c @@ -153,15 +153,15 @@ struct iio_scan_context * iio_create_scan_context( return NULL; } - if (!backend || !strcmp(backend, "local")) + if (!backend || strstr(backend, "local")) ctx->scan_local = true; #ifdef WITH_USB_BACKEND - if (!backend || !strcmp(backend, "usb")) + if (!backend || strstr(backend, "usb")) ctx->usb_ctx = usb_context_scan_init(); #endif #ifdef HAVE_DNS_SD - if (!backend || !strcmp(backend, "ip")) + if (!backend || strstr(backend, "ip")) ctx->dnssd_ctx = dnssd_context_scan_init(); #endif