Commit 38996c75 authored by knopp's avatar knopp

parent 8717057c
...@@ -116,10 +116,12 @@ extern "C" ...@@ -116,10 +116,12 @@ extern "C"
/* return 0 if OK, < 0 if error */ /* return 0 if OK, < 0 if error */
int openair0_device_init(openair0_device* device, openair0_config_t *openair0_cfg); int openair0_device_init(openair0_device* device, openair0_config_t *openair0_cfg);
openair0_timestamp get_usrp_time(openair0_device *device); openair0_timestamp get_usrp_time(openair0_device *device);
int openair0_set_frequencies(openair0_device* device, openair0_config_t *openair0_cfg);
} }
#else #else
int openair0_device_init(openair0_device* device, openair0_config_t *openair0_cfg); int openair0_device_init(openair0_device* device, openair0_config_t *openair0_cfg);
openair0_timestamp get_usrp_time(openair0_device *device); openair0_timestamp get_usrp_time(openair0_device *device);
int openair0_set_frequencies(openair0_device* device, openair0_config_t *openair0_cfg);
#endif #endif
#endif // COMMON_LIB_H #endif // COMMON_LIB_H
...@@ -175,6 +175,18 @@ static bool is_equal(double a, double b) ...@@ -175,6 +175,18 @@ static bool is_equal(double a, double b)
return std::fabs(a-b) < std::numeric_limits<double>::epsilon(); 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) int openair0_device_init(openair0_device* device, openair0_config_t *openair0_cfg)
{ {
uhd::set_thread_priority_safe(1.0); uhd::set_thread_priority_safe(1.0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment