summaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-10-12 10:55:07 -0700
committerJosh Blum <josh@joshknows.com>2010-10-12 10:55:07 -0700
commitf9755b0ab33eb20abb5689893061f3b4039505fd (patch)
tree0eef45b8a9a8dde3a3ace7b73f00a1bb3a08828d /host
parentb49e2955b0f68d59e7903f89a26c39dc9b3614fd (diff)
downloaduhd-f9755b0ab33eb20abb5689893061f3b4039505fd.tar.gz
uhd-f9755b0ab33eb20abb5689893061f3b4039505fd.tar.bz2
uhd-f9755b0ab33eb20abb5689893061f3b4039505fd.zip
uhd: test eob ack message, usrp2: remove rx drain on init with the promise of a reset register
Diffstat (limited to 'host')
-rw-r--r--host/examples/test_async_messages.cpp32
-rw-r--r--host/lib/usrp/usrp2/io_impl.cpp2
-rw-r--r--host/lib/usrp/usrp2/mboard_impl.cpp5
3 files changed, 20 insertions, 19 deletions
diff --git a/host/examples/test_async_messages.cpp b/host/examples/test_async_messages.cpp
index e4a996ef5..fa39bcde6 100644
--- a/host/examples/test_async_messages.cpp
+++ b/host/examples/test_async_messages.cpp
@@ -27,13 +27,13 @@
namespace po = boost::program_options;
/*!
- * Test that no messages are received:
+ * Test the eob ack message:
* Send a burst of many samples that will fragment internally.
- * We expect to not get any async messages.
+ * We expect to get an eob ack async message.
*/
-void test_no_async_message(uhd::usrp::single_usrp::sptr sdev){
+void test_ack_async_message(uhd::usrp::single_usrp::sptr sdev){
uhd::device::sptr dev = sdev->get_device();
- std::cout << "Test no async message... " << std::flush;
+ std::cout << "Test eob ack message... " << std::flush;
uhd::tx_metadata_t md;
md.start_of_burst = true;
@@ -50,19 +50,27 @@ void test_no_async_message(uhd::usrp::single_usrp::sptr sdev){
);
uhd::async_metadata_t async_md;
- if (dev->recv_async_msg(async_md)){
+ if (not dev->recv_async_msg(async_md)){
std::cout << boost::format(
"failed:\n"
- " Got unexpected event code 0x%x.\n"
- ) % async_md.event_code << std::endl;
- //clear the async messages
- while (dev->recv_async_msg(async_md, 0)){};
+ " Async message recv timed out.\n"
+ ) << std::endl;
+ return;
}
- else{
+
+ switch(async_md.event_code){
+ case uhd::async_metadata_t::EVENT_CODE_EOB_ACK:
std::cout << boost::format(
"success:\n"
- " Did not get an async message.\n"
+ " Got event code eob ack message.\n"
) << std::endl;
+ break;
+
+ default:
+ std::cout << boost::format(
+ "failed:\n"
+ " Got unexpected event code 0x%x.\n"
+ ) % async_md.event_code << std::endl;
}
}
@@ -195,7 +203,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//------------------------------------------------------------------
// begin asyc messages test
//------------------------------------------------------------------
- test_no_async_message(sdev);
+ test_ack_async_message(sdev);
test_underflow_message(sdev);
test_time_error_message(sdev);
diff --git a/host/lib/usrp/usrp2/io_impl.cpp b/host/lib/usrp/usrp2/io_impl.cpp
index c9271cc8c..48ff7d509 100644
--- a/host/lib/usrp/usrp2/io_impl.cpp
+++ b/host/lib/usrp/usrp2/io_impl.cpp
@@ -249,8 +249,6 @@ void usrp2_impl::io_init(void){
};
std::memcpy(send_buff->cast<void*>(), &data, sizeof(data));
send_buff->commit(sizeof(data));
- //drain the recv buffers (may have junk)
- while (data_transport->get_recv_buff(0).get()){};
}
//the assumption is that all data transports should be identical
diff --git a/host/lib/usrp/usrp2/mboard_impl.cpp b/host/lib/usrp/usrp2/mboard_impl.cpp
index ddf147c8d..65066f125 100644
--- a/host/lib/usrp/usrp2/mboard_impl.cpp
+++ b/host/lib/usrp/usrp2/mboard_impl.cpp
@@ -70,11 +70,6 @@ usrp2_mboard_impl::usrp2_mboard_impl(
_allowed_decim_and_interp_rates.push_back(i);
}
- //Issue a stop streaming command (in case it was left running).
- //Since this command is issued before the networking is setup,
- //most if not all junk packets will never make it to the socket.
- this->issue_ddc_stream_cmd(stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS);
-
//init the rx control registers
_iface->poke32(U2_REG_RX_CTRL_NSAMPS_PER_PKT, _recv_samps_per_packet);
_iface->poke32(U2_REG_RX_CTRL_NCHANNELS, 1);