message: refactor cyton status check, add log message
diff: @@ -127,47 +127,29 @@ int OpenBCISerialBoard::set_port_settings ()
  return (int)BrainFlowExitCodes::SET_PORT_ERROR;
  }
  safe_logger (spdlog::level::trace, "set port settings");
  - return send_to_board ("v");
  + return (int)BrainFlowExitCodes::STATUS_OK;
  }
  int OpenBCISerialBoard::status_check ()
  {
  - unsigned char buf[1];
  - int count = 0;
  - int max_empty_seq = 5;
  - int num_empty_attempts = 0;
  -
  - for (int i = 0; i < 500; i++)
  - {
  - int res = serial->read_from_serial_port (buf, 1);
  - if (res > 0)
  - {
  - num_empty_attempts = 0;
  - // board is ready if there are '$$$'
  - if (buf[0] == '$')
  - {
  - count++;
  - }
  - else
  + if (is_streaming)
  {
  - count = 0;
  + return (int)BrainFlowExitCodes::STREAM_ALREADY_RUN_ERROR;
  }
  - if (count == 3)
  +
  + std::string response = "";
  + int res = send_to_board ("v", response);
  + if (res != (int)BrainFlowExitCodes::STATUS_OK)
  {
  - return (int)BrainFlowExitCodes::STATUS_OK;
  - }
  + return res;
  }
  - else
  + safe_logger (spdlog::level::info, "Message from the board : {}", response.c_str ());
  + std::size_t found = response.find ("$$$");
  + if (found == std::string::npos)
  {
  - num_empty_attempts++;
  - if (num_empty_attempts > max_empty_seq)
  - {
  - safe_logger (spdlog::level::err, "board doesnt send welcome characters!");
  return (int)BrainFlowExitCodes::BOARD_NOT_READY_ERROR;
  }
  - }
  - }
  - return (int)BrainFlowExitCodes::BOARD_NOT_READY_ERROR;
  + return (int)BrainFlowExitCodes::STATUS_OK;
  }
  int OpenBCISerialBoard::prepare_session ()
  