bool CAI302::SendCommand(Port &port, const char *cmd, OperationEnvironment &env, unsigned timeout_ms) { return SendCommandQuick(port, cmd, env) && WaitCommandPrompt(port, env, timeout_ms); }
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); }
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); }
bool CAI302::UploadMode(Port &port, OperationEnvironment &env) { return SendCommandQuick(port, "UPLOAD 1\r", env) && WaitUploadPrompt(port, env); }
bool CAI302::LogMode(Port &port, OperationEnvironment &env) { return SendCommandQuick(port, "LOG 0\r", env); }
bool CAI302::PowerOff(Port &port, OperationEnvironment &env) { return SendCommandQuick(port, "DIE\r", env); }
bool CAI302::Reboot(Port &port, OperationEnvironment &env) { return SendCommandQuick(port, "SIF 0 0\r", env); }