commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r5678 - gnuradio/branches/developers/gnychis/inband/us


From: gnychis
Subject: [Commit-gnuradio] r5678 - gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband
Date: Mon, 4 Jun 2007 22:19:25 -0600 (MDT)

Author: gnychis
Date: 2007-06-04 22:19:24 -0600 (Mon, 04 Jun 2007)
New Revision: 5678

Modified:
   
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/qa_inband_usrp_server.cc
   
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/qa_inband_usrp_server.h
   
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_interface.mbh
   gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_rx.cc
   
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.cc
   
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.h
   
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_usb_interface.cc
Log:
Tested read on hardware such that there are no errors and that the received 
packets get passed back up to the application.

The data being correct has not been tested yet.

A fake RX side is implemented in usrp_server which assumes all data is samples 
and that the appropriate receiver is rx[0].


Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/qa_inband_usrp_server.cc
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/qa_inband_usrp_server.cc
   2007-06-05 03:55:45 UTC (rev 5677)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/qa_inband_usrp_server.cc
   2007-06-05 04:19:24 UTC (rev 5678)
@@ -38,27 +38,32 @@
 
 typedef usrp_inband_usb_packet transport_pkt;   // makes conversion to gigabit 
easy
 
+static pmt_t s_cmd_allocate_channel = pmt_intern("cmd-allocate-channel");
+static pmt_t s_cmd_close = pmt_intern("cmd-close");
+static pmt_t s_cmd_deallocate_channel = pmt_intern("cmd-deallocate-channel");
 static pmt_t s_cmd_open = pmt_intern("cmd-open");
-static pmt_t s_response_open = pmt_intern("response-open");
-static pmt_t s_cmd_close = pmt_intern("cmd-close");
+static pmt_t s_cmd_start_recv_raw_samples = 
pmt_intern("cmd-start-recv-raw-samples");
+static pmt_t s_cmd_stop_recv_raw_samples = 
pmt_intern("cmd-stop-recv-raw-samples");
+static pmt_t s_cmd_to_control_channel = pmt_intern("cmd-to-control-channel");
+static pmt_t s_cmd_xmit_raw_frame  = pmt_intern("cmd-xmit-raw-frame");
+static pmt_t s_cmd_max_capacity  = pmt_intern("cmd-max-capacity");
+static pmt_t s_cmd_ntx_chan  = pmt_intern("cmd-ntx-chan");
+static pmt_t s_cmd_nrx_chan  = pmt_intern("cmd-nrx-chan");
+static pmt_t s_cmd_current_capacity_allocation  = 
pmt_intern("cmd-current-capacity-allocation");
+static pmt_t s_response_allocate_channel = 
pmt_intern("response-allocate-channel");
 static pmt_t s_response_close = pmt_intern("response-close");
-static pmt_t s_cmd_allocate_channel = pmt_intern("cmd-allocate-channel");
-static pmt_t s_response_allocate_channel = 
pmt_intern("response-allocate-channel");
-static pmt_t s_send_allocate_channel = pmt_intern("send-allocate-channel");
-static pmt_t s_cmd_deallocate_channel = pmt_intern("cmd-deallocate-channel");
 static pmt_t s_response_deallocate_channel = 
pmt_intern("response-deallocate-channel");
-static pmt_t s_send_deallocate_channel = pmt_intern("send-deallocate-channel");
-static pmt_t s_cmd_max_capacity = pmt_intern("cmd-max-capacity");
+static pmt_t s_response_from_control_channel = 
pmt_intern("response-from-control-channel");
+static pmt_t s_response_open = pmt_intern("response-open");
+static pmt_t s_response_recv_raw_samples = 
pmt_intern("response-recv-raw-samples");
+static pmt_t s_response_xmit_raw_frame = pmt_intern("response-xmit-raw-frame");
 static pmt_t s_response_max_capacity = pmt_intern("response-max-capacity");
-static pmt_t s_cmd_ntx_chan  = pmt_intern("cmd-ntx-chan");
-static pmt_t s_cmd_nrx_chan  = pmt_intern("cmd-nrx-chan");
 static pmt_t s_response_ntx_chan = pmt_intern("response-ntx-chan");
 static pmt_t s_response_nrx_chan = pmt_intern("response-nrx-chan");
-static pmt_t s_cmd_current_capacity_allocation  = 
pmt_intern("cmd-current-capacity-allocation");
 static pmt_t s_response_current_capacity_allocation  = 
pmt_intern("response-current-capacity-allocation");
-static pmt_t s_cmd_xmit_raw_frame  = pmt_intern("cmd-xmit-raw-frame");
-static pmt_t s_response_xmit_raw_frame = pmt_intern("response-xmit-raw-frame");
 
+static bool verbose = false;
+
 // 
----------------------------------------------------------------------------------------------
 
 class qa_alloc_top : public mb_mblock
@@ -640,7 +645,8 @@
 void
 qa_tx_top::run_tests()
 {
-  // std::cout << "[qa_tx_top] Starting tests\n";
+  if(verbose)
+   std::cout << "[qa_tx_top] Starting tests\n";
 
   // A transmit before an open should fail
   d_tx->send(s_cmd_xmit_raw_frame, 
pmt_list4(pmt_list2(s_response_xmit_raw_frame,PMT_F), pmt_from_long(0), 
pmt_make_u32vector(transport_pkt::max_payload()/4, 0), pmt_from_long(0)));
@@ -799,7 +805,219 @@
 
 REGISTER_MBLOCK_CLASS(qa_tx_top);
 
+// 
----------------------------------------------------------------------------------------------
 
+class qa_rx_top : public mb_mblock
+{
+  mb_port_sptr d_tx;
+  mb_port_sptr d_rx;
+  mb_port_sptr d_cs;
+  
+  long d_max_capacity;
+  long d_ntx_chan, d_nrx_chan;
+
+  long d_tx_chan;
+  long d_rx_chan;
+
+  long d_nmsg_to_recv;
+  long d_nmsg_recvd;
+
+ public:
+  qa_rx_top(mb_runtime *runtime, const std::string &instance_name, pmt_t 
user_arg);
+  ~qa_rx_top();
+  void initial_transition();
+  void handle_message(mb_message_sptr msg);
+
+ protected:
+  void check_allocation(mb_message_sptr msg);
+  void check_deallocation(mb_message_sptr msg);
+  void check_xmit(mb_message_sptr msg);
+  void check_cs(mb_message_sptr msg);
+  void run_tests();
+};
+
+qa_rx_top::qa_rx_top(mb_runtime *runtime, const std::string &instance_name, 
pmt_t user_arg)
+  : mb_mblock(runtime, instance_name, user_arg)
+{ 
+
+  d_nmsg_to_recv=12;
+  d_nmsg_recvd=0;
+  
+  d_rx = define_port("rx0", "usrp-rx", false, mb_port::INTERNAL);
+  d_tx = define_port("tx0", "usrp-tx", false, mb_port::INTERNAL);
+  d_cs = define_port("cs", "usrp-server-cs", false, mb_port::INTERNAL);
+
+  // Use the stub with the usrp_server
+  pmt_t usrp_server_dict = pmt_make_dict();
+  //pmt_dict_set(usrp_server_dict, pmt_intern("usrp-interface"), 
pmt_intern("usrp_usb_interface_stub"));
+  pmt_dict_set(usrp_server_dict, pmt_intern("usrp-interface"), 
pmt_intern("usrp_usb_interface"));  // FIXME
+
+  // Test the TX side
+  define_component("server", "usrp_server", usrp_server_dict);
+  connect("self", "tx0", "server", "tx0");
+  connect("self", "rx0", "server", "rx0");
+  connect("self", "cs", "server", "cs");
+}
+
+qa_rx_top::~qa_rx_top(){}
+
+void
+qa_rx_top::initial_transition()
+{
+  run_tests();
+}
+
+void
+qa_rx_top::run_tests()
+{
+  if(verbose)
+    std::cout << "[qa_rx_top] Starting tests\n";
+
+  d_cs->send(s_cmd_open, pmt_list2(pmt_list2(s_response_open,PMT_T), 
pmt_from_long(0)));
+
+  // Try to transmit on a channel that we have no allocation for
+  d_rx->send(s_cmd_allocate_channel, 
+             pmt_list2(pmt_list2(s_response_allocate_channel,PMT_T), 
+             pmt_from_long(1)));
+
+  d_rx->send(s_cmd_start_recv_raw_samples, 
+             pmt_list2(PMT_NIL, 
+                       pmt_from_long(0)));
+
+
+  // A final close which should be successful
+//  d_cs->send(s_cmd_close, pmt_list1(pmt_list2(s_response_close,PMT_T)));
+  
+}
+
+
+void
+qa_rx_top::handle_message(mb_message_sptr msg)
+{
+  pmt_t data = msg->data();
+
+  if (pmt_eq(msg->port_id(), d_tx->port_symbol())
+       || pmt_eq(msg->port_id(), d_rx->port_symbol())) {
+    
+    if(pmt_eq(msg->signal(), s_response_allocate_channel)) 
+      check_allocation(msg);
+    
+    if(pmt_eq(msg->signal(), s_response_xmit_raw_frame)) 
+      check_xmit(msg);
+  }
+  
+  if (pmt_eq(msg->port_id(), d_cs->port_symbol())) {
+      check_cs(msg);
+  }
+
+  d_nmsg_recvd++;
+
+  if(d_nmsg_to_recv == d_nmsg_recvd){
+    shutdown_all(PMT_T);
+    return;
+  }
+}
+
+void
+qa_rx_top::check_deallocation(mb_message_sptr msg)
+{
+  pmt_t data = msg->data();
+  pmt_t event = msg->signal();
+
+  pmt_t expected = pmt_nth(0, data);
+  pmt_t status = pmt_nth(1, data);
+
+  pmt_t e_event = pmt_nth(0, expected);
+  pmt_t e_status = pmt_nth(1, expected);
+
+  if(!pmt_eqv(e_status, status) || !pmt_eqv(e_event, event)) {
+    // std::cout << "[qa_rx_top] FAILED check_deallocation... Got: " << result 
<< " Expected: " << expected_result << "\n";
+    shutdown_all(PMT_F);
+    return;
+  } else {
+    // std::cout << "[qa_rx_top] Received expected deallocation response for 
message\n";
+  }
+}
+
+void
+qa_rx_top::check_allocation(mb_message_sptr msg)
+{
+  pmt_t data = msg->data();
+  pmt_t event = msg->signal();
+
+  pmt_t expected = pmt_nth(0, data);
+  pmt_t status = pmt_nth(1, data);
+  pmt_t channel = pmt_nth(2, data);
+
+  pmt_t e_event = pmt_nth(0, expected);
+  pmt_t e_status = pmt_nth(1, expected);
+  
+  if(!pmt_eqv(e_status, status) || !pmt_eqv(e_event, event)) {
+    // std::cout << "[qa_rx_top] FAILED check_allocation... Got: " << result 
<< " Expected: " << expected_result << " for event " << msg->signal() << ")\n";
+    shutdown_all(PMT_F);
+    return;
+  } else {
+    // std::cout << "[qa_rx_top] Received expected allocation response for 
message\n";
+  }
+  
+  if(pmt_eqv(status, PMT_T)) {
+    // store all of the allocate channel numbers
+    if(pmt_eq(msg->port_id(), d_tx->port_symbol()))
+      d_tx_chan = pmt_to_long(channel);
+    if(pmt_eq(msg->port_id(), d_rx->port_symbol()))
+      d_rx_chan = pmt_to_long(channel);
+  }
+}
+
+void
+qa_rx_top::check_xmit(mb_message_sptr msg)
+{
+  pmt_t data = msg->data();
+  pmt_t event = msg->signal();
+
+  pmt_t expected = pmt_nth(0, data);
+  pmt_t status = pmt_nth(1, data);
+
+  pmt_t e_event = pmt_nth(0, expected);
+  pmt_t e_status = pmt_nth(1, expected);
+
+  if(!pmt_eqv(e_status, status) || !pmt_eqv(e_event, event)) {
+    //std::cout << "[qa_rx_top] FAILED check_xmit... Got: " << result
+    // << " Expected: " << expected_result
+    // << " for event " << msg->signal() << ")\n";
+    shutdown_all(PMT_F);
+    return;
+  } else {
+    // std::cout << "[qa_rx_top] Received expected xmit response for 
message\n";
+  }
+}
+
+void
+qa_rx_top::check_cs(mb_message_sptr msg)
+{
+  pmt_t data = msg->data();
+  pmt_t event = msg->signal();
+
+  pmt_t expected = pmt_nth(0, data);
+  pmt_t status = pmt_nth(1, data);
+  
+  pmt_t e_event = pmt_nth(0, expected);
+  pmt_t e_status = pmt_nth(1, expected);
+
+  if(!pmt_eqv(e_status, status) || !pmt_eqv(e_event, event)) {
+    // std::cout << "[qa_rx_top] FAILED check_cs... Got: " << result << " 
Expected: " << expected_result << " for event " << msg->signal() << "\n";
+    shutdown_all(PMT_F);
+    return;
+  } else {
+    // std::cout << "[qa_rx_top] Received expected CS response for message ("
+    // << msg->signal() << ")\n";
+  }
+
+}
+
+REGISTER_MBLOCK_CLASS(qa_rx_top);
+
+
 // 
----------------------------------------------------------------------------------------------
 
 void 
@@ -857,3 +1075,17 @@
   
   CPPUNIT_ASSERT(pmt_equal(PMT_T, result));
 }
+
+void
+qa_inband_usrp_server::test_rx()
+{
+  mb_runtime_sptr rt = mb_make_runtime();
+  pmt_t result = PMT_T;
+
+  // std::cout << "\n\n-----------------\n";
+  // std::cout << "  RUNNING RX TESTS  \n";
+
+  rt->run("top", "qa_rx_top", PMT_F, &result);
+  
+  CPPUNIT_ASSERT(pmt_equal(PMT_T, result));
+}

Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/qa_inband_usrp_server.h
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/qa_inband_usrp_server.h
    2007-06-05 03:55:45 UTC (rev 5677)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/qa_inband_usrp_server.h
    2007-06-05 04:19:24 UTC (rev 5678)
@@ -32,6 +32,7 @@
   CPPUNIT_TEST(test_chan_allocation);
   CPPUNIT_TEST(test_chan_deallocation);
   CPPUNIT_TEST(test_tx);
+//  CPPUNIT_TEST(test_rx);
   CPPUNIT_TEST_SUITE_END();
 
  private:
@@ -39,6 +40,7 @@
   void test_chan_deallocation();
   void test_open_close();
   void test_tx();
+  void test_rx();
 };
 
 #endif /* INCLUDED_QA_INBAND_USRP_SERVER_H */

Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_interface.mbh
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_interface.mbh
 2007-06-05 03:55:45 UTC (rev 5677)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_interface.mbh
 2007-06-05 04:19:24 UTC (rev 5678)
@@ -48,7 +48,7 @@
    (response-usrp-ntx-chan invocation-handle ntx-chan)
    (response-usrp-nrx-chan invocation-handle nrx-chan)
    (response-usrp-write invocation-handle channel status)
-   (response-usrp-read invocation-handle channel)
+   (response-usrp-read invocation-handle status data)
    )
   )
 

Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_rx.cc
===================================================================
--- gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_rx.cc 
2007-06-05 03:55:45 UTC (rev 5677)
+++ gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_rx.cc 
2007-06-05 04:19:24 UTC (rev 5678)
@@ -35,7 +35,7 @@
 
 typedef usrp_inband_usb_packet transport_pkt;
 
-static const bool verbose = true;
+static const bool verbose = false;
 
 static pmt_t s_cmd_usrp_rx_start_reading = 
pmt_intern("cmd-usrp-rx-start-reading");
 static pmt_t s_response_usrp_rx_read = pmt_intern("response-usrp-rx-read");

Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.cc
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.cc 
    2007-06-05 03:55:45 UTC (rev 5677)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.cc 
    2007-06-05 04:19:24 UTC (rev 5678)
@@ -75,6 +75,7 @@
 static pmt_t s_response_usrp_open = pmt_intern("response-usrp-open");
 static pmt_t s_response_usrp_close = pmt_intern("response-usrp-close");
 static pmt_t s_response_usrp_write = pmt_intern("response-usrp-write");
+static pmt_t s_response_usrp_read = pmt_intern("response-usrp-read");
 
 
 const static bool verbose = false;
@@ -88,7 +89,8 @@
 }
 
 usrp_server::usrp_server(mb_runtime *rt, const std::string &instance_name, 
pmt_t user_arg)
-  : mb_mblock(rt, instance_name, user_arg)
+  : mb_mblock(rt, instance_name, user_arg),
+  d_fake_rx(false)
 {
 
   // Default USRP interface
@@ -141,7 +143,8 @@
   // Initialize capacity on each channel to 0 and to no owner
   // Also initialize the USRP standard tx/rx pointers to NULL
   reset_channels();
-  
+ 
+  d_fake_rx=true;
 }
 
 void
@@ -243,7 +246,21 @@
                        pmt_list2(invocation_handle, status));
       return;
     }
+    //--------------- USRP READ ---------------//
+    else if (pmt_eq(event, s_response_usrp_read)) {
 
+      pmt_t status = pmt_nth(1, data);
+
+      if(!pmt_eqv(status, PMT_T)) {
+        std::cerr << "[USRP_SERVER] Error receiving packet\n";
+        return;
+      }
+      else {
+        handle_response_usrp_read(data);
+        return;
+      }
+    }
+
     goto unhandled;
   }
 
@@ -761,23 +778,51 @@
     return;
   }
 
-  // This channel is now receiving and we alert the low level code
-  // to start replying with samples
-  d_rx_chan_mask |= 1<<channel;
-  
   // We only need to generate a 'start reading' command down to the
   // low level interface if no other channel is already reading
   //
   // We carry this over the CS interface because the lower level
   // interface does not care about the channel, we only demux it
   // at the usrp_server on responses.
-  if(d_rx_chan_mask == 0)
-    d_cs->send(s_cmd_usrp_start_reading, pmt_list1(invocation_handle));
+  if(d_rx_chan_mask == 0) {
+    if(verbose)
+      std::cout << "[USRP_SERVER] Sending read request down\n";
+    d_cs_usrp->send(s_cmd_usrp_start_reading, pmt_list1(invocation_handle));
+  }
+
+  // This channel is now receiving and we alert the low level code
+  // to start replying with samples
+  d_rx_chan_mask |= 1<<channel;
   
   return;
 }
 
+// Read the packet header, determine the port by the channel owner
 void
+usrp_server::handle_response_usrp_read(pmt_t data)
+{
+  size_t n_bytes;
+
+  if(verbose)
+    std::cout << "[USRP_SERVER] Received raw samples\n";
+
+  if (d_fake_rx) {
+
+    pmt_t pkt = pmt_nth(2, data);
+
+    d_rx[0]->send(s_response_recv_raw_samples,
+                  pmt_list5(PMT_NIL,
+                            PMT_T,
+                            pkt,
+                            pmt_from_long(0xffff),
+                            PMT_NIL));
+
+    return;
+  }
+
+}
+
+void
 usrp_server::recall_defer_queue()
 {
 

Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.h
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.h  
    2007-06-05 03:55:45 UTC (rev 5677)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.h  
    2007-06-05 04:19:24 UTC (rev 5678)
@@ -24,6 +24,7 @@
 #include <mb_mblock.h>
 #include <vector>
 #include <queue>
+#include <fstream>
 
 /*!
  * \brief Implements the lowest-level mblock usb_interface to the USRP
@@ -70,6 +71,8 @@
   bool d_defer;
   bool d_opened;
 
+  bool d_fake_rx;
+
 public:
   usrp_server(mb_runtime *rt, const std::string &instance_name, pmt_t 
user_arg);
   ~usrp_server();
@@ -90,6 +93,7 @@
   long current_capacity_allocation();
   void recall_defer_queue();
   void reset_channels();
+  void handle_response_usrp_read(pmt_t data);
 };
 
 #endif /* INCLUDED_USRP_SERVER_H */

Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_usb_interface.cc
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_usb_interface.cc
      2007-06-05 03:55:45 UTC (rev 5677)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_usb_interface.cc
      2007-06-05 04:19:24 UTC (rev 5678)
@@ -46,12 +46,13 @@
 static pmt_t s_response_usrp_open = pmt_intern("response-usrp-open");
 static pmt_t s_response_usrp_close = pmt_intern("response-usrp-close");
 static pmt_t s_response_usrp_write = pmt_intern("response-usrp-write");
+static pmt_t s_response_usrp_read = pmt_intern("response-usrp-read");
 
 // TX and RX signals
 static pmt_t s_cmd_usrp_rx_start_reading = 
pmt_intern("cmd-usrp-rx-start-reading");
 static pmt_t s_response_usrp_rx_read = pmt_intern("response-usrp-rx-read");
 
-static const bool verbose = true;
+static const bool verbose = false;
 
 // need to take number of TX and RX channels as parameter
 usrp_usb_interface::usrp_usb_interface(mb_runtime *rt, const std::string 
&instance_name, pmt_t user_arg)
@@ -62,8 +63,8 @@
   d_rx_cs = define_port("rx_cs", "usrp-rx-cs", false, mb_port::INTERNAL);      
 
   // Connect to TX and RX
-  define_component("rx", "usrp-rx", PMT_F);
-  connect("self", "rx_cs", "usrp_rx", "cs");
+  define_component("rx", "usrp_rx", PMT_F);
+  connect("self", "rx_cs", "rx", "cs");
   
   // FIX ME: the code should query the FPGA to retrieve the number of channels 
and such
   d_ntx_chan = 2;
@@ -111,13 +112,17 @@
     //---------- NTX CHAN ----------//
     else if (pmt_eq(event, s_cmd_usrp_ntx_chan)) {
       invocation_handle = pmt_nth(0, data);
-      d_cs->send(s_response_usrp_ntx_chan, pmt_list2(invocation_handle, 
pmt_from_long(d_ntx_chan)));
+      d_cs->send(s_response_usrp_ntx_chan, 
+                 pmt_list2(invocation_handle, 
+                           pmt_from_long(d_ntx_chan)));
       return;
     }
     //---------- NRX CHAN ----------//
     else if (pmt_eq(event, s_cmd_usrp_nrx_chan)) {
       invocation_handle = pmt_nth(0, data);
-      d_cs->send(s_response_usrp_nrx_chan, pmt_list2(invocation_handle, 
pmt_from_long(d_nrx_chan)));
+      d_cs->send(s_response_usrp_nrx_chan, 
+                 pmt_list2(invocation_handle, 
+                           pmt_from_long(d_nrx_chan)));
       return;
     }
     //------------ WRITE -----------//
@@ -134,6 +139,21 @@
     goto unhandled;
   }
 
+  //---------------- RX ------------------//
+  if (pmt_eq(port_id, d_rx_cs->port_symbol())) {       
+
+    // Relay reads back up
+    if(pmt_eq(event, s_response_usrp_rx_read))  {
+      d_cs->send(s_response_usrp_read,
+                 pmt_list3(PMT_NIL,
+                           PMT_T,
+                           data));
+      return;
+    }
+
+    goto unhandled;
+  }
+
  unhandled:
   std::cout << "[usrp_usb_interface] unhandled msg: " << msg << std::endl;
 }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]