diff options
author | Martin Braun <martin.braun@ettus.com> | 2019-08-19 12:17:50 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-11-26 11:49:11 -0800 |
commit | 0eb760f4db92dc0a97ea4924fa044e7a48820a54 (patch) | |
tree | e007dffed2cdabf506de6a39c632c51d704a5d92 /host/include | |
parent | 01d71420eff77336c23ef70459d17b44810e3a99 (diff) | |
download | uhd-0eb760f4db92dc0a97ea4924fa044e7a48820a54.tar.gz uhd-0eb760f4db92dc0a97ea4924fa044e7a48820a54.tar.bz2 uhd-0eb760f4db92dc0a97ea4924fa044e7a48820a54.zip |
niusrpio: Apply formatting
Diffstat (limited to 'host/include')
-rw-r--r-- | host/include/uhd/transport/nirio/niusrprio_session.h | 75 |
1 files changed, 35 insertions, 40 deletions
diff --git a/host/include/uhd/transport/nirio/niusrprio_session.h b/host/include/uhd/transport/nirio/niusrprio_session.h index f6f0d78a1..41f05aec0 100644 --- a/host/include/uhd/transport/nirio/niusrprio_session.h +++ b/host/include/uhd/transport/nirio/niusrprio_session.h @@ -9,12 +9,12 @@ #ifndef INCLUDED_UHD_TRANSPORT_NIRIO_NIUSRPRIO_SESSION_H #define INCLUDED_UHD_TRANSPORT_NIRIO_NIUSRPRIO_SESSION_H -#include <stdint.h> -#include <uhd/transport/nirio/rpc/usrprio_rpc_client.hpp> -#include <uhd/transport/nirio/niriok_proxy.h> -#include <uhd/transport/nirio/nirio_resource_manager.h> #include <uhd/transport/nirio/nifpga_lvbitx.h> +#include <uhd/transport/nirio/nirio_resource_manager.h> +#include <uhd/transport/nirio/niriok_proxy.h> +#include <uhd/transport/nirio/rpc/usrprio_rpc_client.hpp> #include <uhd/utils/noncopyable.hpp> +#include <stdint.h> #include <boost/smart_ptr.hpp> #include <boost/thread/recursive_mutex.hpp> #include <string> @@ -29,68 +29,63 @@ public: typedef uhd::usrprio_rpc::usrprio_device_info_vtr device_info_vtr; static nirio_status enumerate( - const std::string& rpc_port_name, - device_info_vtr& device_info_vtr); + const std::string& rpc_port_name, device_info_vtr& device_info_vtr); - niusrprio_session( - const std::string& resource_name, - const std::string& port_name); + niusrprio_session(const std::string& resource_name, const std::string& port_name); virtual ~niusrprio_session(); - nirio_status open( - nifpga_lvbitx::sptr lvbitx, - bool force_download = false); + nirio_status open(nifpga_lvbitx::sptr lvbitx, bool force_download = false); void close(bool skip_reset = false); nirio_status reset(); - template<typename data_t> + template <typename data_t> nirio_status create_tx_fifo( - const char* fifo_name, - boost::shared_ptr< nirio_fifo<data_t> >& fifo) + const char* fifo_name, boost::shared_ptr<nirio_fifo<data_t>>& fifo) { - if (!_session_open) return NiRio_Status_ResourceNotInitialized; + if (!_session_open) + return NiRio_Status_ResourceNotInitialized; return _resource_manager.create_tx_fifo(fifo_name, fifo); } - template<typename data_t> + template <typename data_t> nirio_status create_tx_fifo( - uint32_t fifo_instance, - boost::shared_ptr< nirio_fifo<data_t> >& fifo) + uint32_t fifo_instance, boost::shared_ptr<nirio_fifo<data_t>>& fifo) { - if ((size_t)fifo_instance >= _lvbitx->get_output_fifo_count()) return NiRio_Status_InvalidParameter; + if ((size_t)fifo_instance >= _lvbitx->get_output_fifo_count()) + return NiRio_Status_InvalidParameter; return create_tx_fifo(_lvbitx->get_output_fifo_names()[fifo_instance], fifo); } - template<typename data_t> + template <typename data_t> nirio_status create_rx_fifo( - const char* fifo_name, - boost::shared_ptr< nirio_fifo<data_t> >& fifo) + const char* fifo_name, boost::shared_ptr<nirio_fifo<data_t>>& fifo) { - if (!_session_open) return NiRio_Status_ResourceNotInitialized; + if (!_session_open) + return NiRio_Status_ResourceNotInitialized; return _resource_manager.create_rx_fifo(fifo_name, fifo); } - template<typename data_t> + template <typename data_t> nirio_status create_rx_fifo( - uint32_t fifo_instance, - boost::shared_ptr< nirio_fifo<data_t> >& fifo) + uint32_t fifo_instance, boost::shared_ptr<nirio_fifo<data_t>>& fifo) { - if ((size_t)fifo_instance >= _lvbitx->get_input_fifo_count()) return NiRio_Status_InvalidParameter; + if ((size_t)fifo_instance >= _lvbitx->get_input_fifo_count()) + return NiRio_Status_InvalidParameter; return create_rx_fifo(_lvbitx->get_input_fifo_names()[fifo_instance], fifo); } - UHD_INLINE niriok_proxy::sptr get_kernel_proxy() { + UHD_INLINE niriok_proxy::sptr get_kernel_proxy() + { return _riok_proxy; } nirio_status download_bitstream_to_flash(const std::string& bitstream_path); - //Static + // Static static niriok_proxy::sptr create_kernel_proxy( - const std::string& resource_name, - const std::string& rpc_port_name); + const std::string& resource_name, const std::string& rpc_port_name); private: nirio_status _verify_signature(); @@ -98,16 +93,16 @@ private: nirio_status _write_bitstream_checksum(const std::string& checksum); nirio_status _ensure_fpga_ready(); - std::string _resource_name; - nifpga_lvbitx::sptr _lvbitx; - std::string _interface_path; - bool _session_open; - niriok_proxy::sptr _riok_proxy; - nirio_resource_manager _resource_manager; + std::string _resource_name; + nifpga_lvbitx::sptr _lvbitx; + std::string _interface_path; + bool _session_open; + niriok_proxy::sptr _riok_proxy; + nirio_resource_manager _resource_manager; usrprio_rpc::usrprio_rpc_client _rpc_client; - boost::recursive_mutex _session_mutex; + boost::recursive_mutex _session_mutex; }; -}} +}} // namespace uhd::niusrprio #endif /* INCLUDED_UHD_TRANSPORT_NIRIO_NIUSRPRIO_SESSION_H */ |