uhd icon indicating copy to clipboard operation
uhd copied to clipboard

Feature suggestion: libuhd providing Asio style "sockets"

Open pfeatherstone opened this issue 2 years ago • 1 comments

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

  • device.async_connect()
  • device.async_write()
  • device.async_read()
  • device.async_set_freq()
  • ...

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 avatar Dec 16 '22 10:12 pfeatherstone

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.

pfeatherstone avatar Dec 16 '22 10:12 pfeatherstone