Commit graph

25 commits

Author SHA1 Message Date
Martin Braun
7044fcdca5 uhd: Remove includes of list_of.hpp where appropriate
This Boost header is included in some places, despite not being used.
2021-06-24 12:00:49 -05:00
Michael West
52fb587373 examples: Update test_messages example
The example assumed that there was always at least one TX and on RX
channel.  Since that is not always true, this change checks for TX
and RX channels and only exucutes tests for what exists on the device.

Signed-off-by: Michael West <michael.west@ettus.com>
2020-04-30 15:14:28 -05:00
Martin Braun
876d4150aa uhd: Apply clang-format against all .cpp and .hpp files in host/
Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of
files that clang-format gets applied against.
2020-03-03 08:51:32 -06:00
Martin Braun
c8950c1e0b examples: Send only single packets in test_messages
For the burst ACK test, test_messages would send 3 packets. However,
that assumes that the underlying link is fast enough to send three
packets in time, and some devices are hard to operate without underruns
without also specifying a start-of burst timestamp. Often, test_messages
would report that no ACK was received, but instead, an underrun was
received.

test_messages also doesn't need to send three packets. The three packets
came from the "start of burst" flag, which no device in UHD supports.

The change is thus to send a single packet with an EOB marker for the
burst ACK test. This will work regardless of the link speed and CPU
power.
2019-11-26 12:21:33 -08:00
Martin Braun
d3a16b7022 uhd: Replace all occurrences of boost::bind with std::bind
Note: Replacing everything with a lambda would be even better, but that
can't be easily scripted so we'll do this as a first step to reduce the
Boost footprint.

This also removes occurences of #include <boost/bind.hpp>, and makes
sure all usages of std::bind have an #include <functional>. clang-format
wasn't always applied to minimize the changeset in this commit, however,
it was applied to the blocks of #includes.

Due to conflicts with other Boost libraries, the placeholders _1, _2,
etc. could not be directly used, but had to be explicitly called out
(as std::placeholders::_1, etc.). This makes the use of std::bind even
uglier, which serves as another reminder that using std::bind (and even
more so, boost::bind) should be avoided.

nirio/rpc/rpc_client.cpp still contains a reference to boost::bind. It
was not possible to remove it by simply doing a search and replace, so
it will be removed in a separate commit.
2019-11-26 12:21:32 -08:00
Brent Stapleton
9d27486550 rfnoc: examples: Porting examples to new RFNoC
rfnoc_nullsource_ce_rx, rfnoc_rx_to_file:

These examples are modified so they can be run with the new RFNoC API.

test_messages:

Fixes failures in the time test when it is executed immediately after an
underrun test. The DUC considers time specs on a per burst basis, so
when the underrun test leaves a burst unfinished, a time spec on the
next burst is ignored.
2019-11-26 12:16:25 -08:00
Ciro Nishiguchi
60a70f7142 examples: remove thread priority elevation
Remove UHD call to elevate thread priority to realtime. Setting all
threads to the same realtime priority can cause the threads to not share
access to the network interface fairly, which adversely affects
operation of the worker threads in UHD.
2019-10-22 16:18:46 -07:00
Brent Stapleton
967be2a4e8 uhd: mpm: apply clang-format to all files
Applying formatting changes to all .cpp and .hpp files in the following
directories:
```
find host/examples/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/tests/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/dboard/neon/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/dboard/magnesium/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/device3/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/mpmd/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/x300/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/utils/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find mpm/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
```

Also formatted host/include/, except Cpp03 was used as a the language
standard instead of Cpp11.
```
sed -i 's/ Cpp11/ Cpp03/g' .clang-format
find host/include/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
```

Formatting style was designated by the .clang-format file.
2019-01-16 11:40:23 -08:00
Brent Stapleton
601e0ed87b examples: utils: skip formatting program options
Turning off clang formatting around the program option declarations.
clang-format makes them looks bad an unreadable because it thinks the
options are function calls or something.
2019-01-16 11:40:23 -08:00
Martin Braun
305d0e79e2 examples: Fix some minor compiler warnings
All warnings reported by MSVC. Mostly related to narrowing conversions.
2018-02-19 17:01:40 -08:00
Martin Braun
ae5211d71d uhd: Update license headers
All copyright is now attributed to "Ettus Research, a National
Instruments company".

SPDX headers were also updated to latest version 3.0.
2018-02-19 16:54:52 -08:00
Martin Braun
4f948e2c8b Move all license headers to SPDX format. 2017-12-22 10:45:51 -08:00
Andrej Rode
c33928d2bb utils: add set_thread_name API call, move thread_priority to thread 2017-06-29 13:43:05 -07:00
Martin Braun
da26a3e34e Merge branch 'maint' 2017-03-01 16:39:08 -08:00
Martin Braun
e2e0aab185 examples: Added some more error strings to test_messages 2017-02-27 15:04:29 -08:00
Andrej Rode
26cc20847c uhd: replace BOOST_FOREACH with C++11 range-based for loop
Note: This is the first commit that uses for-range, and range-based
for-loops are now usable for UHD development.
2017-02-10 16:44:33 -08:00
Paul David
8b6680bc52 examples: Fix and cleanup test messages 2017-02-07 18:09:24 -08:00
Martin Braun
92cc4d83df examples: Fixed test_messages 2016-09-28 10:20:04 -07:00
Ben Hilburn
9e47ad607b Squashed merge of Coverity fixes. 2013-11-27 12:11:23 -08:00
Josh Blum
c464a63e87 uhd: added new calls to streamer object + support work
* The transmit streamer gives access to the async msg queue.
* The receive streamer gives access to the issue stream cmd.
* Supporting usrp implementation files updated.
* Example applications updated to use this API.
2013-07-15 15:44:42 -07:00
Moritz Fischer
171e46cebe examples & utils: return EXIT_FAILURE and EXIT_SUCCESS respectively
instead of 0 and 1.
2012-10-26 14:00:29 -07:00
Josh Blum
1151000340 uhd: various tweaks for compiler warns and valgrind 2012-02-09 17:59:48 -08:00
Josh Blum
fac15db5d7 uhd: renamed some of the stream types and functions 2011-11-03 20:37:11 -07:00
Josh Blum
a629bbe7e3 uhd: updated examples to use new streamer interface 2011-11-03 20:37:10 -07:00
Josh Blum
34265334d1 uhd: added inline message testing to the messages example
Renamed the example to test_messages (not just async).
Fixed bug in super recv packet handler related to messages.
Basically, the sequence number for messages should be ignored.
Fixed some quirks with usrp1 soft time control to get it work as well.
2011-07-03 17:40:13 -07:00
Renamed from host/examples/test_async_messages.cpp (Browse further)