Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion host/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,25 @@ endif()
########################################################################
MESSAGE(STATUS "")
MESSAGE(STATUS "Configuring Boost C++ Libraries...")

set(Boost_NO_BOOST_CMAKE ON)

find_package(Boost 1.36 QUIET)

SET(BOOST_REQUIRED_COMPONENTS
date_time
filesystem
system
# system
thread
program_options
)

if(Boost_VERSION_STRING AND Boost_VERSION_STRING VERSION_LESS "1.89.0")
MESSAGE(STATUS "Boost C++ Library version is less than 1.89.0, adding system to required components")
list(APPEND BOOST_REQUIRED_COMPONENTS system)
endif()


IF(UNIX AND EXISTS "/usr/lib64")
LIST(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix
ENDIF(UNIX AND EXISTS "/usr/lib64")
Expand Down
7 changes: 7 additions & 0 deletions host/cores/super_recv_packet_handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <uhd/convert.hpp>
#include <uhd/stream.hpp>
#include "umtrx_log_adapter.hpp"
#include <uhd/rfnoc/actions.hpp>
#include <uhd/utils/tasks.hpp>
#include <uhd/utils/byteswap.hpp>
#include <uhd/types/metadata.hpp>
Expand Down Expand Up @@ -778,6 +779,12 @@ class recv_packet_streamer : public recv_packet_handler, public rx_streamer{
return recv_packet_handler::issue_stream_cmd(stream_cmd);
}

void post_input_action(
[[maybe_unused]] const std::shared_ptr<uhd::rfnoc::action_info>& action,
[[maybe_unused]] const size_t port
){
// no action required
}
private:
size_t _max_num_samps;
};
Expand Down
8 changes: 8 additions & 0 deletions host/cores/super_send_packet_handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <uhd/convert.hpp>
#include <uhd/stream.hpp>
#include "umtrx_log_adapter.hpp"
#include <uhd/rfnoc/actions.hpp>
#include <uhd/utils/tasks.hpp>
#include <uhd/utils/byteswap.hpp>
#include <uhd/types/metadata.hpp>
Expand Down Expand Up @@ -448,6 +449,13 @@ class send_packet_streamer : public send_packet_handler, public tx_streamer{
return send_packet_handler::recv_async_msg(async_metadata, timeout);
}

void post_output_action(
[[maybe_unused]] const std::shared_ptr<uhd::rfnoc::action_info>& action,
[[maybe_unused]] const size_t port
){
// no action required
}

private:
size_t _max_num_samps;
};
Expand Down
9 changes: 9 additions & 0 deletions host/umtrx_common.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef INCLUDED_UMTRX_COMMON_HPP
#define INCLUDED_UMTRX_COMMON_HPP

#include <boost/version.hpp>
#include <uhd/version.hpp>

#if UHD_VERSION >= 4000000
Expand All @@ -9,4 +10,12 @@
#define UMTRX_UHD_PTR_NAMESPACE boost
#endif

#if BOOST_VERSION >= 106600
#define PARSE_IP_V4_FROM_STRING(ip_str) boost::asio::ip::make_address_v4(ip_str)
#define BOOST_IO_CONTEXT boost::asio::io_context
#else
#define PARSE_IP_V4_FROM_STRING(ip_str) boost::asio::ip::address_v4::from_string(ip_str)
#define BOOST_IO_CONTEXT boost::asio::io_service
#endif

#endif /* INCLUDED_UMTRX_COMMON_HPP */
8 changes: 5 additions & 3 deletions host/umtrx_eeprom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//

#include "umtrx_common.hpp"
#include <uhd/usrp/mboard_eeprom.hpp>
#include <uhd/types/mac_addr.hpp>
#include <uhd/types/byte_vector.hpp>
Expand All @@ -34,6 +35,7 @@ static const boost::uint8_t N200_EEPROM_ADDR = 0x50;
static const size_t SERIAL_LEN = 9;
static const size_t NAME_MAX_LEN = 32 - SERIAL_LEN;


//! convert a string to a byte vector to write to eeprom
static byte_vector_t string_to_uint16_bytes(const std::string &num_str){
const boost::uint16_t num = boost::lexical_cast<boost::uint16_t>(num_str);
Expand Down Expand Up @@ -232,19 +234,19 @@ void store_umtrx_eeprom(const mboard_eeprom_t &mb_eeprom, i2c_iface &iface)

if (mb_eeprom.has_key("ip-addr")){
byte_vector_t ip_addr_bytes(4);
byte_copy(boost::asio::ip::address_v4::from_string(mb_eeprom["ip-addr"]).to_bytes(), ip_addr_bytes);
byte_copy(PARSE_IP_V4_FROM_STRING(mb_eeprom["ip-addr"]).to_bytes(), ip_addr_bytes);
iface.write_eeprom(N200_EEPROM_ADDR, offsetof(n200_eeprom_map, ip_addr), ip_addr_bytes);
}

if (mb_eeprom.has_key("subnet")){
byte_vector_t ip_addr_bytes(4);
byte_copy(boost::asio::ip::address_v4::from_string(mb_eeprom["subnet"]).to_bytes(), ip_addr_bytes);
byte_copy(PARSE_IP_V4_FROM_STRING(mb_eeprom["subnet"]).to_bytes(), ip_addr_bytes);
iface.write_eeprom(N200_EEPROM_ADDR, offsetof(n200_eeprom_map, subnet), ip_addr_bytes);
}

if (mb_eeprom.has_key("gateway")){
byte_vector_t ip_addr_bytes(4);
byte_copy(boost::asio::ip::address_v4::from_string(mb_eeprom["gateway"]).to_bytes(), ip_addr_bytes);
byte_copy(PARSE_IP_V4_FROM_STRING(mb_eeprom["gateway"]).to_bytes(), ip_addr_bytes);
iface.write_eeprom(N200_EEPROM_ADDR, offsetof(n200_eeprom_map, gateway), ip_addr_bytes);
}

Expand Down
3 changes: 2 additions & 1 deletion host/umtrx_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "tmp102_ctrl.hpp"
#include "power_amp.hpp"
#include "umsel2_ctrl.hpp"
#include <boost/asio/io_context.hpp>
#include <uhd/usrp/mboard_eeprom.hpp>
#include <uhd/property_tree.hpp>
#include <uhd/device.hpp>
Expand Down Expand Up @@ -231,7 +232,7 @@ class umtrx_impl : public uhd::device {
//tcp query server
uhd::task::sptr _server_query_task;
void server_query_handler(void);
boost::asio::io_service _server_query_io_service;
BOOST_IO_CONTEXT _server_query_io_service;
boost::shared_ptr<boost::asio::ip::tcp::acceptor> _server_query_tcp_acceptor;
void client_query_handle(boost::shared_ptr<boost::asio::ip::tcp::socket>);
void client_query_handle1(const boost::property_tree::ptree &request, boost::property_tree::ptree &response);
Expand Down
2 changes: 1 addition & 1 deletion host/umtrx_monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void umtrx_impl::status_monitor_start(const uhd::device_addr_t &device_addr)
{
UHD_MSG(status) << "Creating TCP monitor on port " << device_addr.get("status_port") << std::endl;
_server_query_tcp_acceptor.reset(new asio::ip::tcp::acceptor(
_server_query_io_service, asio::ip::tcp::endpoint(asio::ip::address::from_string("127.0.0.1"), device_addr.cast<int>("status_port", 0))));
_server_query_io_service, asio::ip::tcp::endpoint(PARSE_IP_V4_FROM_STRING("127.0.0.1"), device_addr.cast<int>("status_port", 0))));
_server_query_task = task::make(boost::bind(&umtrx_impl::server_query_handler, this));
}
_status_monitor_task = task::make(boost::bind(&umtrx_impl::status_monitor_handler, this));
Expand Down