ZMQ module uses default base srate

This commit is contained in:
Xavier Arteaga 2020-04-27 13:02:55 +02:00 committed by Andre Puschmann
parent 1bbf1caabc
commit 28b2a69c8a
2 changed files with 13 additions and 4 deletions

View File

@ -100,7 +100,12 @@ static inline int parse_double(char* args, const char* config_arg_base, int chan
{
char tmp_value[RF_PARAM_LEN] = {0};
int ret = parse_string(args, config_arg_base, channel_index, tmp_value);
*value = strtod(tmp_value, NULL);
// Copy parsed value only if was found, otherwise it keeps the default
if (ret == SRSLTE_SUCCESS) {
*value = strtod(tmp_value, NULL);
}
return ret;
}
@ -108,7 +113,11 @@ static inline int parse_uint32(char* args, const char* config_arg_base, int chan
{
double tmp_value;
int ret = parse_double(args, config_arg_base, channel_index, &tmp_value);
*value = tmp_value;
// Copy parsed value only if was found, otherwise it keeps the default
if (ret == SRSLTE_SUCCESS) {
*value = tmp_value;
}
return ret;
}

View File

@ -673,7 +673,7 @@ int rf_zmq_recv_with_time_multi(void* h,
}
// copy from rx buffer as many samples as requested into provided buffer
bool completed = false;
bool completed = false;
int32_t count[SRSLTE_MAX_CHANNELS] = {};
while (!completed) {
uint32_t completed_count = 0;
@ -805,7 +805,7 @@ int rf_zmq_send_timed_multi(void* h,
int ret = SRSLTE_ERROR;
if (h && data && nsamples > 0) {
rf_zmq_handler_t* handler = (rf_zmq_handler_t*)h;
rf_zmq_handler_t* handler = (rf_zmq_handler_t*)h;
// Map ports to data buffers according to the selected frequencies
pthread_mutex_lock(&handler->tx_config_mutex);