QKnxNetIpConnectRequestProxy Class

The QKnxNetIpConnectRequestProxy class provides the means to read a connection request from the generic QKnxNetIpFrame class and to create a KNXnet/IP frame based on the information. More...

Header: #include <QKnxNetIpConnectRequestProxy>
qmake: QT += knx

Public Types

class Builder

Public Functions

QKnxNetIpConnectRequestProxy(const QKnxNetIpFrame &frame)
QKnxNetIpHpai controlEndpoint() const
QKnxNetIpHpai dataEndpoint() const
bool isValid() const
QKnxNetIpCri requestInformation() const

Static Public Members

QKnxNetIpConnectRequestProxy::Builder builder()

Detailed Description

A connection request is sent by a KNXnet/IP client to establish a communication channel to a KNXnet/IP server. The connection request provides information about the requested connection type, such as data tunneling or remote logging, general and connection type-specific options, such as data link layer or busmonitor mode, and the data endpoint host address protocol information (HPAI) that the client wants to use for this communication channel.

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

Before sending a connection request, the KNXnet/IP client should use QKnxNetIpServerDescriptionAgent and QKnxNetIpServerInfo to check that the server supports the requested connection type and options.

Note: When using QKnxNetIpConnectRequestProxy, care must be taken to ensure that the referenced KNXnet/IP frame outlives the proxy on all code paths, lest the proxy ends up referencing deleted data.

The following code sample illustrates how to read the connection request information sent by a KNXnet/IP client:

auto frame = QKnxNetIpFrame::fromBytes(...);

const QKnxNetIpConnectRequestProxy proxy(frame);
if (!proxy.isValid())
    return;

auto ctrlEndpoint = proxy.controlEndpoint();
auto dataEndpoint = proxy.dataEndpoint();
auto cri = proxy. requestInformation();

See also builder() and Qt KNXnet/IP Connection Classes.

Member Function Documentation

QKnxNetIpConnectRequestProxy::QKnxNetIpConnectRequestProxy(const QKnxNetIpFrame &frame)

Constructs a proxy object to read the connection request information carried by the specified KNXnet/IP frame frame.

[static] QKnxNetIpConnectRequestProxy::Builder QKnxNetIpConnectRequestProxy::builder()

Returns a builder object to create a KNXnet/IP connection request frame.

QKnxNetIpHpai QKnxNetIpConnectRequestProxy::controlEndpoint() const

Returns the control endpoint of the KNXnet/IP client sending the connection request.

QKnxNetIpHpai QKnxNetIpConnectRequestProxy::dataEndpoint() const

Returns the data endpoint of the KNXnet/IP client sending the connection request.

bool QKnxNetIpConnectRequestProxy::isValid() const

Returns true if the frame contains initialized values and is in itself valid, otherwise returns false. A valid KNXnet/IP frame consists of at least a valid header and a size in bytes corresponding to the total size of the KNXnet/IP frame header.

See also QKnxNetIpFrameHeader::totalSize().

QKnxNetIpCri QKnxNetIpConnectRequestProxy::requestInformation() const

Returns the connection request information (CRI) set by the KNXnet/IP client for the requested connection.

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