diff options
author | Samuel O'Brien <sam.obrien@ni.com> | 2020-06-23 15:09:55 -0500 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-07-13 15:21:52 -0500 |
commit | 297d5855ca3ac2e3fea329bd938cf4763fac583b (patch) | |
tree | e302783f5efcadbd451d8d24463baece7d85a47c /host/tests/common/chdr_resource/README.md | |
parent | 22837edfe20feb57c24f2a55edbb65757b3fab6a (diff) | |
download | uhd-297d5855ca3ac2e3fea329bd938cf4763fac583b.tar.gz uhd-297d5855ca3ac2e3fea329bd938cf4763fac583b.tar.bz2 uhd-297d5855ca3ac2e3fea329bd938cf4763fac583b.zip |
utils: Expose CHDR Parsing API
This commit introduces a new public api in uhd::utils which allows serializing
and deserializing chdr packets.
As far as testing, this commit adds the chdr_parse_test test. It uses a
wireshark trace located in rfnoc_packets_*.cpp as well as hand coded
packets from hardcoded_packets.cpp to test the serialization and
deserialization process
Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
Diffstat (limited to 'host/tests/common/chdr_resource/README.md')
-rw-r--r-- | host/tests/common/chdr_resource/README.md | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/host/tests/common/chdr_resource/README.md b/host/tests/common/chdr_resource/README.md new file mode 100644 index 000000000..5664cd132 --- /dev/null +++ b/host/tests/common/chdr_resource/README.md @@ -0,0 +1,24 @@ +## RFNoC Traces +This file contains various traces or chdr packet conversations obtained using wireshark. + +#### hardcoded_packets +This file contains handwritten C++ objects which represent the expected deserialization result of packets contained in the traces. +They have been specifically chosen to provide good test coverage over the packet types and the different values that each packet type may contain. + +#### rfnoc_packets_ctrl_mgmt +This file contains a trace that was created by connecting to a usrp over ethernet and running `uhd_usrp_probe`. +It contains a mix of Management and Control packets. + +#### rfnoc_packets_data +This file contains a trace that was created by connecting to a usrp over ethernet and running `rx_samples_to_file`. +It contains many Data packets, as well as some Stream Status and Stream Command packets. + +### Steps to Reproduce +1. Install Wireshark. Installing the RFNoC Wireshark can be helpful for identifying which packets are CHDR packets, but it isn't required. +2. Conduct a wireshark capture on your network interface and run an operation with the radio (`uhd_usrp_probe`, `benchmark_rate`, etc.) +3. Find an RFNoC Packet in the capture windows, right click on it, and select Follow -> UDP Stream. This will gather all packets in that "conversation". With a large trace, this may take a few moments. +4. In the bottom of the window that opens, select Show and save data as -> C Arrays. +5. Save the trace with a descriptive name in the `host/tests/common/chdr_resource` directory as a `.c` file +6. In the `host/tests/common/chdr_resource` directory, run `./format_trace.py {filename}`, where `{filename}` is the name of the `.c` file you save the trace as. + +This will create a `.cpp` file of the same name, which contains the trace data inside a namespace matching the filename. The trace can now be accessed in unit tests with `#include <chdr_resource/{filename}.cpp>`. |