EttusResearch / uhd

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

Feature suggestion: libuhd providing Asio style "sockets" #648

Open pfeatherstone opened 1 year ago

pfeatherstone commented 1 year ago

Wouldn't it be cool if libuhd provided an Asio API for both TX and RX streaming. Meaning you could have function like:

Where device is an Asio object that both controls a usrp device and satisfies the requirements of an Asio "socket". I imagine those async functions would themselves be composed operations a bit like how http::async_read() and http:async_write() are composed functions in boost::Beast. But the threading would be down to the user to manage, just like all Asio applications. More importantly, setting up logical loops would be quite easy and nice, following the Asio state-machine style of coding, which is fantastic.

pfeatherstone commented 1 year ago

To be honest, it would be cool if libiio was integrated into Asio, then libuhd could wrap asio-libiio. FYI. I'm not going to submit a PR. Just throwing ideas.