From 38996c7548b64368c80d5f41de47de66c1851178 Mon Sep 17 00:00:00 2001
From: Raymond Knopp <raymond.knopp@eurecom.fr>
Date: Thu, 18 Sep 2014 10:28:38 +0000
Subject: [PATCH] git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5797
 818b1a75-f10b-46b9-bf7c-635c3b92a50f

---
 targets/ARCH/COMMON/common_lib.h             |  2 ++
 targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 12 ++++++++++++
 2 files changed, 14 insertions(+)

diff --git a/targets/ARCH/COMMON/common_lib.h b/targets/ARCH/COMMON/common_lib.h
index 3a1a15617b..652cf1307e 100644
--- a/targets/ARCH/COMMON/common_lib.h
+++ b/targets/ARCH/COMMON/common_lib.h
@@ -116,10 +116,12 @@ extern "C"
 /* return 0 if OK, < 0 if error */
 int openair0_device_init(openair0_device* device, openair0_config_t *openair0_cfg);
 openair0_timestamp get_usrp_time(openair0_device *device);
+  int openair0_set_frequencies(openair0_device* device, openair0_config_t *openair0_cfg);
 }
 #else
 int openair0_device_init(openair0_device* device, openair0_config_t *openair0_cfg);
 openair0_timestamp get_usrp_time(openair0_device *device);
+int openair0_set_frequencies(openair0_device* device, openair0_config_t *openair0_cfg);
 #endif
 
 #endif // COMMON_LIB_H
diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
index 2af10bee75..6c787cab81 100644
--- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
+++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
@@ -174,6 +174,18 @@ static bool is_equal(double a, double b)
 {
   return std::fabs(a-b) < std::numeric_limits<double>::epsilon();
 }
+
+int openair0_set_frequencies(openair0_device* device, openair0_config_t *openair0_cfg) {
+
+  usrp_state_t *s = (usrp_state_t*)device->priv;
+
+  s->usrp->set_tx_freq(openair0_cfg[0].tx_freq[0]);
+  s->usrp->set_rx_freq(openair0_cfg[0].rx_freq[0]);
+
+  return(0);
+  
+}
+
  
 int openair0_device_init(openair0_device* device, openair0_config_t *openair0_cfg)
 {
-- 
GitLab