diff options
author | Ciro Nishiguchi <ciro.nishiguchi@ni.com> | 2019-08-27 16:08:05 -0500 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-11-26 11:49:43 -0800 |
commit | 0e2464ad888230054b04a4f3fb192ea8dc5721b0 (patch) | |
tree | c51fa49fa5280437b178244660094a535b7059cc /host/lib/include/uhdlib/rfnoc/chdr_ctrl_xport.hpp | |
parent | 23f4f8cf4ea72d59740afcb5663e4541f93e821a (diff) | |
download | uhd-0e2464ad888230054b04a4f3fb192ea8dc5721b0.tar.gz uhd-0e2464ad888230054b04a4f3fb192ea8dc5721b0.tar.bz2 uhd-0e2464ad888230054b04a4f3fb192ea8dc5721b0.zip |
rfnoc: Move data xport sep configuration to static methods
Move the configuration logic for stream endpoints to static methods of
the chdr data transports. This separates those interactions from the
main transport code, simplifying both. It also makes it easier to use
the transports with mock link objects.
Diffstat (limited to 'host/lib/include/uhdlib/rfnoc/chdr_ctrl_xport.hpp')
-rw-r--r-- | host/lib/include/uhdlib/rfnoc/chdr_ctrl_xport.hpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/host/lib/include/uhdlib/rfnoc/chdr_ctrl_xport.hpp b/host/lib/include/uhdlib/rfnoc/chdr_ctrl_xport.hpp index 9cf2f305f..726ea7f6c 100644 --- a/host/lib/include/uhdlib/rfnoc/chdr_ctrl_xport.hpp +++ b/host/lib/include/uhdlib/rfnoc/chdr_ctrl_xport.hpp @@ -7,6 +7,7 @@ #ifndef INCLUDED_RFNOC_CHDR_CTRL_XPORT_HPP #define INCLUDED_RFNOC_CHDR_CTRL_XPORT_HPP +#include <uhdlib/rfnoc/chdr_packet.hpp> #include <uhdlib/rfnoc/chdr_types.hpp> #include <uhdlib/transport/io_service.hpp> #include <mutex> @@ -41,12 +42,18 @@ public: static sptr make(io_service::sptr io_srv, send_link_if::sptr send_link, recv_link_if::sptr recv_link, + const chdr::chdr_packet_factory& pkt_factory, sep_id_t my_epid, size_t num_send_frames, size_t num_recv_frames) { - return std::make_shared<chdr_ctrl_xport>( - io_srv, send_link, recv_link, my_epid, num_send_frames, num_recv_frames); + return std::make_shared<chdr_ctrl_xport>(io_srv, + send_link, + recv_link, + pkt_factory, + my_epid, + num_send_frames, + num_recv_frames); } /*! @@ -62,6 +69,7 @@ public: chdr_ctrl_xport(io_service::sptr io_srv, send_link_if::sptr send_link, recv_link_if::sptr recv_link, + const chdr::chdr_packet_factory& pkt_factory, sep_id_t my_epid, size_t num_send_frames, size_t num_recv_frames); @@ -122,10 +130,15 @@ private: chdr_ctrl_xport(const chdr_ctrl_xport&) = delete; sep_id_t _my_epid; + + // Packet for received data + chdr::chdr_packet::uptr _recv_packet; + send_io_if::sptr _send_if; recv_io_if::sptr _ctrl_recv_if; recv_io_if::sptr _mgmt_recv_if; + // FIXME: Remove this when have threaded_io_service std::mutex _mutex; }; |