ExtendedBuilder Class

class QKnxNetIpSearchRequestProxy::ExtendedBuilder

The QKnxNetIpSearchRequestProxy::ExtendedBuilder class provides the means to create a KNXnet/IP extended search request. More...

This class was introduced in Qt 5.12.

Public Functions

ExtendedBuilder(const ExtendedBuilder &other)
ExtendedBuilder()
ExtendedBuilder &operator=(const ExtendedBuilder &other)
~ExtendedBuilder()
QKnxNetIpFrame create() const
ExtendedBuilder &setDiscoveryEndpoint(const QKnxNetIpHpai &hpai)
ExtendedBuilder &setExtendedParameters(const QVector<QKnxNetIpSrp> &srps)

Detailed Description

To discover KNXnet/IP servers, a KNXnet/IP client sends a extended search request data packet via multicast using its discovery endpoint. The request contains the host address protocol information (HPAI) of the discovery endpoint. The HPAI may also contain a unicast IP address to receive the answers from the different servers directly in a point-to-point manner. Typically, it should contain the KNXnet/IP system setup multicast address to ensure reception from KNXnet/IP servers that are on a different subnetwork. Additionally, the client may include 0 or more search request parameter blocks.

The common way to create a search request is:

auto hpai = ... // create HPAI;
auto macAddress = ... // fetch and set the MAC address;

auto macSrp = QKnxNetIpSrpProxy::macAddressBuilder()
    .setMac(macAddress)
    .create();
auto modeSrp = QKnxNetIpSrpProxy::programmingModeBuilder()
               .setMandatory(true)
               .create();

auto netIpFrame = QKnxNetIpSearchRequestProxy::extendedBuilder()
    .setDiscoveryEndpoint(hpai)
    .setExtendedParameter({ macSrp, modeSrp })
    .create();

After sending the search request, the KNXnet/IP client waits until timeout for the response frame from the KNXnet/IP server, QKnxNetIpSearchResponseProxy. After the timeout, received response frames are ignored by the client until it sends another search request. Search requests received from other clients are always ignored.

See also QKnxNetIpHpaiProxy::Builder.

Member Function Documentation

ExtendedBuilder::ExtendedBuilder(const ExtendedBuilder &other)

Constructs a copy of other.

ExtendedBuilder::ExtendedBuilder()

Creates an extended search request builder.

ExtendedBuilder &ExtendedBuilder::operator=(const ExtendedBuilder &other)

Assigns other to this builder.

ExtendedBuilder::~ExtendedBuilder()

Destroys an extended search request builder.

QKnxNetIpFrame ExtendedBuilder::create() const

Creates and returns a KNXnet/IP extended search request frame.

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

See also isValid().

ExtendedBuilder &ExtendedBuilder::setDiscoveryEndpoint(const QKnxNetIpHpai &hpai)

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

ExtendedBuilder &ExtendedBuilder::setExtendedParameters(const QVector<QKnxNetIpSrp> &srps)

Adds the QVector of extended parameters srps to the KNXnet/IP extended search request.

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