From bb0ada37b3828221a8eddb333ffbf394e1c5debf Mon Sep 17 00:00:00 2001 From: Lionel Gauthier <lionel.gauthier@eurecom.fr> Date: Thu, 9 Apr 2015 09:13:34 +0000 Subject: [PATCH] patches13/0010-docu.patch git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7056 818b1a75-f10b-46b9-bf7c-635c3b92a50f --- targets/ARCH/COMMON/common_lib.h | 11 +++++++++-- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 6 ++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/targets/ARCH/COMMON/common_lib.h b/targets/ARCH/COMMON/common_lib.h index 68a14db161e..fbb5d0e4600 100644 --- a/targets/ARCH/COMMON/common_lib.h +++ b/targets/ARCH/COMMON/common_lib.h @@ -115,10 +115,17 @@ struct openair0_device_t { * use flags = 1 to send as timestamp specfied*/ void (*trx_write_func)(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags); - /* Read 'nsamps' samples from each channel to buffers. buff[0] is the array for + /*! \brief Receive samples from hardware. + * Read \ref nsamps samples from each channel to buffers. buff[0] is the array for * the first channel. *ptimestamp is the time at which the first sample * was received. - * Return the number of sample read */ + * \param device the hardware to use + * \param[out] ptimestamp the time at which the first sample was received. + * \param[out] An array of pointers to buffers for received samples. The buffers must be large enough to hold the number of samples \ref nsamps. + * \param nsamps Number of samples. One sample is 2 byte I + 2 byte Q => 4 byte. + * \param cc Number of channels. If cc == 1, only buff[0] is filled with samples. + * \returns the number of sample read + */ int (*trx_read_func)(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps,int cc); /* Terminate operation of the transceiver -- free all associated resources */ diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index 2fd89394c2b..55d2c10c7a3 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -153,12 +153,14 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp int samples_received=0,i; if (cc>1) { + // receive multiple channels (e.g. RF A and RF B) std::vector<void *> buff_ptrs; for (int i=0;i<cc;i++) buff_ptrs.push_back(buff[i]); samples_received = s->rx_stream->recv(buff_ptrs, nsamps, s->rx_md); - } - else + } else { + // receive a single channel (e.g. from connector RF A) samples_received = s->rx_stream->recv(buff[0], nsamps, s->rx_md); + } if (samples_received < nsamps) { printf("[recv] received %d samples out of %d\n",samples_received,nsamps); -- GitLab