Commit bb0ada37 authored by gauthier's avatar gauthier

patches13/0010-docu.patch

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7056 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 3baf81cd
......@@ -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 */
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment