srsran_rf: cosmetic changes

This commit is contained in:
Robert Falkenberg 2022-02-18 09:45:26 +01:00
parent 3a73d84294
commit 2570c2ce77
6 changed files with 37 additions and 38 deletions

View File

@ -19,7 +19,7 @@
static srsran_rf_plugin_t plugin_uhd = {"libsrsran_rf_uhd.so", NULL, NULL};
#else
#include "rf_uhd_imp.h"
static srsran_rf_plugin_t plugin_uhd = {"", NULL, &srsran_rf_dev_uhd};
static srsran_rf_plugin_t plugin_uhd = {"", NULL, &srsran_rf_dev_uhd};
#endif
#endif
@ -49,7 +49,7 @@ static srsran_rf_plugin_t plugin_soapy = {"", NULL, &srsran_rf_dev_soapy};
static srsran_rf_plugin_t plugin_zmq = {"libsrsran_rf_zmq.so", NULL, NULL};
#else
#include "rf_zmq_imp.h"
static srsran_rf_plugin_t plugin_zmq = {"", NULL, &srsran_rf_dev_zmq};
static srsran_rf_plugin_t plugin_zmq = {"", NULL, &srsran_rf_dev_zmq};
#endif
#endif
@ -63,7 +63,7 @@ static srsran_rf_plugin_t plugin_file = {"", NULL, &srsran_rf_dev_file};
static srsran_rf_plugin_t plugin_skiq = {"libsrsran_rf_skiq.so", NULL, NULL};
#else
#include "rf_skiq_imp.h"
static srsran_rf_plugin_t plugin_skiq = {"", NULL, &srsran_rf_dev_skiq};
static srsran_rf_plugin_t plugin_skiq = {"", NULL, &srsran_rf_dev_skiq};
#endif
#endif
@ -85,7 +85,6 @@ static srsran_rf_plugin_t plugin_dummy = {"", NULL, &srsran_rf_dev_dummy};
#endif
/**
* Collection of all currently available RF plugins
*/

View File

@ -129,6 +129,7 @@ SRSRAN_API int rf_file_send_timed_multi(void* h,
* @param[in] base_srate Sample rate of RX and TX files
* @return SRSRAN_SUCCESS on success, otherwise error code
*/
SRSRAN_API int rf_file_open_file(void** h, FILE** rx_files, FILE** tx_files, uint32_t nof_channels, uint32_t base_srate);
SRSRAN_API int
rf_file_open_file(void** h, FILE** rx_files, FILE** tx_files, uint32_t nof_channels, uint32_t base_srate);
#endif // SRSRAN_RF_FILE_IMP_H

View File

@ -19,7 +19,7 @@
extern "C" {
#endif
SRSRAN_API int register_plugin(rf_dev_t **rf_api);
SRSRAN_API int register_plugin(rf_dev_t** rf_api);
#ifdef __cplusplus
}

View File

@ -26,8 +26,8 @@
#include <SoapySDR/Formats.h>
#include <SoapySDR/Logger.h>
#include <SoapySDR/Time.h>
#include <SoapySDR/Version.h>
#include <SoapySDR/Types.h>
#include <SoapySDR/Version.h>
#define HAVE_ASYNC_THREAD 0
@ -854,7 +854,7 @@ int rf_soapy_recv_with_time_multi(void* h,
int rf_soapy_recv_with_time(void* h, void* data, uint32_t nsamples, bool blocking, time_t* secs, double* frac_secs)
{
void* data_multi[SRSRAN_MAX_PORTS] = {NULL};
data_multi[0] = data;
data_multi[0] = data;
return rf_soapy_recv_with_time_multi(h, data_multi, nsamples, blocking, secs, frac_secs);
}

View File

@ -962,7 +962,7 @@ int rf_zmq_send_timed_multi(void* h,
}
// Scale according to current gain
srsran_vec_sc_prod_cfc(buf, tx_gain, buf, nsamples_baseband);
srsran_vec_sc_prod_cfc(buf, tx_gain, buf, nsamples_baseband);
// Finally, transmit baseband
int n = rf_zmq_tx_baseband(&handler->transmitter[i], buf, nsamples_baseband);

View File

@ -93,12 +93,11 @@ void enb_tx_function(const char* tx_args, bool timed_tx)
// send data subframe per subframe
uint32_t num_txed_samples = 0;
// initial transmission without ts
void* data_ptr[SRSRAN_MAX_PORTS] = {NULL};
cf_t tx_buffer[NOF_RX_ANT][SF_LEN];
cf_t tx_buffer[NOF_RX_ANT][SF_LEN];
for (int c = 0; c < NOF_RX_ANT; c++) {
memcpy(&tx_buffer[c], &enb_tx_buffer[c][num_txed_samples], SF_LEN * sizeof (cf_t));
memcpy(&tx_buffer[c], &enb_tx_buffer[c][num_txed_samples], SF_LEN * sizeof(cf_t));
data_ptr[c] = &tx_buffer[c][0];
}
int ret = srsran_rf_send_multi(&enb_radio, (void**)data_ptr, SF_LEN, true, true, false);
@ -116,7 +115,7 @@ void enb_tx_function(const char* tx_args, bool timed_tx)
// prepare data buffer
for (int c = 0; c < NOF_RX_ANT; c++) {
memcpy(&tx_buffer[c], &enb_tx_buffer[c][num_txed_samples], SF_LEN * sizeof (cf_t));
memcpy(&tx_buffer[c], &enb_tx_buffer[c][num_txed_samples], SF_LEN * sizeof(cf_t));
data_ptr[c] = &tx_buffer[c][0];
}
@ -235,34 +234,34 @@ int param_test(const char* args_param, const int num_channels)
int main()
{
srsran_rf_load_plugins();
// // two Rx ports
// if (param_test("rx_port=ipc://dl0,rx_port1=ipc://dl1", 2)) {
// fprintf(stderr, "Param test failed!\n");
// return SRSRAN_ERROR;
// }
// // two Rx ports
// if (param_test("rx_port=ipc://dl0,rx_port1=ipc://dl1", 2)) {
// fprintf(stderr, "Param test failed!\n");
// return SRSRAN_ERROR;
// }
// // multiple rx ports, no channel index provided
// if (param_test("rx_port=ipc://dl0,rx_port=ipc://dl1,rx_port=ipc://dl2,rx_port=ipc://dl3,base_srate=1.92e6", 4)) {
// fprintf(stderr, "Param test failed!\n");
// return SRSRAN_ERROR;
// }
// // multiple rx ports, no channel index provided
// if (param_test("rx_port=ipc://dl0,rx_port=ipc://dl1,rx_port=ipc://dl2,rx_port=ipc://dl3,base_srate=1.92e6", 4)) {
// fprintf(stderr, "Param test failed!\n");
// return SRSRAN_ERROR;
// }
// // One Rx, one Tx and all generic options
// if (param_test("rx_port0=tcp://"
// "localhost:2000,rx_format=sc16,tx_format=sc16,tx_type=pub,rx_type=sub,base_srate=1.92e6,id=test",
// 1)) {
// fprintf(stderr, "Param test failed!\n");
// return SRSRAN_ERROR;
// }
// // One Rx, one Tx and all generic options
// if (param_test("rx_port0=tcp://"
// "localhost:2000,rx_format=sc16,tx_format=sc16,tx_type=pub,rx_type=sub,base_srate=1.92e6,id=test",
// 1)) {
// fprintf(stderr, "Param test failed!\n");
// return SRSRAN_ERROR;
// }
// // 1 port, 2 antennas, MIMO freq config
// if (param_test(
// "tx_port0=tcp://*:2001,tx_port1=tcp://*:2003,rx_port0=tcp://localhost:2000,rx_port1=tcp://"
// "localhost:2002,id=ue,base_srate=23.04e6,tx_freq0=2510e6,tx_freq1=2510e6,rx_freq0=2630e6,,rx_freq1=2630e6",
// 2)) {
// fprintf(stderr, "Param test failed!\n");
// return SRSRAN_ERROR;
// }
// // 1 port, 2 antennas, MIMO freq config
// if (param_test(
// "tx_port0=tcp://*:2001,tx_port1=tcp://*:2003,rx_port0=tcp://localhost:2000,rx_port1=tcp://"
// "localhost:2002,id=ue,base_srate=23.04e6,tx_freq0=2510e6,tx_freq1=2510e6,rx_freq0=2630e6,,rx_freq1=2630e6",
// 2)) {
// fprintf(stderr, "Param test failed!\n");
// return SRSRAN_ERROR;
// }
#if NOF_RX_ANT == 1
// single tx, single rx with continuous transmissions (no timed tx) using IPC transport