EttusResearch / uhd

The USRP™ Hardware Driver Repository
http://uhd.ettus.com
Other
975 stars 655 forks source link

host: Implement n-times repeated transmission in tx_samples_from_file example #679

Open nzqo opened 1 year ago

nzqo commented 1 year ago

Pull Request Details

Description

These changes allow to use the tx_samples_from_file example with a specified number of repetitions using the n-repeat option.

I didn't know whether breaking compatibility was okay, so I did not. Instead, the --repeat option overwrites the new flag and still causes transmission until a SIGINT is received. I did, however, change that signal handling to be conformal by using the appropriate sig_atomic_t flag type.

On the way, I made some minor formatting change, got rid of a few annoying compiler warnings and improved some CMake stuff. Specifically:

Which devices/areas does this affect?

Affects host uhd lib (no functional changes) and the tx_samples_from_file example (convenience feature).

Testing Done

Present tests pass. I dont think there are tests for the examples though. Since the changes are mostly minor I dont think new tests are required.

As for the example itself, I ran it with a few different options (repeat, n-repeat, both) to confirm that it doesnt crash or anything.

Checklist

Additional notes

It might make sense to bring in codestyle for CMake files as well (and e.g. enforce it using cmake-format). Also, I didnt want to touch it, but some of the boost filesystem stuff is deprecated in favor of C++17's filesystem. I was considering abstracting the relevant functions away and switching between the two depending on the supported standard of the local compiler, but that was too much hassle to do for now.

github-actions[bot] commented 1 year ago

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

nzqo commented 1 year ago

I have read the CLA Document and I hereby sign the CLA

mbr0wn commented 1 year ago

recheck

nzqo commented 1 year ago

recheck

I only see CI errors that seem related to some tokens, anything that I can do here? 😁

mbr0wn commented 1 year ago

recheck

mbr0wn commented 1 year ago

recheck

I only see CI errors that seem related to some tokens, anything that I can do here? grin

Nah the problem is on our end, we changed some github settings and now are chasing down things like this.

mbr0wn commented 1 year ago

recheck

mbr0wn commented 1 year ago

(sorry I'm using your PR for testing purposes)

nzqo commented 1 year ago

(sorry I'm using your PR for testing purposes)

Feel free, I dont mind 😁

mbr0wn commented 1 year ago

Some progress: https://github.com/EttusResearch/uhd/actions/runs/5541486415/jobs/10114946490#step:2:16

...it's just not updating here yet.