master
ismagom 11 years ago
commit 7f42343215

@ -25,6 +25,7 @@ IF(UHD_FOUND)
ADD_LIBRARY(cuhd cuhd_imp.cpp cuhd_utils.c) ADD_LIBRARY(cuhd cuhd_imp.cpp cuhd_utils.c)
INCLUDE_DIRECTORIES(${UHD_INCLUDE_DIRS}) INCLUDE_DIRECTORIES(${UHD_INCLUDE_DIRS})
LINK_DIRECTORIES(${UHD_LIBRARY_DIRS})
TARGET_LINK_LIBRARIES(cuhd ${UHD_LIBRARIES}) TARGET_LINK_LIBRARIES(cuhd ${UHD_LIBRARIES})
LIBLTE_SET_PIC(cuhd) LIBLTE_SET_PIC(cuhd)
@ -38,6 +39,3 @@ ELSE(UHD_FOUND)
MESSAGE(STATUS " UHD driver not found. CUHD library is not generated") MESSAGE(STATUS " UHD driver not found. CUHD library is not generated")
ENDIF(UHD_FOUND) ENDIF(UHD_FOUND)

@ -46,7 +46,18 @@ typedef _Complex float complex_t;
bool isLocked(void *h) bool isLocked(void *h)
{ {
cuhd_handler* handler = static_cast<cuhd_handler*>(h); cuhd_handler* handler = static_cast<cuhd_handler*>(h);
std::vector<std::string> mb_sensors = handler->usrp->get_mboard_sensor_names();
std::vector<std::string> rx_sensors = handler->usrp->get_rx_sensor_names(0);
if(std::find(rx_sensors.begin(), rx_sensors.end(), "lo_locked") != rx_sensors.end()) {
return handler->usrp->get_rx_sensor("lo_locked", 0).to_bool(); return handler->usrp->get_rx_sensor("lo_locked", 0).to_bool();
}
else if(std::find(mb_sensors.begin(), mb_sensors.end(), "ref_locked") != mb_sensors.end()) {
return handler->usrp->get_mboard_sensor("ref_locked", 0).to_bool();
}
else {
usleep(500);
return true;
}
} }
bool cuhd_rx_wait_lo_locked(void *h) bool cuhd_rx_wait_lo_locked(void *h)
@ -190,4 +201,3 @@ int cuhd_send(void *h, void *data, int nsamples, int blocking) {
return handler->tx_stream->send(data, nsamples, md, 0.0); return handler->tx_stream->send(data, nsamples, md, 0.0);
} }
} }

@ -38,6 +38,7 @@ target_link_libraries(ll_example lte)
add_executable(synch_file synch_file.c) add_executable(synch_file synch_file.c)
target_link_libraries(synch_file lte) target_link_libraries(synch_file lte)
LINK_DIRECTORIES(${UHD_LIBRARY_DIRS})
################################################################# #################################################################
# Check if UHD C-API and Graphics library are available # Check if UHD C-API and Graphics library are available
@ -94,4 +95,3 @@ IF(${CUHD_FIND} GREATER -1)
ELSE(${CUHD_FIND} GREATER -1) ELSE(${CUHD_FIND} GREATER -1)
MESSAGE(STATUS " UHD examples NOT INSTALLED: CUHD library not compiled.") MESSAGE(STATUS " UHD examples NOT INSTALLED: CUHD library not compiled.")
ENDIF(${CUHD_FIND} GREATER -1) ENDIF(${CUHD_FIND} GREATER -1)

Loading…
Cancel
Save