From a58b75e38a7ec3ea48ccc6edcd8d8c0e135518b4 Mon Sep 17 00:00:00 2001 From: FreeArtMan Date: Fri, 9 Oct 2015 23:11:31 +0100 Subject: Moved dongle functionality to sdr_t from waterfall test examples --- hw/sdr.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'hw/sdr.c') diff --git a/hw/sdr.c b/hw/sdr.c index 13f28c2..5bdf21e 100644 --- a/hw/sdr.c +++ b/hw/sdr.c @@ -293,5 +293,22 @@ uint32_t dongle_get_sample_rate( dongle_t *dongle ) int dongle_read_samples( dongle_t *dongle, uint8_t *buf, int len ) { - return -1; + int ret, read_num; + + if ( dongle == NULL ) + return -1; + + if ( dongle->dev == NULL ) + return -1; + + + + ret = hw_read_sync( dongle->dev, buf, len, &read_num ); + if ( ret < 0 ) + { + printf("Couldnt read samples\n"); + return -1; + } + + return 0; } \ No newline at end of file -- cgit v1.2.3