Online lab streaming layer support#205
Conversation
| end | ||
| case 'lsl', | ||
| if ~isempty(control_signal), | ||
| data_feedback.opt.outlet.push_sample(control_signal{2}(1)); |
There was a problem hiding this comment.
Better write control_signal{:} like in the UDP case. What types of data does the push_sample function accept as input?
There was a problem hiding this comment.
control_signal{:} gives a key value pair and the stream only accepts floats the way it is initialized.. You can either define strings like markers or actual values for a stream and thats all it takes then. we could think about adopting the whole architecture to have 2 streams or similar...
There was a problem hiding this comment.
control_signal is only a key value pair in the pyff convention. For the feedbacks programmed in processing, it is a cell containing a double. I think that's the better way here. It makes no sense to create a key value pair, if the key is just discarded.
There was a problem hiding this comment.
So shall we change change the pyff ccontrol message to send the key value pair by default within sendControl and so the sendControl only getting the value (my vote) or shall we handle every feedback receiver differently?
| case 'tobi_c', | ||
| send_tobi_c_udp('init', bbci_feedback.host, bbci_feedback.port); | ||
| case 'lsl', | ||
| lib = lsl_loadlib(); |
There was a problem hiding this comment.
Since LSL is not part of the BBCI toolbox, we need to do something here. The preferred way is to include the LSL toolbox in the
bbci_import_dependencies.m
if that is not done yet.
Insert
util_loadLSL();
above and add a function like the following to the toolbox:
function util_loadLSL()
if ~exist('lsl_loadlib', 'file'),
global BTB
lslDir= fullfile(BTB.Dir, 'external/liblsl-Matlab');
if exist(lslDir, 'dir'),
addpath(genpath(lslDir));
else
error(sprintf('LSL library expected in %s.\nDownload manually or use bbci_import_dependencies(''LSL')', lslDir));
end
end
The same function should be called in bbci_acquire_lsl.m
There was a problem hiding this comment.
I'll look into this
BenjaminBlankertz
left a comment
There was a problem hiding this comment.
Great work, thank you! I have two small requests added.
added functions for labstreaming layer (lsl) online toolbox support for feedback