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 int debug(const char *format,...)
Outputs debug information.
Debuggable(bool debug=false, const std::string &debug_name="", FILE *debug_fp=DEBUG_FP, const std::string &debug_timefmt=DEBUG_TIME_FMT)
Constructs a Debuggable object.
virtual BasicStringList receiveCliUdp(double timeout=-1)
Receives a client (AT-command-style) command response over UDP.
virtual bool sendCommandTty(const std::string &cmdString, bool clearRx=true)
Sends a command to the radio over TTY.
virtual BasicStringList receiveCliTcp(double timeout=-1)
Receives a client (AT-command-style) command response over TCP.
virtual bool connectTcp(const std::string &host, int port)
Connects to the radio using TCP.
virtual bool sendCommand(const std::string &cmdString, bool clearRx=true)
Sends a command to the radio over the transport.
virtual ~RadioTransport()
Destroys a RadioTransport object.
virtual bool sendCommandUdp(const std::string &cmdString, bool clearRx=true)
Sends a command to the radio over UDP.
virtual bool connect(const std::string &mode, const std::string &host_or_dev, const int port_or_baudrate)
Connects to the radio.
RadioTransport(bool json=false, bool debug=false)
Constructs a RadioTransport object.
virtual std::string getLastCommandErrorInfo() const
Gets the error information for the last command.
virtual bool connectUdp(const std::string &host, int port)
Connects to the radio using UDP.
virtual bool connectTty(const std::string &dev, int baudrate)
Connects to the radio using a serial link.
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 receiveCliTty(double timeout=-1)
Receives a client (AT-command-style) command response over TTY.
virtual BasicStringList receiveCli(double timeout=-1)
Receives a client (AT-command-style) command response from the radio.
virtual bool sendCommandTcp(const std::string &cmdString, bool clearRx=true)
Sends a command to the radio over TCP.
void setJson(bool json)
Allows user to set JSON.
virtual BasicStringList receiveJson(double timeout=-1)
Receives a JSON-formatted command response from the radio.
virtual void disconnect()
Disconnects from the radio.
virtual BasicStringList receiveJsonHttps(double timeout=-1)
Receives a JSON-formatted command response from the radio using HTTPS.
virtual void translateErrno()
Translates an errno value into an error message.
virtual bool connectHttps(const std::string &host, int port)
Connects to the radio using HTTPS.
virtual bool sendCommandHttps(const std::string &cmdString, bool clearRx=true)
Sends a command to the radio over HTTPS.
RadioTransport & operator=(const RadioTransport &other)
Assignment operator for RadioTransport objects.
Class that encapsulates an HTTPS session.
Class that manages communications with a serial port.
Provides programming elements for driving CRS NDR-class radios.
Defines functionality for LibCyberRadio applications.
BASIC_LIST_CONTAINER< std::string > BasicStringList
Type representing a list of strings.