|
|
|
@ -41,13 +41,13 @@ int rf_get_available_devices(char **devnames, int max_strlen) {
|
|
|
|
|
|
|
|
|
|
double srslte_rf_set_rx_gain_th(srslte_rf_t *rf, double gain)
|
|
|
|
|
{
|
|
|
|
|
if (gain > rf->new_rx_gain + 2 || gain < rf->new_rx_gain - 2) {
|
|
|
|
|
if (gain > rf->cur_rx_gain + 2 || gain < rf->cur_rx_gain - 2){
|
|
|
|
|
pthread_mutex_lock(&rf->mutex);
|
|
|
|
|
rf->new_rx_gain = gain;
|
|
|
|
|
pthread_cond_signal(&rf->cond);
|
|
|
|
|
pthread_mutex_unlock(&rf->mutex);
|
|
|
|
|
}
|
|
|
|
|
return gain;
|
|
|
|
|
return rf->cur_rx_gain;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void srslte_rf_set_tx_rx_gain_offset(srslte_rf_t *rf, double offset) {
|
|
|
|
@ -65,8 +65,9 @@ static void* thread_gain_fcn(void *h) {
|
|
|
|
|
pthread_cond_wait(&rf->cond, &rf->mutex);
|
|
|
|
|
}
|
|
|
|
|
if (rf->new_rx_gain != rf->cur_rx_gain) {
|
|
|
|
|
rf->cur_rx_gain = rf->new_rx_gain;
|
|
|
|
|
srslte_rf_set_rx_gain(h, rf->cur_rx_gain);
|
|
|
|
|
srslte_rf_set_rx_gain(h, rf->new_rx_gain);
|
|
|
|
|
rf->cur_rx_gain = srslte_rf_get_rx_gain(h);
|
|
|
|
|
rf->new_rx_gain = rf->cur_rx_gain;
|
|
|
|
|
}
|
|
|
|
|
if (rf->tx_gain_same_rx) {
|
|
|
|
|
printf("setting also tx\n");
|
|
|
|
|