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. 更多...

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

该类在 Qt 5.12 引入。

公共类型

class MacAddress
class ProgrammingMode
class RequestDibs
class SupportedFamily

公共函数

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

静态公共成员

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

详细描述

注意: 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();
					

另请参阅 programmingModeBuilder (), macAddressBuilder (), supportedFamilyBuilder (),和 requestDibsBuilder ().

成员函数文档编制

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

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

bool QKnxNetIpSrpProxy:: isValid () const

返回 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

返回 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

返回 QKnxServiceInfo structure used as search criteria if the object that was passed during construction was valid; otherwise returns a 默认构造值 .

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

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