Skip to content

Namespace lsl

Namespace List > lsl

Classes

Type Name
class continuous_resolver
class lost_error
Exception class that indicates that a stream inlet's source has been irrecoverably lost.
class stream_info
class stream_inlet
class stream_outlet
class timeout_error
Exception class that indicates that an operation failed due to a timeout.
class xml_element

Public Types

Type Name
enum channel_format_t
Data format of a channel (each transmitted sample holds an array of channels).
enum processing_options_t
Post-processing options for stream inlets.

Public Attributes

Type Name
const double DEDUCED_TIMESTAMP = -1.0
const double FOREVER = 32000000.0
const double IRREGULAR_RATE = 0.0
Constant to indicate that a stream has variable sampling rate.

Public Functions

Type Name
const char * base_version ()
int32_t check_error (int32_t ec)
Assert that no error happened; throw appropriate exception otherwise.
const char * full_version ()
bool is_secure_build ()
const char * library_info ()
int32_t library_version ()
double local_clock ()
bool local_security_enabled ()
const char * local_security_fingerprint ()
int32_t protocol_version ()
std::vector< stream_info > resolve_stream (const std::string & prop, const std::string & value, int32_t minimum=1, double timeout=FOREVER)
std::vector< stream_info > resolve_stream (const std::string & pred, int32_t minimum=1, double timeout=FOREVER)
std::vector< stream_info > resolve_streams (double wait_time=1.0)
bool security_is_locked ()
bool security_unlock (const char * passphrase)
const char * security_version ()

Public Types Documentation

enum channel_format_t

Data format of a channel (each transmitted sample holds an array of channels).

enum lsl::channel_format_t {
    cf_float32 = 1,
    cf_double64 = 2,
    cf_string = 3,
    cf_int32 = 4,
    cf_int16 = 5,
    cf_int8 = 6,
    cf_int64 = 7,
    cf_undefined = 0
};


enum processing_options_t

Post-processing options for stream inlets.

enum lsl::processing_options_t {
    post_none = 0,
    post_clocksync = 1,
    post_dejitter = 2,
    post_monotonize = 4,
    post_threadsafe = 8,
    post_ALL = 1 | 2 | 4 | 8
};


Public Attributes Documentation

variable DEDUCED_TIMESTAMP

const double lsl::DEDUCED_TIMESTAMP;

Constant to indicate that a sample has the next successive time stamp.

This is an optional optimization to transmit less data per sample. The stamp is then deduced from the preceding one according to the stream's sampling rate (in the case of an irregular rate, the same time stamp as before will is assumed).


variable FOREVER

const double lsl::FOREVER;

A very large time duration (> 1 year) for timeout values.

Note that significantly larger numbers can cause the timeout to be invalid on some operating systems (e.g., 32-bit UNIX).


variable IRREGULAR_RATE

Constant to indicate that a stream has variable sampling rate.

const double lsl::IRREGULAR_RATE;


Public Functions Documentation

function base_version

inline const char * lsl::base_version () 

function check_error

Assert that no error happened; throw appropriate exception otherwise.

inline int32_t lsl::check_error (
    int32_t ec
) 

Check error codes returned from the C interface and translate into appropriate exceptions.


function full_version

inline const char * lsl::full_version () 

function is_secure_build

inline bool lsl::is_secure_build () 

function library_info

inline const char * lsl::library_info () 

Get a string containing library information.

The format of the string shouldn't be used for anything important except giving a a debugging person a good idea which exact library version is used.


function library_version

inline int32_t lsl::library_version () 

function local_clock

inline double lsl::local_clock () 

Obtain a local system time stamp in seconds.

The resolution is better than a millisecond. This reading can be used to assign time stamps to samples as they are being acquired. If the "age" of a sample is known at a particular time (e.g., from USB transmission delays), it can be used as an offset to local_clock() to obtain a better estimate of when a sample was actually captured. See stream_outlet::push_sample() for a use case.


function local_security_enabled

inline bool lsl::local_security_enabled () 

function local_security_fingerprint

inline const char * lsl::local_security_fingerprint () 

function protocol_version

inline int32_t lsl::protocol_version () 

Protocol version.

The major version is protocol_version() / 100; The minor version is protocol_version() % 100; Clients with different minor versions are protocol-compatible with each other while clients with different major versions will refuse to work together.


function resolve_stream

inline std::vector< stream_info > lsl::resolve_stream (
    const std::string & prop,
    const std::string & value,
    int32_t minimum=1,
    double timeout=FOREVER
) 

Resolve all streams with a specific value for a given property. If the goal is to resolve a specific stream, this method is preferred over resolving all streams and then selecting the desired one.

Parameters:

  • prop The stream_info property that should have a specific value (e.g., "name", "type", "source_id", or "desc/manufaturer").
  • value The string value that the property should have (e.g., "EEG" as the type property).
  • minimum Return at least this number of streams.
  • timeout Optionally a timeout of the operation, in seconds (default: no timeout). If the timeout expires, less than the desired number of streams (possibly none) will be returned.

Returns:

A vector of matching stream info objects (excluding their meta-data), any of which can subsequently be used to open an inlet.


function resolve_stream

inline std::vector< stream_info > lsl::resolve_stream (
    const std::string & pred,
    int32_t minimum=1,
    double timeout=FOREVER
) 

Resolve all streams that match a given predicate.

Advanced query that allows to impose more conditions on the retrieved streams; the given string is an XPath 1.0 predicate for the <info> node (omitting the surrounding []'s)

Parameters:

  • pred The predicate string, e.g. name='BioSemiortype='EEG' and starts-with(name,'BioSemi') and count(info/desc/channel)=32`
  • minimum Return at least this number of streams.
  • timeout Optionally a timeout of the operation, in seconds (default: no timeout). If the timeout expires, less than the desired number of streams (possibly none) will be returned.

Returns:

A vector of matching stream info objects (excluding their meta-data), any of which can subsequently be used to open an inlet.


function resolve_streams

inline std::vector< stream_info > lsl::resolve_streams (
    double wait_time=1.0
) 

Resolve all streams on the network. This function returns all currently available streams from any outlet on the network. The network is usually the subnet specified at the local router, but may also include a multicast group of machines (given that the network supports it), or list of hostnames. These details may optionally be customized by the experimenter in a configuration file (see Network Connectivity in the LSL wiki). This is the default mechanism used by the browsing programs and the recording program.

Parameters:

  • wait_time The waiting time for the operation, in seconds, to search for streams. If this is too short (<0.5s) only a subset (or none) of the outlets that are present on the network may be returned.

Returns:

A vector of stream info objects (excluding their desc field), any of which can subsequently be used to open an inlet. The full info can be retrieve from the inlet.


function security_is_locked

inline bool lsl::security_is_locked () 

function security_unlock

inline bool lsl::security_unlock (
    const char * passphrase
) 

function security_version

inline const char * lsl::security_version () 


The documentation for this class was generated from the following file liblsl/include/lsl_cpp.h