LMS API Documentation  v20.01.0
Sample Streaming functions

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

Modules

 Additional streaming options
 These can be combined with lms_stream_t::channel to enable additional streaming options.
 

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

◆ LMS_DestroyStream()

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

◆ LMS_EnableTxWFM()

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

◆ LMS_GetStreamStatus()

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

◆ LMS_RecvStream()

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

◆ LMS_SendStream()

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

◆ LMS_SetupStream()

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

◆ LMS_StartStream()

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

◆ LMS_StopStream()

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

◆ LMS_UploadWFM()

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 (1 or 2).
sample_countnumber of samples in each channel. Must be multiple of 4
formatwaveform data format: 0 - int16 [-2048, 2047], 1 - int16 [-32768, 32767] 2 - float [-1.0, 1.0]
Returns
0 on success, (-1) on failure