| 238 | } |
| 239 | |
| 240 | static int get_single_value ( |
| 241 | int board_id, int preset, const char *param_name, int *value, bool use_logger) |
| 242 | { |
| 243 | std::string preset_str = get_preset_str (preset); |
| 244 | if (preset_str.empty ()) |
| 245 | { |
| 246 | return (int)BrainFlowExitCodes::INVALID_ARGUMENTS_ERROR; |
| 247 | } |
| 248 | try |
| 249 | { |
| 250 | int val = |
| 251 | (int)boards_struct |
| 252 | .brainflow_boards_json["boards"][std::to_string (board_id)][preset_str][param_name]; |
| 253 | *value = val; |
| 254 | return (int)BrainFlowExitCodes::STATUS_OK; |
| 255 | } |
| 256 | catch (json::exception &e) |
| 257 | { |
| 258 | if (use_logger) |
| 259 | { |
| 260 | Board::board_logger->error ( |
| 261 | "Failed to get board info: {}, usually it means that device has no such channels, " |
| 262 | "use get_board_descr method for the info about supported channels", |
| 263 | e.what ()); |
| 264 | } |
| 265 | return (int)BrainFlowExitCodes::UNSUPPORTED_BOARD_ERROR; |
| 266 | } |
| 267 | } |
| 268 | |
| 269 | static int get_array_value ( |
| 270 | int board_id, int preset, const char *param_name, int *output_array, int *len, bool use_logger) |
no test coverage detected