QKnxNetIpServerDescriptionAgent Class

The QKnxNetIpServerDescriptionAgent class establishes a point to point connection with a KNXnet/IP server and requests its description. More...

Header: #include <QKnxNetIpServerDescriptionAgent>
qmake: QT += knx
Inherits: QObject

Public Types

enum Error { None, Network, NotIPv4, Unknown }
enum State { NotRunning, Starting, Running, Stopping }

Public Functions

QKnxNetIpServerDescriptionAgent(QObject *parent = nullptr)
QKnxNetIpServerDescriptionAgent(const QHostAddress &localAddress, QObject *parent = nullptr)
QKnxNetIpServerDescriptionAgent(const QHostAddress &localAddress, quint16 localPort, QObject *parent = nullptr)
QKnxNetIpServerDescriptionAgent::Error error() const
QString errorString() const
QHostAddress localAddress() const
quint16 localPort() const
quint8 multicastTtl() const
bool natAware() const
QKnxNetIpServerInfo serverDescription() const
void setLocalAddress(const QHostAddress &address)
void setLocalPort(quint16 port)
void setMulticastTtl(quint8 ttl)
void setNatAware(bool isAware)
void setTimeout(int msec)
QKnxNetIpServerDescriptionAgent::State state() const
int timeout() const
  • 32 public functions inherited from QObject

Public Slots

void start(const QKnxNetIpHpai &server)
void start(const QKnxNetIpServerInfo &server)
void start(const QHostAddress &address, quint16 port)
void stop()
  • 1 public slot inherited from QObject


void descriptionReceived(QKnxNetIpServerInfo server)
void errorOccurred(QKnxNetIpServerDescriptionAgent::Error error, QString errorString)
void finished()
void started()
void stateChanged(QKnxNetIpServerDescriptionAgent::State state)

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public variable inherited from QObject
  • 10 static public members inherited from QObject
  • 9 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

The QKnxNetIpServerDescriptionAgent class establishes a point to point connection with a KNXnet/IP server and requests its description.

One must first use the QKnxNetIpServerDiscoveryAgent class to choose a server, as illustrated by the following code snippet:

QKnxNetIpServerDescriptionAgent agent;
QKnxAddress clientLocalAddress = ...
QKnxNetIpServerInfo server = agent.discoveredServers()[0]; // for example

When the description is received, the class emits a descriptionReceived(QKnxNetIpServerInfo server) signal containing the information received from the server. The description received through this point to point connection may be more complete than the one sent during the discovery process.

Member Type Documentation

enum QKnxNetIpServerDescriptionAgent::Error

enum QKnxNetIpServerDescriptionAgent::State

Member Function Documentation

QKnxNetIpServerDescriptionAgent::QKnxNetIpServerDescriptionAgent(QObject *parent = nullptr)

Default constructs an instance of QKnxNetIpServerDescriptionAgent.

QKnxNetIpServerDescriptionAgent::QKnxNetIpServerDescriptionAgent(const QHostAddress &localAddress, QObject *parent = nullptr)

Default constructs an instance of QKnxNetIpServerDescriptionAgent.

QKnxNetIpServerDescriptionAgent::QKnxNetIpServerDescriptionAgent(const QHostAddress &localAddress, quint16 localPort, QObject *parent = nullptr)

Default constructs an instance of QKnxNetIpServerDescriptionAgent.


Destroys the instance of QKnxNetIpServerDescriptionAgent.

[signal] void QKnxNetIpServerDescriptionAgent::descriptionReceived(QKnxNetIpServerInfo server)

QKnxNetIpServerDescriptionAgent::Error QKnxNetIpServerDescriptionAgent::error() const

[signal] void QKnxNetIpServerDescriptionAgent::errorOccurred(QKnxNetIpServerDescriptionAgent::Error error, QString errorString)

QString QKnxNetIpServerDescriptionAgent::errorString() const

[signal] void QKnxNetIpServerDescriptionAgent::finished()

QHostAddress QKnxNetIpServerDescriptionAgent::localAddress() const

See also setLocalAddress().

quint16 QKnxNetIpServerDescriptionAgent::localPort() const

See also setLocalPort().

quint8 QKnxNetIpServerDescriptionAgent::multicastTtl() const

See also setMulticastTtl().

bool QKnxNetIpServerDescriptionAgent::natAware() const

See also setNatAware().

QKnxNetIpServerInfo QKnxNetIpServerDescriptionAgent::serverDescription() const

void QKnxNetIpServerDescriptionAgent::setLocalAddress(const QHostAddress &address)

See also localAddress().

void QKnxNetIpServerDescriptionAgent::setLocalPort(quint16 port)

See also localPort().

void QKnxNetIpServerDescriptionAgent::setMulticastTtl(quint8 ttl)

See also multicastTtl().

void QKnxNetIpServerDescriptionAgent::setNatAware(bool isAware)

See also natAware().

void QKnxNetIpServerDescriptionAgent::setTimeout(int msec)

Sets the timeout for the discovery agent to msec. If msec is -1, the agent will not timeout and has to be terminated by calling the stop function.

See also timeout.

[slot] void QKnxNetIpServerDescriptionAgent::start(const QKnxNetIpHpai &server)

[slot] void QKnxNetIpServerDescriptionAgent::start(const QKnxNetIpServerInfo &server)

[slot] void QKnxNetIpServerDescriptionAgent::start(const QHostAddress &address, quint16 port)

[signal] void QKnxNetIpServerDescriptionAgent::started()

QKnxNetIpServerDescriptionAgent::State QKnxNetIpServerDescriptionAgent::state() const

[signal] void QKnxNetIpServerDescriptionAgent::stateChanged(QKnxNetIpServerDescriptionAgent::State state)

[slot] void QKnxNetIpServerDescriptionAgent::stop()

int QKnxNetIpServerDescriptionAgent::timeout() const

Returns the timeout value used by the discovery agent to wait for incoming search response messages. The default value is 3000 milliseconds.

See also setTimeout.

© 2017 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.