44#include <netinet/in.h>
46#include <sys/socket.h>
133 std::cout <<
"UDP set" << std::endl;
Class UwConnector allows to specify an interface between the UwDriver object and the device.
Class that implements a TCP or UDP socket.
bool isClient
Bool value that defines the role of the socket.
UwSocket()
Constructor of the UwSocket class.
virtual int writeToDevice(const std::string &msg)
Method that writes a command to the modem interface.
virtual bool openConnection(const std::string &path)
Method that opens a TCP or UDP connection, accordinto to UwSocket::proto variable: the behavior depen...
int socketfd
Integer value that stores the socket descriptor as generated by the function UwSocket::openConnection...
Transport
Enum structure thet represents the transport protocol being used.
virtual void setTCP()
Method that sets TCP as transport protocol.
virtual void setServer()
Method that sets SERVER role.
virtual const bool isConnected()
Returns true if socket fd differs from -1, that means the connection is up.
Transport proto
Transport protocol to be used: either Transport::TCP or Transport::UDP.
virtual int readFromDevice(void *wpos, int maxlen)
Function that dumps data from the device's memory to a backup buffer.
virtual void setUDP()
Method that sets UDP as transport protocol.
virtual ~UwSocket()
Destructor of the UwSocket class.
virtual bool closeConnection()
Method that closes an active connection to a device.
struct sockaddr_in cl_addr
Generic class that provides a method to interface with the devices. Will be specialized for,...
constexpr char udp_init_string[]