LMS API Documentation  v18.06.0
Sample Streaming functions

Data Structures

struct  lms_stream_meta_t
 
struct  lms_stream_t
 
struct  lms_stream_status_t
 

Functions

API_EXPORT int CALL_CONV LMS_SetupStream (lms_device_t *device, lms_stream_t *stream)
 
API_EXPORT int CALL_CONV LMS_DestroyStream (lms_device_t *dev, lms_stream_t *stream)
 
API_EXPORT int CALL_CONV LMS_StartStream (lms_stream_t *stream)
 
API_EXPORT int CALL_CONV LMS_StopStream (lms_stream_t *stream)
 
API_EXPORT int CALL_CONV LMS_RecvStream (lms_stream_t *stream, void *samples, size_t sample_count, lms_stream_meta_t *meta, unsigned timeout_ms)
 
API_EXPORT int CALL_CONV LMS_GetStreamStatus (lms_stream_t *stream, lms_stream_status_t *status)
 
API_EXPORT int CALL_CONV LMS_SendStream (lms_stream_t *stream, const void *samples, size_t sample_count, const lms_stream_meta_t *meta, unsigned timeout_ms)
 
API_EXPORT int CALL_CONV LMS_UploadWFM (lms_device_t *device, const void **samples, uint8_t chCount, size_t sample_count, int format)
 
API_EXPORT int CALL_CONV LMS_EnableTxWFM (lms_device_t *device, unsigned chan, bool active)
 

Detailed Description

The functions in this section provides support for sending and receiving IQ data samples.

Function Documentation

API_EXPORT int CALL_CONV LMS_DestroyStream ( lms_device_t dev,
lms_stream_t stream 
)

Deallocate memory used by stream.

Parameters
devDevice handle previously obtained by LMS_Open().
streamStream structure previously initialized with LMS_SetupStream().
Returns
0 on success, (-1) on failure
API_EXPORT int CALL_CONV LMS_EnableTxWFM ( lms_device_t device,
unsigned  chan,
bool  active 
)

Enables/Disables transmitting of uploaded waveform

Parameters
deviceDevice handle previously obtained by LMS_Open().
chanChannel index
activeEnable/Disable waveform playback
Returns
0 on success, (-1) on failure
API_EXPORT int CALL_CONV LMS_GetStreamStatus ( lms_stream_t stream,
lms_stream_status_t status 
)

Get stream operation status

Parameters
streamstructure previously initialized with LMS_SetupStream().
statusStream status. See the lms_stream_status_t for description
Returns
0 on success, (-1) on failure
API_EXPORT int CALL_CONV LMS_RecvStream ( lms_stream_t stream,
void *  samples,
size_t  sample_count,
lms_stream_meta_t meta,
unsigned  timeout_ms 
)

Read samples from the FIFO of the specified stream. Sample buffer must be big enough to hold requested number of samples.

Parameters
streamstructure previously initialized with LMS_SetupStream().
samplessample buffer.
sample_countNumber of samples to read
metaMetadata. See the lms_stream_meta_t description.
timeout_mshow long to wait for data before timing out.
Returns
number of samples received on success, (-1) on failure
API_EXPORT int CALL_CONV LMS_SendStream ( lms_stream_t stream,
const void *  samples,
size_t  sample_count,
const lms_stream_meta_t meta,
unsigned  timeout_ms 
)

Write samples to the FIFO of the specified stream.

Parameters
streamstructure previously initialized with LMS_SetupStream().
samplessample buffer.
sample_countNumber of samples to write
metaMetadata. See the lms_stream_meta_t description.
timeout_mshow long to wait for data before timing out.
Returns
number of samples send on success, (-1) on failure
API_EXPORT int CALL_CONV LMS_SetupStream ( lms_device_t device,
lms_stream_t stream 
)

Create new stream based on parameters passed in configuration structure. The structure is initialized with stream handle.

Parameters
deviceDevice handle previously obtained by LMS_Open().
streamStream configuration .See the lms_stream_t description.
Returns
0 on success, (-1) on failure
API_EXPORT int CALL_CONV LMS_StartStream ( lms_stream_t stream)

Start stream

Parameters
streamStream structure previously initialized with LMS_SetupStream().
Returns
0 on success, (-1) on failure
API_EXPORT int CALL_CONV LMS_StopStream ( lms_stream_t stream)

Stop stream

Parameters
streamStream structure previously initialized with LMS_SetupStream().
Returns
0 on success, (-1) on failure
API_EXPORT int CALL_CONV LMS_UploadWFM ( lms_device_t device,
const void **  samples,
uint8_t  chCount,
size_t  sample_count,
int  format 
)

Uploads waveform to on board memory for later use

Parameters
deviceDevice handle previously obtained by LMS_Open().
samplesmultiple channel samples data
chCountnumber of waveform channels
sample_countnumber of samples in each channel
formatwaveform data format
Returns
0 on success, (-1) on failure