| 528 | } |
| 529 | |
| 530 | int config_board (const char *config, char *response, int *response_len, int response_max_len, |
| 531 | int board_id, const char *json_brainflow_input_params) |
| 532 | { |
| 533 | std::lock_guard<std::mutex> lock (mutex); |
| 534 | if ((config == NULL) || (response == NULL) || (response_len == NULL) || (response_max_len < 1)) |
| 535 | { |
| 536 | return (int)BrainFlowExitCodes::INVALID_ARGUMENTS_ERROR; |
| 537 | } |
| 538 | |
| 539 | std::pair<int, struct BrainFlowInputParams> key; |
| 540 | int res = check_board_session (board_id, json_brainflow_input_params, key, false); |
| 541 | if (res != (int)BrainFlowExitCodes::STATUS_OK) |
| 542 | { |
| 543 | return res; |
| 544 | } |
| 545 | auto board_it = boards.find (key); |
| 546 | std::string conf = config; |
| 547 | std::string resp = ""; |
| 548 | res = board_it->second->config_board (conf, resp); |
| 549 | if (res == (int)BrainFlowExitCodes::STATUS_OK) |
| 550 | { |
| 551 | res = copy_string_to_buffer (resp, response, response_len, response_max_len); |
| 552 | } |
| 553 | return res; |
| 554 | } |
| 555 | |
| 556 | int config_board_with_bytes ( |
| 557 | const char *bytes, int len, int board_id, const char *json_brainflow_input_params) |
no test coverage detected