Commit 31429d5d authored by Florian Kaltenberger's avatar Florian Kaltenberger

trx_usrp_stats can now be used to query the tx streamer for events (this...

trx_usrp_stats can now be used to query the tx streamer for events (this function existed already but was not implemented). with this we can now query from the softmodem the error codes that UHD writes on the screen (U,L,O,S,...)
parent d3f38013
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#endif #endif
#include <uhd/usrp/multi_usrp.hpp> #include <uhd/usrp/multi_usrp.hpp>
#include <uhd/version.hpp> #include <uhd/version.hpp>
#include <uhd/types/metadata.hpp>
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
#include <boost/thread.hpp> #include <boost/thread.hpp>
...@@ -923,7 +924,13 @@ void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index,int bw_ ...@@ -923,7 +924,13 @@ void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index,int bw_
* \returns 0 on success * \returns 0 on success
*/ */
int trx_usrp_get_stats(openair0_device *device) { int trx_usrp_get_stats(openair0_device *device) {
return(0);
usrp_state_t *s = (usrp_state_t*) device->priv;
uhd::async_metadata_t async_metadata;
s->tx_stream->recv_async_msg(async_metadata,0.0001);
return(async_metadata.event_code);
} }
/*! \brief Reset the USRP statistics /*! \brief Reset the USRP statistics
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment