summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
Diffstat (limited to 'hw')
-rw-r--r--hw/sdr.c19
-rw-r--r--hw/sdr.h6
2 files changed, 21 insertions, 4 deletions
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
diff --git a/hw/sdr.h b/hw/sdr.h
index 5a83e8e..ce4ef70 100644
--- a/hw/sdr.h
+++ b/hw/sdr.h
@@ -66,7 +66,7 @@ int sdr_open_device( sdr_t *sdr, int dev_index );
//get device structure from sdr manager
-dongle_t* sdr_get_device( sdr_t *sdr, int dev_index);
+dongle_t* sdr_get_device_id( sdr_t *sdr, int dev_index);
//get index in list of devices of structure from outer device index
//? do we need?
@@ -91,9 +91,9 @@ int dongle_set_agc( dongle_t *dongle, int mode);
int dongle_set_sample_rate( dongle_t *dongle, uint32_t rate );
uint32_t dongle_get_freq( dongle_t *dongle );
-int dongle_get_gain( dongle_t *dongle );
+int dongle_get_gain( dongle_t *dongle );
uint32_t dongle_get_sample_rate( dongle_t *dongle );
-int dongle_read_samples( dongle_t *dongle, uint8_t *buf, int len );
+int dongle_read_samples( dongle_t *dongle, uint8_t *buf, int len );
//int dongle_close();
#endif \ No newline at end of file