-
-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add multiple streamers per preset Signed-off-by: Andrey Parfenov <a1994ndrey@gmail.com> Co-authored-by: Romain Chaumontet <romain.chaumontet@unikie.com> Co-authored-by: Andrey Parfenov <a1994ndrey@gmail.com>
- Loading branch information
1 parent
7f32586
commit e826aa8
Showing
6 changed files
with
94 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#include <iostream> | ||
#include <stdlib.h> | ||
#include <string> | ||
|
||
#ifdef _WIN32 | ||
#include <windows.h> | ||
#else | ||
#include <unistd.h> | ||
#endif | ||
|
||
#include "board_shim.h" | ||
|
||
|
||
int main (int argc, char *argv[]) | ||
{ | ||
BoardShim::enable_dev_board_logger (); | ||
|
||
struct BrainFlowInputParams params; | ||
int board_id = (int)BoardIds::SYNTHETIC_BOARD; | ||
int res = 0; | ||
|
||
BoardShim *board = new BoardShim (board_id, params); | ||
|
||
try | ||
{ | ||
board->prepare_session (); | ||
board->add_streamer ("file://streamer_default_1.csv:w"); | ||
board->add_streamer ("file://streamer_default_2.csv:w"); | ||
board->add_streamer ( | ||
"file://streamer_aux_1.csv:w", (int)BrainFlowPresets::AUXILIARY_PRESET); | ||
board->add_streamer ( | ||
"file://streamer_aux_2.csv:w", (int)BrainFlowPresets::AUXILIARY_PRESET); | ||
board->start_stream (); | ||
|
||
#ifdef _WIN32 | ||
Sleep (5000); | ||
#else | ||
sleep (5); | ||
#endif | ||
|
||
board->stop_stream (); | ||
board->release_session (); | ||
} | ||
catch (const BrainFlowException &err) | ||
{ | ||
BoardShim::log_message ((int)LogLevels::LEVEL_ERROR, err.what ()); | ||
res = err.exit_code; | ||
if (board->is_prepared ()) | ||
{ | ||
board->release_session (); | ||
} | ||
} | ||
|
||
delete board; | ||
|
||
return res; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ class Streamer | |
{ | ||
this->len = len; | ||
} | ||
|
||
virtual ~Streamer () | ||
{ | ||
} | ||
|