Пример #1
0
bool
CAI302::SendCommand(Port &port, const char *cmd,
                    OperationEnvironment &env, unsigned timeout_ms)
{
  return SendCommandQuick(port, cmd, env) &&
    WaitCommandPrompt(port, env, timeout_ms);
}
Пример #2
0
bool
CAI302::SendCommand(Port &port, const char *cmd,
                    OperationEnvironment &env,
                    std::chrono::steady_clock::duration timeout)
{
  return SendCommandQuick(port, cmd, env) &&
    WaitCommandPrompt(port, env, timeout);
}
Пример #3
0
bool
CAI302::SetBaudRate(Port &port, unsigned baud_rate, OperationEnvironment &env)
{
  unsigned n = ConvertBaudRate(baud_rate);
  if (n == 0)
    return false;

  char cmd[16];
  sprintf(cmd, "BAUD %u\r", n);
  return SendCommandQuick(port, cmd, env);
}
Пример #4
0
bool
CAI302::UploadMode(Port &port, OperationEnvironment &env)
{
  return SendCommandQuick(port, "UPLOAD 1\r", env) &&
    WaitUploadPrompt(port, env);
}
Пример #5
0
bool
CAI302::LogMode(Port &port, OperationEnvironment &env)
{
  return SendCommandQuick(port, "LOG 0\r", env);
}
Пример #6
0
bool
CAI302::PowerOff(Port &port, OperationEnvironment &env)
{
  return SendCommandQuick(port, "DIE\r", env);
}
Пример #7
0
bool
CAI302::Reboot(Port &port, OperationEnvironment &env)
{
  return SendCommandQuick(port, "SIF 0 0\r", env);
}