ExtendedBuilder Class

class QKnxNetIpSearchRequestProxy ::ExtendedBuilder

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

该类在 Qt 5.12 引入。

公共函数

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 )

详细描述

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.

另请参阅 QKnxNetIpHpaiProxy::Builder .

成员函数文档编制

ExtendedBuilder:: ExtendedBuilder (const ExtendedBuilder & other )

构造副本为 other .

ExtendedBuilder:: ExtendedBuilder ()

Creates an extended search request builder.

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

赋值 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.

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

另请参阅 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 )

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