From cbb7e3cea0b925f60c7eefe1b8fce58b2b89f5ff Mon Sep 17 00:00:00 2001
From: Ismael Gomez <ismagom@gmail.com>
Date: Mon, 27 Mar 2017 17:39:49 +0200
Subject: [PATCH] fix for UHD 3.11 logging

---
 srslte/lib/rf/uhd_c_api.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/srslte/lib/rf/uhd_c_api.cpp b/srslte/lib/rf/uhd_c_api.cpp
index c7684aa23..92af48f69 100644
--- a/srslte/lib/rf/uhd_c_api.cpp
+++ b/srslte/lib/rf/uhd_c_api.cpp
@@ -9,6 +9,7 @@ extern "C" {
 #include "uhd_c_api.h"
 }
 
+#if UHD_VERSION < 31100
 static void (*handler)(const char*);
 
 void translate_handler(uhd::msg::type_t type, const std::string & msg)
@@ -16,11 +17,14 @@ void translate_handler(uhd::msg::type_t type, const std::string & msg)
   if(handler)
     handler(msg.c_str());
 }
+#endif
 
 void rf_uhd_register_msg_handler_c(void (*new_handler)(const char*)) 
 {
+#if UHD_VERSION < 31100
   handler = new_handler;
   uhd::msg::register_handler(translate_handler);
+#endif
 }
 
 void uhd_tx_metadata_set_time_spec(uhd_tx_metadata_handle *md, time_t secs, double frac_secs)
-- 
GitLab