Publish with LSL¶
Together with the EEG data read from the hardware via the iobuffer interface, additional information can be published depending on the application use case.
Generally, the first channel is the sample index, followed by EEG data, followed by an appendix, e.g. phase, power, triggerstate etc.
On your local measurement PC, use on of the available LSL interfaces, e.g. pylsl, to connect with this data stream.
Defines
-
OUTLET_NAME
The name of the outlet. Defaults to LuckyLoop
-
OUTLET_CHANNEL_COUNT
The number of channels published with LSL
-
MAX_APPENDIX_COUNT
the maximal number of appendable items for publication with LSL, given the number of EEG channels defined by the connected iobuffered hardware.
Functions
-
void
stack_outlet_sample
(int32_t *outlet_sample, const int32_t sample_index, const int32_t *eegsample, const int32_t *appendix) stack different items for publication with an LSL outlet order of array will be in order of the arguments, i.e. index, eeg, appendix.
- Parameters
outlet_sample – array of data to be published with LSL, items will be stacked into this array
sample_index – monotonic count index of the current sample
eeg_sample – array with the current EEG samples
appendix – array with additional values to be appended after the EEG samples
-
void
stack_variadic
(int32_t *stacked, const int variadic_count, ...) stack different items for publication with an LSL outlet
- Parameters
stacked – array to be stacked into
variadic_count – how many single items will be appended after the appendix.
variadic – appendix of len variadic_count. each item must be of type int32_t
-
lsl_outlet
init_lsl_outlet
() initialize the LSL outlet for publishing
-
unsigned int
aton
(char *ipaddress) convert an IP-address string to unsigned interer
-
char *
get_adapter_address
(char *adaptername, size_t name_len) get the IP address of an adapter specified by its name
- Parameters
adaptername – the name of the adapter, e.h. eth0, eth1 or enp5s0
name_len – the length of the adaptername string
- Returns
the ip address as a string. convert it to an integer with aton