Builder Class

Class Builder is declared in class QKnxNetIpConnectionStateRequestProxy.

The QKnxNetIpConnectionStateRequestProxy::Builder class provides the means to create a KNXnet/IP connection state request frame. More...

Public Functions

QKnxNetIpFrame create() const
Builder &setChannelId(quint8 channelId)
Builder &setControlEndpoint(const QKnxNetIpHpai &hpai)

Detailed Description

A KNXnet/IP client sends a connection state request frame regularly to the KNXnet/IP server's control endpoint to check the state of a connection established to the server. The server responds immediately with a connection state response frame, QKnxNetIpConnectionStateResponseProxy.

In most programs, this class will not be used directly. Instead, the QKnxNetIpTunnel or QKnxNetIpDeviceManagement class is used to establish a functional connection to a KNXnet/IP server.

The common way to create a connection state request is:

auto hpai = QKnxNetIpHpaiProxy::builder().create();

auto netIpFrame = QKnxNetIpConnectionStateRequestProxy::builder()
    .setChannelId(255)
    .setControlEndpoint(hpai)
    .create();

If the KNXnet/IP client does not receive the connection state response within a timeout, or the status of the received response indicates that errors occurred, the client repeats the connection state request three times. It then terminates the connection by sending a disconnect request, QKnxNetIpDisconnectRequestProxy, to the server's control endpoint.

Member Function Documentation

QKnxNetIpFrame Builder::create() const

Creates and returns a KNXnet/IP connection state request frame.

Note: The returned frame may be invalid depending on the values used during setup.

See also isValid().

Builder &Builder::setChannelId(quint8 channelId)

Sets the ID of the communication channel to channelId and returns a reference to the builder.

Builder &Builder::setControlEndpoint(const QKnxNetIpHpai &hpai)

Sets the control endpoint of the KNXnet/IP client to hpai and returns a reference to the builder.

© 2019 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.