diff --git a/man/iio_attr.1.in b/man/iio_attr.1.in index a76feae06..aa4975139 100644 --- a/man/iio_attr.1.in +++ b/man/iio_attr.1.in @@ -83,8 +83,11 @@ Read and Write IIO Context attributes .B \-D \-\-debug-attr Read and Write IIO Debug attributes .TP -.B \-S, \-\-Scan -Scan for available IIO contexts, optional arg of specific backend(s) 'ip', 'usb' or 'ip:usb'. If no argument is given, it checks all that are availble. +.B \-S, \-\-scan +Scan for available IIO contexts, optional arg of specific backend(s) 'ip', 'usb' or 'ip,usb'. +Specific options for USB include Vendor ID, Product ID to limit scanning to specific devices 'usb=0456:b673'. +vid,pid are hexadecimal numbers (no prefix needed), "*" (match any for pid only) +If no argument is given, it checks all that are availble. .TP .B \-h, \-\-help Tells diff --git a/man/iio_info.1.in b/man/iio_info.1.in index 1d5a88aed..9fb15aedc 100644 --- a/man/iio_info.1.in +++ b/man/iio_info.1.in @@ -79,7 +79,10 @@ with no address part .RE .TP .B \-S, \-\-scan -Scan for available backends +Scan for available IIO contexts, optional arg of specific backend(s) 'ip', 'usb' or 'ip,usb'. +Specific options for USB include Vendor ID, Product ID to limit scanning to specific devices 'usb=0456:b673'. +vid,pid are hexadecimal numbers (no prefix needed), "*" (match any for pid only) +If no argument is given, it checks all that are availble. .TP .B \-a, \-\-auto Scan for available contexts and if only one is available use it. diff --git a/man/iio_readdev.1.in b/man/iio_readdev.1.in index 862d7f531..6d0f0c267 100644 --- a/man/iio_readdev.1.in +++ b/man/iio_readdev.1.in @@ -76,7 +76,12 @@ Buffer timeout in milliseconds. 0 = no timeout. Default is 0. .TP .B \-a, \-\-auto Scan for available contexts and if only one is available use it. - +.TP +.B \-S, \-\-scan +Scan for available IIO contexts, optional arg of specific backend(s) 'ip', 'usb' or 'ip,usb'. +Specific options for USB include Vendor ID, Product ID to limit scanning to specific devices 'usb=0456:b673'. +vid,pid are hexadecimal numbers (no prefix needed), "*" (match any for pid only) +If no argument is given, it checks all that are availble. .SH RETURN VALUE If the specified device is not found, a non-zero exit code is returned. diff --git a/man/iio_writedev.1.in b/man/iio_writedev.1.in index 83d8e85b0..723d5b6e0 100644 --- a/man/iio_writedev.1.in +++ b/man/iio_writedev.1.in @@ -60,6 +60,12 @@ normally returned from .IP serial:[port] .IP local with no address part +.TP +.B \-S, \-\-scan +Scan for available IIO contexts, optional arg of specific backend(s) 'ip', 'usb' or 'ip,usb'. +Specific options for USB include Vendor ID, Product ID to limit scanning to specific devices 'usb=0456:b673'. +vid,pid are hexadecimal numbers (no prefix needed), "*" (match any for pid only) +If no argument is given, it checks all that are availble. .RE .TP .B \-t \-\-trigger diff --git a/tests/iio_adi_xflow_check.c b/tests/iio_adi_xflow_check.c index 0b05cb9b1..193f77dc8 100644 --- a/tests/iio_adi_xflow_check.c +++ b/tests/iio_adi_xflow_check.c @@ -168,6 +168,7 @@ int main(int argc, char **argv) char unit; int ret; struct option *opts; + bool do_scan = false; argw = dup_argv(MY_NAME, argc, argv); @@ -188,6 +189,8 @@ int main(int argc, char **argv) case 'T': break; case 'S': + do_scan = true; + /* FALLTHROUGH */ case 'a': if (!optarg && argc > optind && argv[optind] != NULL && argv[optind][0] != '-') @@ -215,6 +218,9 @@ int main(int argc, char **argv) } free(opts); + if (do_scan) + return EXIT_SUCCESS; + if (optind + 1 != argc) { fprintf(stderr, "Incorrect number of arguments.\n\n"); usage(MY_NAME, options, options_descriptions); diff --git a/tests/iio_reg.c b/tests/iio_reg.c index 04bb27e4a..c7e1e3802 100644 --- a/tests/iio_reg.c +++ b/tests/iio_reg.c @@ -82,6 +82,7 @@ int main(int argc, char **argv) int c; char * name; struct option *opts; + bool do_scan = false; argw = dup_argv(MY_NAME, argc, argv); @@ -102,6 +103,8 @@ int main(int argc, char **argv) case 'T': break; case 'S': + do_scan = true; + /* FALLTHRU */ case 'a': if (!optarg && argc > optind && argv[optind] != NULL && argv[optind][0] != '-') @@ -114,6 +117,9 @@ int main(int argc, char **argv) } free(opts); + if (do_scan) + return EXIT_SUCCESS; + if ((argc - optind) < 2 || (argc - optind) > 3) { usage(MY_NAME, options, options_descriptions); return EXIT_SUCCESS;