QKnxNetIpSrpProxy Class

The QKnxNetIpSrpProxy class encapsulates methods to introspect the various search request parameter (SRP) structures and provides a collection of builders for creating such SRP structures to be included in an extended search request. More...

Header: #include <QKnxNetIpSrpProxy>
qmake: QT += knx
Since: Qt 5.12

This class was introduced in Qt 5.12.

Public Types

Public Functions

QKnxNetIpSrpProxy(const QKnxNetIpSrp &srp)
QVector<QKnxNetIp::DescriptionType> descriptionTypes() const
bool isMandatory() const
bool isValid() const
QKnxByteArray macAddress() const
bool programmingModeOnly() const
QKnxNetIp::SearchParameterType searchParameterType() const
QKnxServiceInfo serviceInfo() const

Static Public Members

QKnxNetIpSrpProxy::MacAddress macAddressBuilder()
QKnxNetIpSrpProxy::ProgrammingMode programmingModeBuilder()
QKnxNetIpSrpProxy::RequestDibs requestDibsBuilder()
QKnxNetIpSrpProxy::SupportedFamily supportedFamilyBuilder()

Detailed Description

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

The following SRP types are available:

  • Select By MAC Address indicates that the KNXnet/IP client is interested only in the response from the KNXnet/IP server with the given MAC address.
  • Select By Programming Mode indicates that the client is interested only in responses from servers in which Programming Mode is currently enabled.
  • Select By Service indicates that the client is interested only in responses from servers supporting the given service family in at least the given version.
  • Request DIBs indicates that the client is interested in the listed description information blocks (DIBs).

Reading the supported service families can be achieved like this:

auto srp = QKnxNetIpSrp::fromBytes(...);

QKnxNetIpSrpProxy proxy(srp);
if (!proxy.isValid())
    return;

if (proxy().searchParameterType() != QKnxNetIp::SearchParameterType::SelectByMACAddress)
    return;

auto mandatory = proxy.isMandatory();
auto macAddress = proxy.macAddress();

See also programmingModeBuilder(), macAddressBuilder(), supportedFamilyBuilder(), and requestDibsBuilder().

Member Function Documentation

QKnxNetIpSrpProxy::QKnxNetIpSrpProxy(const QKnxNetIpSrp &srp)

Constructs a proxy object with the specified KNXnet/IP SRP structure srp to read the encapsulated search request parameters.

QVector<QKnxNetIp::DescriptionType> QKnxNetIpSrpProxy::descriptionTypes() const

Returns a vector of QKnx::NetIp::DescriptionType enumeration values used as search criteria if the object that was passed during construction was valid; otherwise returns an empty vector.

bool QKnxNetIpSrpProxy::isMandatory() const

Returns true if the mandatory bit is set; otherwise returns false.

bool QKnxNetIpSrpProxy::isValid() const

Returns true if the KNXnet/IP structure to create the object is a valid KNXnet/IP SRP structure; otherwise returns false.

QKnxByteArray QKnxNetIpSrpProxy::macAddress() const

Returns an array of bytes that represent the MAC address used as search criteria if the object that was passed during construction was valid; otherwise returns an empty byte array.

[static] QKnxNetIpSrpProxy::MacAddress QKnxNetIpSrpProxy::macAddressBuilder()

Returns a builder object to create a KNXnet/IP MAC address SRP structure.

[static] QKnxNetIpSrpProxy::ProgrammingMode QKnxNetIpSrpProxy::programmingModeBuilder()

Returns a builder object to create a KNXnet/IP programming mode SRP structure.

bool QKnxNetIpSrpProxy::programmingModeOnly() const

Returns true if the search request was limited to devices in programming mode; otherwise returns false.

[static] QKnxNetIpSrpProxy::RequestDibs QKnxNetIpSrpProxy::requestDibsBuilder()

Returns a builder object to create a KNXnet/IP requested DIBs SRP structure.

QKnxNetIp::SearchParameterType QKnxNetIpSrpProxy::searchParameterType() const

Return the search parameter type from KNXnet/IP structure if the object passed during construction was valid, otherwise returns QKnx::NetIp::Unknown.

QKnxServiceInfo QKnxNetIpSrpProxy::serviceInfo() const

Returns a QKnxServiceInfo structure used as search criteria if the object that was passed during construction was valid; otherwise returns a default-constructed value.

[static] QKnxNetIpSrpProxy::SupportedFamily QKnxNetIpSrpProxy::supportedFamilyBuilder()

Returns a builder object to create a KNXnet/IP supported service family SRP structure.

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