commit-gnuradio
[Top][All Lists]
Advanced

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

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


From: gnychis
Subject: [Commit-gnuradio] r6248 - gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband
Date: Fri, 31 Aug 2007 22:35:18 -0600 (MDT)

Author: gnychis
Date: 2007-08-31 22:35:18 -0600 (Fri, 31 Aug 2007)
New Revision: 6248

Modified:
   
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/qa_inband_usrp_server.cc
   
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_channel.h
   
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_rx.h
   
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.cc
   
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.h
Log:
Adding in new error symbols and removing old error codes, as symbols are easier
to read the codes.  Fixed the QA code to now check for these symbols at the
appropriate points.


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-09-01 04:20:49 UTC (rev 6247)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/qa_inband_usrp_server.cc
   2007-09-01 04:35:18 UTC (rev 6248)
@@ -139,7 +139,7 @@
   
   // should not be able to allocate max capacity after 100 bytes were allocated
   d_tx->send(s_cmd_allocate_channel, 
-             pmt_list2(pmt_from_long(usrp_server::RQSTD_CAPACITY_UNAVAIL), 
+             pmt_list2(s_err_requested_capacity_unavailable, 
                        pmt_from_long(d_max_capacity)));  
   
   // keep allocating a little more until all of the channels are used and test
@@ -156,14 +156,14 @@
 
   // No more channels after allocating all of them is expected
   d_tx->send(s_cmd_allocate_channel, 
-             pmt_list2(pmt_from_long(usrp_server::CHANNEL_UNAVAIL), 
+             pmt_list2(s_err_channel_unavailable, 
                        pmt_from_long(1)));
 
   // test out the same on the RX side
   d_rx->send(s_cmd_allocate_channel, pmt_list2(PMT_T, pmt_from_long(1)));
 
   d_rx->send(s_cmd_allocate_channel, 
-             pmt_list2(pmt_from_long(usrp_server::RQSTD_CAPACITY_UNAVAIL), 
+             pmt_list2(s_err_requested_capacity_unavailable, 
                        pmt_from_long(d_max_capacity)));  
 
   for(int i=1; i < d_nrx_chan; i++) {
@@ -174,7 +174,7 @@
   }
 
   d_rx->send(s_cmd_allocate_channel, 
-             pmt_list2(pmt_from_long(usrp_server::CHANNEL_UNAVAIL), 
+             pmt_list2(s_err_channel_unavailable, 
              pmt_from_long(1)));
 
   // when all is said and done, there should be d_ntx_chan+d_ntx_chan bytes
@@ -403,7 +403,7 @@
 
     d_tx->send(s_cmd_deallocate_channel, 
                pmt_list2(pmt_list2(s_response_deallocate_channel,
-                             pmt_from_long(usrp_server::PERMISSION_DENIED)), 
+                             s_err_channel_permission_denied), 
                          pmt_from_long(d_tx_chans[i])));
 
     d_ndealloc_to_recv++;
@@ -414,7 +414,7 @@
 
     d_rx->send(s_cmd_deallocate_channel, 
                pmt_list2(pmt_list2(s_response_deallocate_channel,
-                             pmt_from_long(usrp_server::PERMISSION_DENIED)), 
+                             s_err_channel_permission_denied), 
                          pmt_from_long(d_rx_chans[i])));
   
     d_ndealloc_to_recv++;
@@ -426,12 +426,12 @@
   d_ndealloc_to_recv+=2;
   d_tx->send(s_cmd_deallocate_channel, 
              pmt_list2(pmt_list2(s_response_deallocate_channel,
-                                 pmt_from_long(usrp_server::CHANNEL_INVALID)), 
+                                 s_err_channel_invalid), 
                        pmt_from_long(d_rx_chans.back()+1)));
 
   d_rx->send(s_cmd_deallocate_channel, 
              pmt_list2(pmt_list2(s_response_deallocate_channel,
-                                 pmt_from_long(usrp_server::CHANNEL_INVALID)), 
+                                 s_err_channel_invalid), 
                        pmt_from_long(d_rx_chans.back()+1)));
 
 
@@ -762,7 +762,7 @@
   // Try to transmit on a channel that we have no allocation for
   d_tx->send(s_cmd_xmit_raw_frame, 
              pmt_list4(pmt_list2(s_response_xmit_raw_frame,
-                                 
pmt_from_long(usrp_server::PERMISSION_DENIED)), 
+                                 s_err_channel_permission_denied), 
                        pmt_from_long(0), 
                        pmt_make_u32vector(transport_pkt::max_payload()/4, 0), 
                        pmt_from_long(0)));
@@ -797,7 +797,7 @@
 
   d_tx->send(s_cmd_xmit_raw_frame, 
              pmt_list4(pmt_list2(s_response_xmit_raw_frame,
-                                 
pmt_from_long(usrp_server::PERMISSION_DENIED)), 
+                                 s_err_channel_permission_denied), 
                        pmt_from_long(0), 
                        pmt_make_u32vector(transport_pkt::max_payload()/4, 0), 
                        pmt_from_long(0)));

Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_channel.h
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_channel.h
     2007-09-01 04:20:49 UTC (rev 6247)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_channel.h
     2007-09-01 04:35:18 UTC (rev 6248)
@@ -31,4 +31,10 @@
 static pmt_t s_response_allocate_channel = 
pmt_intern("response-allocate-channel");
 static pmt_t s_response_deallocate_channel = 
pmt_intern("response-deallocate-channel");
 
+// Errors
+static pmt_t s_err_requested_capacity_unavailable = 
pmt_intern("err-requested-capacity-unavailable");
+static pmt_t s_err_channel_unavailable = pmt_intern("err-channel-unavailable");
+static pmt_t s_err_channel_invalid = pmt_intern("err-channel-invalid");
+static pmt_t s_err_channel_permission_denied = 
pmt_intern("err-channel-permission-denied");
+
 #endif /* INCLUDED_SYMBOLS_USRP_CHANNEL_H */

Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_rx.h
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_rx.h
  2007-09-01 04:20:49 UTC (rev 6247)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/symbols_usrp_rx.h
  2007-09-01 04:35:18 UTC (rev 6248)
@@ -30,4 +30,7 @@
 // Incoming
 static pmt_t s_response_recv_raw_samples = 
pmt_intern("response-recv-raw-samples");
 
+// Errors
+static pmt_t s_err_already_receiving = pmt_intern("err-already-receiving");
+
 #endif /* INCLUDED_SYMBOLS_USRP_RX_H */

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-09-01 04:20:49 UTC (rev 6247)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.cc 
    2007-09-01 04:35:18 UTC (rev 6248)
@@ -514,7 +514,7 @@
     // no capacity available
     port->send(s_response_allocate_channel, 
                pmt_list3(invocation_handle, 
-                         pmt_from_long(RQSTD_CAPACITY_UNAVAIL), 
+                         s_err_requested_capacity_unavailable, 
                          PMT_NIL));
     return;
   }
@@ -553,7 +553,7 @@
   // no free TX chan found
   port->send(s_response_allocate_channel, 
              pmt_list3(invocation_handle, 
-                       pmt_from_long(CHANNEL_UNAVAIL), 
+                       s_err_channel_unavailable, 
                        PMT_NIL));
   return;
 }
@@ -977,7 +977,7 @@
   if(d_rx_chan_mask & (1 << channel)) {
     port->send(s_response_recv_raw_samples,
                pmt_list5(invocation_handle,
-                         pmt_from_long(ALREADY_RECV),
+                         s_err_already_receiving,
                          PMT_NIL,
                          PMT_NIL,
                          PMT_NIL));
@@ -1310,7 +1310,7 @@
   if(channel >= (long)chan_info.size() && channel != 0x1f) {
     port->send(response_signal, 
                pmt_list2(invocation_handle, 
-                         pmt_from_long(CHANNEL_INVALID)));
+                         s_err_channel_invalid));
 
     if(verbose)
       std::cout << "[USRP_SERVER] Invalid channel number for event " 
@@ -1322,7 +1322,7 @@
   if(chan_info[channel].owner != port->port_symbol()) {
     port->send(response_signal, 
                pmt_list2(invocation_handle, 
-                         pmt_from_long(PERMISSION_DENIED)));
+                         s_err_channel_permission_denied));
     
     if(verbose)
       std::cout << "[USRP_SERVER] Invalid permissions"

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-09-01 04:20:49 UTC (rev 6247)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.h  
    2007-09-01 04:35:18 UTC (rev 6248)
@@ -35,13 +35,6 @@
 class usrp_server : public mb_mblock
 {
 public:
-  enum error_codes {
-    RQSTD_CAPACITY_UNAVAIL = 0,
-    CHANNEL_UNAVAIL = 1,
-    CHANNEL_INVALID = 2,
-    PERMISSION_DENIED = 3,
-    ALREADY_RECV = 4
-  };
 
   // our ports
   enum port_types {





reply via email to

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