MCPcopy Create free account
hub / github.com/brainflow-dev/brainflow / get_single_value

Function get_single_value

src/board_controller/board_info_getter.cpp:240–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238}
239
240static 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
269static int get_array_value (
270 int board_id, int preset, const char *param_name, int *output_array, int *len, bool use_logger)

Callers 6

get_sampling_rateFunction · 0.85
get_package_num_channelFunction · 0.85
get_marker_channelFunction · 0.85
get_battery_channelFunction · 0.85
get_num_rowsFunction · 0.85
get_timestamp_channelFunction · 0.85

Calls 3

get_preset_strFunction · 0.85
emptyMethod · 0.80
whatMethod · 0.80

Tested by

no test coverage detected