BAOS SDK  18.2.0
Public Member Functions | List of all members
kdrive::baos::StreamConnection Class Reference

The StreamConnection is responsible for creating a TCP/IP stream connection with the baos server. More...

#include <StreamConnection.h>

Inheritance diagram for kdrive::baos::StreamConnection:
kdrive::baos::BaosConnection

Public Member Functions

 StreamConnection ()
 Creates a default (disconnected) StreamConnection. More...
 
 StreamConnection (const StreamConnection &)=delete
 
StreamConnectionoperator= (const StreamConnection &)=delete
 
virtual ~StreamConnection ()
 Destroys the StreamConnection. More...
 
void connect (const std::string remoteHost, unsigned char version, bool decodeProtocol=false)
 Connects to a remote IP BAOS device. More...
 
void connect (const BaosDevice &baosDevice, bool decodeProtocol=false)
 Connects to a remote IP BAOS device. More...
 
void connectByName (const std::string &name, bool decodeProtocol=false)
 Connects to a remote IP BAOS device It gets the IP address and protocol version via a KNXnet/IP Search Request/Response. More...
 
void connectByAddress (const std::string &ipAddress, bool decodeProtocol=false)
 Connects to a remote IP BAOS device It gets the protocol version via a KNXnet/IP Search Request/Response. More...
 
void connectNat (const std::string &ipAddress, unsigned short port, unsigned char version, bool decodeProtocol=false)
 Connects to a remote IP BAOS device with NAT. More...
 
- Public Member Functions inherited from kdrive::baos::BaosConnection
 BaosConnection ()
 Creates a default (disconnected) BaosConnection. More...
 
 BaosConnection (const BaosConnection &)=delete
 
BaosConnectionoperator= (const BaosConnection &)=delete
 
virtual ~BaosConnection ()
 Destroys the StreamConnection. More...
 
BaosConnectorPtr getConnector ()
 returns the connector throws a NullPointerException exception if the connector is not connected More...
 
void connectIp (const std::string remoteHost, unsigned char version, bool decodeProtocol=false)
 Connects to a remote IP BAOS device. More...
 
void connectIp (const BaosDevice &baosDevice, bool decodeProtocol=false)
 Connects to a remote IP BAOS device. More...
 
void connectIpByName (const std::string &name, bool decodeProtocol=false)
 Connects to a remote IP BAOS device It gets the IP address and protocol version via a KNXnet/IP Search Request/Response. More...
 
void connectIpByAddress (const std::string &ipAddress, bool decodeProtocol=false)
 Connects to a remote IP BAOS device It gets the protocol version via a KNXnet/IP Search Request/Response. More...
 
void connectIpNat (const std::string &ipAddress, unsigned short port, unsigned char version, bool decodeProtocol=false)
 Connects to a remote IP BAOS device with NAT. More...
 
void connectSerial (const std::string &serialDeviceName, bool decodeProtocol=false)
 Connects to a Serial FT1.2 BAOS device. More...
 
void disconnect ()
 Disconnects the connection to a remote device. More...
 
bool isConnected () const
 Returns true if the connection is established, false otherwise. More...
 
ConnectSignalgetConnectSignal ()
 Returns the connect signal This is invoked when the connector thread is started. More...
 
DisconnectSignalgetDisconnectSignal ()
 Returns the disconnect signal This is invoked when the connector thread is stopped. More...
 

Additional Inherited Members

- Public Types inherited from kdrive::baos::BaosConnection
typedef std::shared_ptr< BaosConnectorBaosConnectorPtr
 
typedef boost::signals2::signal< void()> ConnectSignal
 
typedef boost::signals2::signal< void()> DisconnectSignal
 

Detailed Description

The StreamConnection is responsible for creating a TCP/IP stream connection with the baos server.

The StreamConnection is responsible for creating a TCP/IP socket connection to the remote BAOS device. It requires the IP Address of the device. The StreamConnection is a wrapper around the Connector which is used throughout the baos rpc library.

It implements a connect and a disconnect signal. These signals are invoked when the stream connection is connector and disconnected respectively. Note: a stream connection can be auto-disconnected if the tcp/ip connection is terminated by the remote peer (baos device). This may occur if a connection timeout occurs (i.e. no socket activity for a couple of minutes).

See also
BaosHeartbeat
Deprecated:
Use ScopedBaosConnection instead. This class calls only the functions from BaosConnection.

Constructor & Destructor Documentation

StreamConnection::StreamConnection ( )

Creates a default (disconnected) StreamConnection.

kdrive::baos::StreamConnection::StreamConnection ( const StreamConnection )
delete
StreamConnection::~StreamConnection ( )
virtual

Destroys the StreamConnection.

If no other hold an reference to the Connector (the normal case), the destructor of Connector will called which closed the TCP/IP socket connection.

Member Function Documentation

void StreamConnection::connect ( const std::string  remoteHost,
unsigned char  version,
bool  decodeProtocol = false 
)

Connects to a remote IP BAOS device.

void StreamConnection::connect ( const BaosDevice baosDevice,
bool  decodeProtocol = false 
)

Connects to a remote IP BAOS device.

void StreamConnection::connectByAddress ( const std::string &  ipAddress,
bool  decodeProtocol = false 
)

Connects to a remote IP BAOS device It gets the protocol version via a KNXnet/IP Search Request/Response.

void StreamConnection::connectByName ( const std::string &  name,
bool  decodeProtocol = false 
)

Connects to a remote IP BAOS device It gets the IP address and protocol version via a KNXnet/IP Search Request/Response.

void StreamConnection::connectNat ( const std::string &  ipAddress,
unsigned short  port,
unsigned char  version,
bool  decodeProtocol = false 
)

Connects to a remote IP BAOS device with NAT.

StreamConnection& kdrive::baos::StreamConnection::operator= ( const StreamConnection )
delete

The documentation for this class was generated from the following files: