diff options
author | FreeArtMan <=> | 2015-09-19 20:28:13 +0100 |
---|---|---|
committer | FreeArtMan <=> | 2015-09-19 20:28:13 +0100 |
commit | 8adda9187304d8f06f907bfebc93e47207fa4796 (patch) | |
tree | 4bd55c6ee2147ee60a821ad96f9895e25b49d06c /test/get_device_list.c | |
parent | 4d44686f727d65b82a7c43121b6e4290c8e3b7ec (diff) | |
download | radiola-8adda9187304d8f06f907bfebc93e47207fa4796.tar.gz radiola-8adda9187304d8f06f907bfebc93e47207fa4796.zip |
Added few rtlsdr tests. List all devices. Try to read sample.
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 |