aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/rfnoc/epid_allocator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/rfnoc/epid_allocator.cpp')
-rw-r--r--host/lib/rfnoc/epid_allocator.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/host/lib/rfnoc/epid_allocator.cpp b/host/lib/rfnoc/epid_allocator.cpp
index 984b1716e..97a30dc64 100644
--- a/host/lib/rfnoc/epid_allocator.cpp
+++ b/host/lib/rfnoc/epid_allocator.cpp
@@ -27,7 +27,19 @@ sep_id_t epid_allocator::allocate_epid(const sep_addr_t& addr)
}
}
-sep_addr_t epid_allocator::lookup_epid(const sep_id_t& epid) const
+sep_id_t epid_allocator::get_epid(const sep_addr_t& addr)
+{
+ std::lock_guard<std::mutex> lock(_mutex);
+
+ if (_epid_map.count(addr) != 0) {
+ return _epid_map.at(addr);
+ } else {
+ throw uhd::lookup_error(
+ "An EPID has not been allocated for the requested endpoint");
+ }
+}
+
+sep_addr_t epid_allocator::lookup_addr(const sep_id_t& epid) const
{
std::lock_guard<std::mutex> lock(_mutex);