commit-gnuradio
[Top][All Lists]
Advanced

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

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


From: gnychis
Subject: [Commit-gnuradio] r5718 - gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband
Date: Wed, 6 Jun 2007 16:45:53 -0600 (MDT)

Author: gnychis
Date: 2007-06-06 16:45:52 -0600 (Wed, 06 Jun 2007)
New Revision: 5718

Modified:
   
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/qa_inband_usrp_server.cc
Log:
Cleaned up open and close QA code


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-06 22:41:29 UTC (rev 5717)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/qa_inband_usrp_server.cc
   2007-06-06 22:45:52 UTC (rev 5718)
@@ -438,8 +438,9 @@
     d_ndealloc_to_recv++;
   }
 
-  // Try to deallocate a channel that doesn't exist on both sides, the last 
element in the vectors
-  // is the highest channel number, so we take that plus 1
+  // Try to deallocate a channel that doesn't exist on both sides, the last
+  // element in the vectors is the highest channel number, so we take that plus
+  // 1
   d_ndealloc_to_recv+=2;
   d_tx->send(s_cmd_deallocate_channel, 
              pmt_list2(pmt_list2(s_response_deallocate_channel,
@@ -480,7 +481,8 @@
     return;
   } else {
     if(verbose)
-      std::cout << "[qa_alloc_top] Received expected response for message " << 
d_ndealloc_recvd
+      std::cout << "[qa_alloc_top] Received expected response for message " 
+                << d_ndealloc_recvd
       << " (" << event << ")\n";
   }
 
@@ -497,18 +499,16 @@
       
     if(pmt_eq(msg->signal(), s_response_max_capacity)) {
       d_max_capacity = pmt_to_long(pmt_nth(2, data));
-      // std::cout << "[qa_dealloc_top] USRP has max capacity of " << 
d_max_capacity << "\n";
     }
     else if(pmt_eq(msg->signal(), s_response_ntx_chan)) {
       d_ntx_chan = pmt_to_long(pmt_nth(2, data));
-      // std::cout << "[qa_dealloc_top] USRP tx channels: " << d_ntx_chan << 
"\n";
     }
     else if(pmt_eq(msg->signal(), s_response_nrx_chan)) {
       d_nrx_chan = pmt_to_long(pmt_nth(2, data));
-      // std::cout << "[qa_dealloc_top] USRP rx channels: " << d_nrx_chan << 
"\n";
     }
     else if(pmt_eq(msg->signal(), s_response_current_capacity_allocation)) {
-      // the final command is a capacity check which should be 0, then we 
shutdown
+      // the final command is a capacity check which should be 0, then we
+      // shutdown
       pmt_t expected_result = pmt_from_long(0);
       pmt_t result = pmt_nth(2, data);
 
@@ -542,7 +542,6 @@
   d_nalloc_recvd++;
 
   if(!pmt_eqv(status, PMT_T)) {
-    // std::cout << "[qa_dealloc_top] Unexpected error response when 
allocating channels\n";
     shutdown_all(PMT_F);
     return;
   } else {
@@ -566,7 +565,8 @@
       std::cout << "\n";
     }
 
-    deallocate_all();   // once we've allocated all of our channels, try to 
dealloc them
+    deallocate_all();   // once we've allocated all of our channels, try to
+                        // dealloc them
   }
 }
 
@@ -629,9 +629,14 @@
   d_cs->send(s_cmd_close, pmt_list1(pmt_list2(s_response_close,PMT_F)));
   
   // Perform an open, and a second open which should fail
-  d_cs->send(s_cmd_open, pmt_list2(pmt_list2(s_response_open,PMT_T), 
pmt_from_long(0)));
-  d_cs->send(s_cmd_open, pmt_list2(pmt_list2(s_response_open,PMT_F), 
pmt_from_long(0)));
+  d_cs->send(s_cmd_open, 
+             pmt_list2(pmt_list2(s_response_open,PMT_T), 
+             pmt_from_long(0)));
 
+  d_cs->send(s_cmd_open, 
+             pmt_list2(pmt_list2(s_response_open,PMT_F), 
+             pmt_from_long(0)));
+
   // A close should now be successful since the interface is open
   d_cs->send(s_cmd_close, pmt_list1(pmt_list2(s_response_close,PMT_T)));
 
@@ -639,7 +644,10 @@
   d_cs->send(s_cmd_close, pmt_list1(pmt_list2(s_response_close,PMT_F)));
   
   // Just to be thorough, try an open and close again
-  d_cs->send(s_cmd_open, pmt_list2(pmt_list2(s_response_open,PMT_T), 
pmt_from_long(0)));
+  d_cs->send(s_cmd_open, 
+             pmt_list2(pmt_list2(s_response_open,PMT_T), 
+             pmt_from_long(0)));
+
   d_cs->send(s_cmd_close, pmt_list1(pmt_list2(s_response_close,PMT_T)));
   
 }
@@ -673,10 +681,17 @@
   pmt_t e_status = pmt_nth(1, expected);
 
   if(!pmt_eqv(e_status, status) || !pmt_eqv(e_event, event)) {
-    // std::cout << "[qa_open_close_top] FAILED check_cs... Got: " << result 
<< " Expected: " << expected_result << " for event " << msg->signal() << "\n";
+
+    if(verbose)
+      std::cout << "[qa_open_close_top] FAILED check_cs... Got: " << status
+                << " Expected: " << e_status
+                << " for event " << event << "\n";
+
     shutdown_all(PMT_F);
   } else {
-    // std::cout << "[qa_open_close_top] Received expected CS response for 
message (" << msg->signal() << ")\n";
+    if(verbose)
+      std::cout << "[qa_open_close_top] Received expected CS response (" 
+                << event << ")\n";
   }
 
 }





reply via email to

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