diff options
Diffstat (limited to 'test/get_device_list.c')
-rw-r--r-- | test/get_device_list.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/get_device_list.c b/test/get_device_list.c new file mode 100644 index 0000000..f65c551 --- /dev/null +++ b/test/get_device_list.c @@ -0,0 +1,30 @@ +#include <stdio.h> +#include <stdlib.h> +#include <stdint.h> + +//rtlsdr +#include <rtl-sdr.h> + +int main( ) +{ + int i; + uint32_t dev_num; + + dev_num = rtlsdr_get_device_count(); + printf("Found %d device(s)\n", dev_num ); + + printf("List device names:\n"); + for (i=0; i<dev_num; i++) + { + char manuf[256], product[256], serial[256]; + const char *dn = rtlsdr_get_device_name( i ); + printf(" %02d. Device Name: %s\n", i, dn ); + rtlsdr_get_device_usb_strings( i, manuf, product, serial ); + printf("\\ + Manufact:%s\n\\ + Product:%s\n\\ + Serial:%s\n", manuf, product, serial ); + } + + return 0; +}
\ No newline at end of file |