[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r5723 - gnuradio/branches/developers/gnychis/inband/us
From: |
gnychis |
Subject: |
[Commit-gnuradio] r5723 - gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband |
Date: |
Wed, 6 Jun 2007 17:09:49 -0600 (MDT) |
Author: gnychis
Date: 2007-06-06 17:09:49 -0600 (Wed, 06 Jun 2007)
New Revision: 5723
Modified:
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/qa_inband_usrp_server.cc
Log:
Greatly simplified the TX QA code while keeping all of the tests and
functionality
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 23:02:21 UTC (rev 5722)
+++
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/qa_inband_usrp_server.cc
2007-06-06 23:09:49 UTC (rev 5723)
@@ -840,35 +840,11 @@
qa_tx_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);
- }
+ pmt_t event = msg->signal();
- 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);
+ if(pmt_eq(event, pmt_intern("%shutdown")))
return;
- }
-}
-void
-qa_tx_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);
@@ -877,14 +853,30 @@
if(!pmt_eqv(e_status, status) || !pmt_eqv(e_event, event)) {
if(verbose)
- std::cout << "[qa_tx_top] FAILED check_deallocation... Got: "
- << status << " Expected: " << e_status << "\n";
+ std::cout << "Got: " << status << " Expected: " << e_status << "\n";
shutdown_all(PMT_F);
return;
} else {
if(verbose)
- std::cout << "[qa_tx_top] Received expected deallocation response\n";
+ std::cout << "[qa_xmit_top] Received expected response for message "
+ << d_nmsg_recvd
+ << " (" << event << ")\n";
}
+
+ 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);
+
+ }
+
+ d_nmsg_recvd++;
+
+ if(d_nmsg_to_recv == d_nmsg_recvd){
+ shutdown_all(PMT_T);
+ return;
+ }
}
void
@@ -892,26 +884,11 @@
{
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)) {
- if(verbose)
- std::cout << "[qa_tx_top] FAILED check_allocation... Got: " << status
- << " Expected: " << e_status
- << " for event " << event << ")\n";
- shutdown_all(PMT_F);
- return;
- } else {
- if(verbose)
- std::cout << "[qa_tx_top] Received expected allocation response\n";
- }
-
if(pmt_eqv(status, PMT_T)) {
// store all of the allocate channel numbers
if(pmt_eq(msg->port_id(), d_tx->port_symbol()))
@@ -921,58 +898,6 @@
}
}
-void
-qa_tx_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)) {
- if(verbose)
- std::cout << "[qa_tx_top] FAILED check_xmit... Got: " << status
- << " Expected: " << e_status
- << " for event " << event << ")\n";
- shutdown_all(PMT_F);
- return;
- } else {
- if(verbose)
- std::cout << "[qa_tx_top] Received expected xmit response\n";
- }
-}
-
-void
-qa_tx_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)) {
- if(verbose)
- std::cout << "[qa_tx_top] FAILED check_cs... Got: " << status
- << " Expected: " << e_status
- << " for event " << event << "\n";
- shutdown_all(PMT_F);
- return;
- } else {
- if(verbose)
- std::cout << "[qa_tx_top] Received expected CS response for message ("
- << event << ")\n";
- }
-
-}
-
REGISTER_MBLOCK_CLASS(qa_tx_top);
//
----------------------------------------------------------------------------------------------
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r5723 - gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband,
gnychis <=