pub unsafe extern "C" fn SoapySDRDevice_setupStream(
device: *mut SoapySDRDevice,
direction: c_int,
format: *const c_char,
channels: *const usize,
numChans: usize,
args: *const SoapySDRKwargs,
) -> *mut SoapySDRStreamExpand description
Initialize a stream given a list of channels and stream arguments.
The implementation may change switches or power-up components. All stream API calls should be usable with the new stream object after setupStream() is complete, regardless of the activity state.
The API allows any number of simultaneous TX and RX streams, but many dual-channel devices are limited to one stream in each direction, using either one or both channels. This call will return an error if an unsupported combination is requested, or if a requested channel in this direction is already in use by another stream.
When multiple channels are added to a stream, they are typically expected to have the same sample rate. See SoapySDRDevice_setSampleRate().
\param device a pointer to a device instance
\param direction the channel direction (SOAPY_SDR_RX or SOAPY_SDR_TX)
\param format A string representing the desired buffer format in readStream() / writeStream().
The first character selects the number type:
- “C” means complex
- “F” means floating point
- “S” means signed integer
- “U” means unsigned integer
The type character is followed by the number of bits per number (complex is 2x this size per sample)
Example format strings:
- “CF32” - complex float32 (8 bytes per element)
- “CS16” - complex int16 (4 bytes per element)
- “CS12” - complex int12 (3 bytes per element)
- “CS4” - complex int4 (1 byte per element)
- “S32” - int32 (4 bytes per element)
- “U8” - uint8 (1 byte per element)
\param channels a list of channels or empty for automatic \param numChans the number of elements in the channels array \param args stream args or empty for defaults.
Recommended keys to use in the args dictionary:
- “WIRE” - format of the samples between device and host
\return the stream pointer or nullptr for failure.
The returned stream is not required to have internal locking, and may not be used concurrently from multiple threads.