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

Function get_string_value

src/board_controller/board_info_getter.cpp:302–328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300}
301
302static int get_string_value (int board_id, int preset, const char *param_name, char *string,
303 int *len, int max_len, bool use_logger)
304{
305 std::string preset_str = get_preset_str (preset);
306 if (preset_str.empty ())
307 {
308 return (int)BrainFlowExitCodes::INVALID_ARGUMENTS_ERROR;
309 }
310 try
311 {
312 std::string val =
313 boards_struct
314 .brainflow_boards_json["boards"][std::to_string (board_id)][preset_str][param_name];
315 return copy_string_value (val, string, len, max_len, use_logger);
316 }
317 catch (json::exception &e)
318 {
319 if (use_logger)
320 {
321 Board::board_logger->error (
322 "Failed to get board info: {}, usually it means that device has no such channels, "
323 "use get_board_descr method for the info about supported channels",
324 e.what ());
325 }
326 return (int)BrainFlowExitCodes::UNSUPPORTED_BOARD_ERROR;
327 }
328}
329
330static std::string get_preset_str (int preset)
331{

Callers 2

get_eeg_namesFunction · 0.85
get_device_nameFunction · 0.85

Calls 4

get_preset_strFunction · 0.85
copy_string_valueFunction · 0.85
emptyMethod · 0.80
whatMethod · 0.80

Tested by

no test coverage detected