QKnxNetIpServerDiscoveryAgent Class

The QKnxNetIpServerDiscoveryAgent class discovers KNXnet/IP servers in the network that the client is connected to. More...

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

Public Types

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

Public Functions

QKnxNetIpServerDiscoveryAgent(QObject *parent = nullptr)
QKnxNetIpServerDiscoveryAgent(const QHostAddress &localAddress, QObject *parent = nullptr)
QKnxNetIpServerDiscoveryAgent(const QHostAddress &localAddress, quint16 localPort, QObject *parent = nullptr)
~QKnxNetIpServerDiscoveryAgent()
QVector<QKnxNetIpServerInfo> discoveredServers() const
QKnxNetIpServerDiscoveryAgent::Error error() const
QString errorString() const
QHostAddress localAddress() const
quint16 localPort() const
quint8 multicastTtl() const
bool natAware() const
QKnxNetIpServerDiscoveryAgent::ResponseType responseType() const
int searchFrequency() const
void setLocalAddress(const QHostAddress &address)
void setLocalPort(quint16 port)
void setMulticastTtl(quint8 ttl)
void setNatAware(bool isAware)
void setResponseType(QKnxNetIpServerDiscoveryAgent::ResponseType type)
void setSearchFrequency(int timesPerMinute)
void setTimeout(int msec)
QKnxNetIpServerDiscoveryAgent::State state() const
int timeout() const
  • 32 public functions inherited from QObject

Public Slots

void start()
void start(int timeout)
void stop()
  • 1 public slot inherited from QObject

Signals

void deviceDiscovered(QKnxNetIpServerInfo server)
void errorOccurred(QKnxNetIpServerDiscoveryAgent::Error error, QString errorString)
void finished()
void started()
void stateChanged(QKnxNetIpServerDiscoveryAgent::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 QKnxNetIpServerDiscoveryAgent class discovers KNXnet/IP servers in the network that the client is connected to.

Here is an example on how to use this discovery agent:

QKnxNetIpServerDiscoveryAgent agent;
QKnxAddress clientLocalAddress = ...
agent.setLocalAddress(clientLocalAddress);
agent.start();

To retrieve the list of discovered servers:

auto servers = agent.discoveredServers();

Member Type Documentation

enum QKnxNetIpServerDiscoveryAgent::Error

enum QKnxNetIpServerDiscoveryAgent::ResponseType

enum QKnxNetIpServerDiscoveryAgent::State

Member Function Documentation

QKnxNetIpServerDiscoveryAgent::QKnxNetIpServerDiscoveryAgent(QObject *parent = nullptr)

Default constructs an instance of QKnxNetIpServerDiscoveryAgent.

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

Default constructs an instance of QKnxNetIpServerDiscoveryAgent.

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

Default constructs an instance of QKnxNetIpServerDiscoveryAgent.

QKnxNetIpServerDiscoveryAgent::~QKnxNetIpServerDiscoveryAgent()

Destroys the instance of QKnxNetIpServerDiscoveryAgent.

[signal] void QKnxNetIpServerDiscoveryAgent::deviceDiscovered(QKnxNetIpServerInfo server)

QVector<QKnxNetIpServerInfo> QKnxNetIpServerDiscoveryAgent::discoveredServers() const

QKnxNetIpServerDiscoveryAgent::Error QKnxNetIpServerDiscoveryAgent::error() const

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

QString QKnxNetIpServerDiscoveryAgent::errorString() const

[signal] void QKnxNetIpServerDiscoveryAgent::finished()

QHostAddress QKnxNetIpServerDiscoveryAgent::localAddress() const

See also setLocalAddress().

quint16 QKnxNetIpServerDiscoveryAgent::localPort() const

See also setLocalPort().

quint8 QKnxNetIpServerDiscoveryAgent::multicastTtl() const

See also setMulticastTtl().

bool QKnxNetIpServerDiscoveryAgent::natAware() const

See also setNatAware().

QKnxNetIpServerDiscoveryAgent::ResponseType QKnxNetIpServerDiscoveryAgent::responseType() const

See also setResponseType().

int QKnxNetIpServerDiscoveryAgent::searchFrequency() const

Returns the search frequency used by the discovery agent to send search request messages. The default value is 0.

See also setSearchFrequency.

void QKnxNetIpServerDiscoveryAgent::setLocalAddress(const QHostAddress &address)

See also localAddress().

void QKnxNetIpServerDiscoveryAgent::setLocalPort(quint16 port)

See also localPort().

void QKnxNetIpServerDiscoveryAgent::setMulticastTtl(quint8 ttl)

See also multicastTtl().

void QKnxNetIpServerDiscoveryAgent::setNatAware(bool isAware)

See also natAware().

void QKnxNetIpServerDiscoveryAgent::setResponseType(QKnxNetIpServerDiscoveryAgent::ResponseType type)

See also responseType().

void QKnxNetIpServerDiscoveryAgent::setSearchFrequency(int timesPerMinute)

Sets the search frequency used by the discovery agent to timesPerMinute to send search request messages. The default value is 0.

See also timeout, setTimeout, and searchFrequency.

void QKnxNetIpServerDiscoveryAgent::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, searchFrequency, and setSearchFrequency.

[slot] void QKnxNetIpServerDiscoveryAgent::start()

[slot] void QKnxNetIpServerDiscoveryAgent::start(int timeout)

[signal] void QKnxNetIpServerDiscoveryAgent::started()

QKnxNetIpServerDiscoveryAgent::State QKnxNetIpServerDiscoveryAgent::state() const

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

[slot] void QKnxNetIpServerDiscoveryAgent::stop()

int QKnxNetIpServerDiscoveryAgent::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.