11 #ifndef INCLUDED_LIBCYBERRADIO_DRIVER_RADIOTRANSPORT_H 12 #define INCLUDED_LIBCYBERRADIO_DRIVER_RADIOTRANSPORT_H 14 #include "LibCyberRadio/Common/BasicList.h" 15 #include "LibCyberRadio/Common/Debuggable.h" 16 #include "LibCyberRadio/Common/HttpsSession.h" 17 #include "LibCyberRadio/Common/SerialPort.h" 77 const std::string& mode,
78 const std::string& host_or_dev,
79 const int port_or_baudrate
103 const std::string& cmdString,
130 const std::string& host,
140 const std::string& host,
150 const std::string& host,
160 const std::string& dev,
171 const std::string& cmdString,
182 const std::string& cmdString,
193 const std::string& cmdString,
204 const std::string& cmdString,
287 std::string _httpsConnTestUrl;
288 std::string _httpsApiCmdUrl;
290 std::string _lastCmdErrInfo;
virtual bool connect(const std::string &mode, const std::string &host_or_dev, const int port_or_baudrate)
Connects to the radio.
virtual BasicStringList receiveCliUdp(double timeout=-1)
Receives a client (AT-command-style) command response over UDP.
virtual std::string getLastCommandErrorInfo() const
Gets the error information for the last command.
virtual BasicStringList receiveCli(double timeout=-1)
Receives a client (AT-command-style) command response from the radio.
Class that manages communications with a serial port.
virtual void disconnect()
Disconnects from the radio.
Class that supports debug output.
virtual BasicStringList receiveJson(double timeout=-1)
Receives a JSON-formatted command response from the radio.
virtual ~RadioTransport()
Destroys a RadioTransport object.
virtual bool connectTty(const std::string &dev, int baudrate)
Connects to the radio using a serial link.
virtual bool connectUdp(const std::string &host, int port)
Connects to the radio using UDP.
virtual int debug(const char *format,...)
Outputs debug information.
BASIC_LIST_CONTAINER< std::string > BasicStringList
Type representing a list of strings.
virtual bool connectHttps(const std::string &host, int port)
Connects to the radio using HTTPS.
virtual bool sendCommandTty(const std::string &cmdString, bool clearRx=true)
Sends a command to the radio over TTY.
Defines functionality for LibCyberRadio applications.
Generic radio transport class.
virtual bool sendCommandHttps(const std::string &cmdString, bool clearRx=true)
Sends a command to the radio over HTTPS.
virtual void translateErrno()
Translates an errno value into an error message.
virtual BasicStringList receiveCliTty(double timeout=-1)
Receives a client (AT-command-style) command response over TTY.
Class that encapsulates an HTTPS session.
virtual bool sendCommandTcp(const std::string &cmdString, bool clearRx=true)
Sends a command to the radio over TCP.
virtual BasicStringList receiveCliTcp(double timeout=-1)
Receives a client (AT-command-style) command response over TCP.
virtual bool sendCommand(const std::string &cmdString, bool clearRx=true)
Sends a command to the radio over the transport.
void setJson(bool json)
Allows user to set JSON.
virtual BasicStringList receive(double timeout=-1)
Receives a command response from the radio.
virtual bool isConnected() const
Gets whether the transport is connected.
virtual BasicStringList receiveJsonHttps(double timeout=-1)
Receives a JSON-formatted command response from the radio using HTTPS.
RadioTransport & operator=(const RadioTransport &other)
Assignment operator for RadioTransport objects.
RadioTransport(bool json=false, bool debug=false)
Constructs a RadioTransport object.
virtual bool sendCommandUdp(const std::string &cmdString, bool clearRx=true)
Sends a command to the radio over UDP.
virtual bool connectTcp(const std::string &host, int port)
Connects to the radio using TCP.