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

Function get_array_value

src/board_controller/board_info_getter.cpp:269–300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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)
271{
272 std::string preset_str = get_preset_str (preset);
273 if (preset_str.empty ())
274 {
275 return (int)BrainFlowExitCodes::INVALID_ARGUMENTS_ERROR;
276 }
277 try
278 {
279 std::vector<int> values =
280 boards_struct
281 .brainflow_boards_json["boards"][std::to_string (board_id)][preset_str][param_name];
282 if (!values.empty ())
283 {
284 memcpy (output_array, &values[0], sizeof (int) * values.size ());
285 }
286 *len = (int)values.size ();
287 return (int)BrainFlowExitCodes::STATUS_OK;
288 }
289 catch (json::exception &e)
290 {
291 if (use_logger)
292 {
293 Board::board_logger->error (
294 "Failed to get board info: {}, usually it means that device has no such channels, "
295 "use get_board_descr method for the info about supported channels",
296 e.what ());
297 }
298 return (int)BrainFlowExitCodes::UNSUPPORTED_BOARD_ERROR;
299 }
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)

Callers 15

get_eeg_channelsFunction · 0.85
get_emg_channelsFunction · 0.85
get_ecg_channelsFunction · 0.85
get_eog_channelsFunction · 0.85
get_eda_channelsFunction · 0.85
get_ppg_channelsFunction · 0.85
get_optical_channelsFunction · 0.85
get_accel_channelsFunction · 0.85
get_rotation_channelsFunction · 0.85
get_analog_channelsFunction · 0.85
get_gyro_channelsFunction · 0.85
get_other_channelsFunction · 0.85

Calls 3

get_preset_strFunction · 0.85
emptyMethod · 0.80
whatMethod · 0.80

Tested by

no test coverage detected