From a2d0b50bc61442b471fe1a724d61d336af961e21 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 20 Dec 2017 18:08:40 -0800 Subject: mpmd: Expose get_mtu() API to mpmd_mboard_impl and to prop tree --- host/lib/usrp/mpmd/mpmd_impl.cpp | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'host/lib/usrp/mpmd/mpmd_impl.cpp') diff --git a/host/lib/usrp/mpmd/mpmd_impl.cpp b/host/lib/usrp/mpmd/mpmd_impl.cpp index 911b57558..7b4ca5bc8 100644 --- a/host/lib/usrp/mpmd/mpmd_impl.cpp +++ b/host/lib/usrp/mpmd/mpmd_impl.cpp @@ -204,6 +204,25 @@ namespace { ; } + /*** MTUs ***********************************************************/ + tree->create(mb_path / "mtu/recv") + .add_coerced_subscriber([](const size_t){ + throw uhd::runtime_error( + "Attempting to write read-only value (MTU)!"); + }) + .set_publisher([mb](){ + return mb->get_mtu(uhd::RX_DIRECTION); + }) + ; + tree->create(mb_path / "mtu/send") + .add_coerced_subscriber([](const size_t){ + throw uhd::runtime_error( + "Attempting to write read-only value (MTU)!"); + }) + .set_publisher([mb](){ + return mb->get_mtu(uhd::TX_DIRECTION); + }) + ; } void reset_time_synchronized(uhd::property_tree::sptr tree) @@ -389,20 +408,8 @@ mpmd_mboard_impl::uptr mpmd_impl::setup_mb( _tree->create(mb_path / "connection") .set(mb->device_info.get("connection", "remote")); - // Do real MTU discovery (something similar like X300 but with MPM) - - _tree->create(mb_path / "mtu/recv").set(1500); - _tree->create(mb_path / "mtu/send").set(1500); _tree->create(mb_path / "link_max_rate").set(1e9 / 8); - // query more information about FPGA/MPM - - - // Query time/clock sources on mboards/dboards - // Throw rpc calls with boost bind into the property tree? - - - // implicit move return mb; } -- cgit v1.2.3