13 #ifndef __BAOSLIB_TCPCONNECTION_H__
14 #define __BAOSLIB_TCPCONNECTION_H__
24 namespace wz::baos::ip
37 using UPtr = std::unique_ptr<BaosTcpConnection>;
60 void open(
const std::string& ip4Address, std::uint16_t port = 12004);
66 return tcpTransport_.isOpen();
105 WZLOGGER(
"BaosTcpConnection", LVL_DEBUG);
106 std::uint64_t msgId_{0};
Code regarding a connection to a physical BAOS device.
Represents a connection to a BAOS device.
Definition: BaosConnection.h:69
State
Represents the internal state of this connection.
Definition: BaosConnection.h:359
std::unique_ptr< BaosConnection > UPtr
An alias for an unqiue pointer to this class.
Definition: BaosConnection.h:74
Buffer BaosFrame
An alias for the container type to store frame/packets/telegrams in.
Definition: BaosConnection.h:72
Represents an IOEvent.
Definition: IOEvent.h:42
A specialization for connection to the BAOS device via a TCP connection.
Definition: BaosTcpConnection.h:35
void eventHandler()
Handles the incoming IOEvents.
Buffer TcpTransportFrame
Alias on how a TcpTransportFrame is represented.
Definition: BaosTcpConnection.h:38
void onStateChange(State oldState, State newState) override
Invoked if the internal connection state should be changed.
protocol::ResponseFuture closeImplAsync() override
The implementation function for closing a connection.
TcpTransportFrame wrapKNXnetIp(BaosFrame &&frame)
Wrap a baos frame into a KnxNet/Ip frame.
void reopen() override
Reopens the underlying connection, has to be implemented by derived classes.
bool isOpenImpl() override
The implementation function for getting the opened state of the connection.
Definition: BaosTcpConnection.h:64
protocol::ResponseFuture sendImpl(BaosFrame &&frame) override
The implementation function for sending bytes to the connected device.
void open(const std::string &ip4Address, std::uint16_t port=12004)
Open a connection to physical BAOS device.
void handleTxTcp(IOEvent &&event)
Called for every Tx IOEvent (outgoing, send, transmit)
void handleRxTcp(IOEvent &&event)
Called for every Rx IOEvent (incoming, received)
void startImpl() override
The implementation function for starting the connection class.
Base class for a TCP input output connection.
Definition: TcpIO.h:114
Global types and configuration for the whole SDK.
std::future< BaseResponse::SPtr > ResponseFuture
Definition: Response.h:97
std::vector< std::uint8_t > Buffer
An alias type for a byte buffer.
Definition: config.h:64
Represent the pair of IP address as string in the form "10.0.0.1020" and a port.
Definition: IpGeneral.h:34