| 101 | } |
| 102 | |
| 103 | int Callibri::config_board (std::string config, std::string &response) |
| 104 | { |
| 105 | if (device == NULL) |
| 106 | { |
| 107 | return (int)BrainFlowExitCodes::BOARD_NOT_CREATED_ERROR; |
| 108 | } |
| 109 | if (config.empty ()) |
| 110 | { |
| 111 | return (int)BrainFlowExitCodes::INVALID_ARGUMENTS_ERROR; |
| 112 | } |
| 113 | |
| 114 | Command cmd = CommandStartSignal; |
| 115 | bool parsed = false; |
| 116 | if (strcmp (config.c_str (), "CommandStartSignal") == 0) |
| 117 | { |
| 118 | parsed = true; |
| 119 | cmd = CommandStartSignal; |
| 120 | } |
| 121 | if (strcmp (config.c_str (), "CommandStopSignal") == 0) |
| 122 | { |
| 123 | parsed = true; |
| 124 | cmd = CommandStopSignal; |
| 125 | } |
| 126 | if (!parsed) |
| 127 | { |
| 128 | safe_logger (spdlog::level::err, |
| 129 | "Invalid value for config, Supported values: CommandStartSignal, CommandStopSignal"); |
| 130 | return (int)BrainFlowExitCodes::INVALID_ARGUMENTS_ERROR; |
| 131 | } |
| 132 | |
| 133 | int ec = device_execute (device, cmd); |
| 134 | if (ec != SDK_NO_ERROR) |
| 135 | { |
| 136 | char error_msg[1024]; |
| 137 | sdk_last_error_msg (error_msg, 1024); |
| 138 | safe_logger (spdlog::level::err, error_msg); |
| 139 | return (int)BrainFlowExitCodes::GENERAL_ERROR; |
| 140 | } |
| 141 | |
| 142 | return (int)BrainFlowExitCodes::STATUS_OK; |
| 143 | } |
| 144 | |
| 145 | int Callibri::start_stream (int buffer_size, const char *streamer_params) |
| 146 | { |