| 24 | } |
| 25 | |
| 26 | int OpenBCISerialBoard::open_port () |
| 27 | { |
| 28 | if (serial->is_port_open ()) |
| 29 | { |
| 30 | safe_logger (spdlog::level::err, "port {} already open", serial->get_port_name ()); |
| 31 | return (int)BrainFlowExitCodes::PORT_ALREADY_OPEN_ERROR; |
| 32 | } |
| 33 | |
| 34 | safe_logger (spdlog::level::info, "opening port {}", serial->get_port_name ()); |
| 35 | int res = serial->open_serial_port (); |
| 36 | if (res < 0) |
| 37 | { |
| 38 | safe_logger (spdlog::level::err, |
| 39 | "Make sure you provided correct port name and have permissions to open it(run with " |
| 40 | "sudo/admin). Also, close all other apps using this port."); |
| 41 | return (int)BrainFlowExitCodes::UNABLE_TO_OPEN_PORT_ERROR; |
| 42 | } |
| 43 | safe_logger (spdlog::level::trace, "port {} is open", serial->get_port_name ()); |
| 44 | return (int)BrainFlowExitCodes::STATUS_OK; |
| 45 | } |
| 46 | |
| 47 | int OpenBCISerialBoard::config_board (std::string config, std::string &response) |
| 48 | { |
nothing calls this directly
no test coverage detected