summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gr-vrt/src/vrt_quadradio_source_32fc.cc20
-rw-r--r--gr-vrt/src/vrt_quadradio_source_32fc.h8
-rw-r--r--vrt/apps/simple_rx_samples.cc4
-rw-r--r--vrt/include/vrt/quadradio.h6
-rw-r--r--vrt/lib/quadradio.cc8
5 files changed, 23 insertions, 23 deletions
diff --git a/gr-vrt/src/vrt_quadradio_source_32fc.cc b/gr-vrt/src/vrt_quadradio_source_32fc.cc
index 0aac86991..03d75c78d 100644
--- a/gr-vrt/src/vrt_quadradio_source_32fc.cc
+++ b/gr-vrt/src/vrt_quadradio_source_32fc.cc
@@ -29,25 +29,29 @@
vrt_quadradio_source_32fc_sptr
vrt_make_quadradio_source_32fc(const std::string &ip,
size_t rx_bufsize,
- size_t samples_per_pkt)
+ size_t samples_per_pkt,
+ int rxdspno)
{
return gnuradio::get_initial_sptr(new vrt_quadradio_source_32fc(ip,
rx_bufsize,
- samples_per_pkt));
+ samples_per_pkt,
+ rxdspno));
}
vrt_quadradio_source_32fc::vrt_quadradio_source_32fc(const std::string &ip,
size_t rx_bufsize,
- size_t samples_per_pkt)
+ size_t samples_per_pkt,
+ int rxdspno)
: vrt_source_32fc("quadradio_source_32fc"),
- d_samples_per_pkt(samples_per_pkt == 0 ? 800 : samples_per_pkt),
- d_qr(vrt::quadradio::sptr(new vrt::quadradio(ip, rx_bufsize)))
+ d_samples_per_pkt(samples_per_pkt == 0 ? (rxdspno == 0 ? 800 : 200) : samples_per_pkt),
+ d_qr(vrt::quadradio::sptr(new vrt::quadradio(ip, rx_bufsize))),
+ d_rxdspno(rxdspno)
{
}
vrt_quadradio_source_32fc::~vrt_quadradio_source_32fc()
{
- d_qr->stop_streaming();
+ d_qr->stop_streaming(d_rxdspno);
}
vrt::rx::sptr
@@ -64,13 +68,13 @@ vrt_quadradio_source_32fc::start()
vrt_rx()->rx_packets(&nop, true);
d_checker.resync();
- return d_qr->start_streaming(d_samples_per_pkt);
+ return d_qr->start_streaming(d_rxdspno, d_samples_per_pkt);
}
bool
vrt_quadradio_source_32fc::stop()
{
- return d_qr->stop_streaming();
+ return d_qr->stop_streaming(d_rxdspno);
}
bool
diff --git a/gr-vrt/src/vrt_quadradio_source_32fc.h b/gr-vrt/src/vrt_quadradio_source_32fc.h
index 6193efa10..eaf2741c1 100644
--- a/gr-vrt/src/vrt_quadradio_source_32fc.h
+++ b/gr-vrt/src/vrt_quadradio_source_32fc.h
@@ -33,19 +33,21 @@ typedef boost::shared_ptr<vrt_quadradio_source_32fc> vrt_quadradio_source_32fc_s
vrt_quadradio_source_32fc_sptr
vrt_make_quadradio_source_32fc(const std::string &ip,
size_t rx_bufsize = 0,
- size_t samples_per_pkt = 0);
+ size_t samples_per_pkt = 0,
+ int rxdspno = 0);
class vrt_quadradio_source_32fc : public vrt_source_32fc
{
size_t d_samples_per_pkt;
boost::shared_ptr<vrt::quadradio> d_qr;
+ int d_rxdspno;
vrt_quadradio_source_32fc(const std::string &ip, size_t rx_bufsize,
- size_t samples_per_pkt);
+ size_t samples_per_pkt, int rxdspno);
friend vrt_quadradio_source_32fc_sptr
vrt_make_quadradio_source_32fc(const std::string &ip, size_t rx_bufsize,
- size_t samples_per_pkt);
+ size_t samples_per_pkt, int rxdspno);
public:
virtual ~vrt_quadradio_source_32fc();
diff --git a/vrt/apps/simple_rx_samples.cc b/vrt/apps/simple_rx_samples.cc
index 6b09afda5..08f01c9cc 100644
--- a/vrt/apps/simple_rx_samples.cc
+++ b/vrt/apps/simple_rx_samples.cc
@@ -365,7 +365,7 @@ main(int argc, char **argv)
printf("samples_per_pkt = %d\n", samples_per_pkt);
- if (!qr->start_streaming(samples_per_pkt)){
+ if (!qr->start_streaming(0, samples_per_pkt)){
fprintf(stderr, "failed to send_rx_command\n");
return 1;
}
@@ -383,7 +383,7 @@ main(int argc, char **argv)
}
}
- qr->stop_streaming();
+ qr->stop_streaming(0);
printf("%llu packets received, %llu bad pkt_cnt field values, %llu samples\n",
handler->npackets(), handler->nwrong_pkt_cnt(), handler->nsamples());
diff --git a/vrt/include/vrt/quadradio.h b/vrt/include/vrt/quadradio.h
index d30ee14f1..525a177a8 100644
--- a/vrt/include/vrt/quadradio.h
+++ b/vrt/include/vrt/quadradio.h
@@ -96,11 +96,9 @@ namespace vrt {
vrt::rx::sptr vrt_rx() const { return d_rx; }
- // FIXME add rxdspno as the first parameter
- bool start_streaming(int samples_per_pkt = 0);
+ bool start_streaming(int rxdspno, int samples_per_pkt = 0);
- // FIXME add rxdspno as the first parameter
- bool stop_streaming();
+ bool stop_streaming(int rxdspno);
/* convenience methods that ultimately write the dboard pins */
bool set_center_freq(double target_freq);
diff --git a/vrt/lib/quadradio.cc b/vrt/lib/quadradio.cc
index a8bc3e525..906f88df4 100644
--- a/vrt/lib/quadradio.cc
+++ b/vrt/lib/quadradio.cc
@@ -74,19 +74,15 @@ vrt::quadradio::open(const char *ip)
}
bool
-vrt::quadradio::start_streaming(int samples_per_pkt)
+vrt::quadradio::start_streaming(int rxdspno, int samples_per_pkt)
{
- int rxdspno = 0; // FIXME make it the first param
-
return send_rx_command(d_ctrl_fd, rxdspno, true, d_ctrl_port_inaddr,
d_data_port, samples_per_pkt);
}
bool
-vrt::quadradio::stop_streaming()
+vrt::quadradio::stop_streaming(int rxdspno)
{
- int rxdspno = 0; // FIXME make it the first param
-
return send_stop_rx_command(d_ctrl_fd, rxdspno);
}