Builder Class

class QKnxDeviceManagementFrame ::Builder

The QKnxDeviceManagementFrame::Builder class provides the means to create valid device management service frames. 更多...

公共函数

QKnxDeviceManagementFrame createFrame () const
Builder & setData (const QKnxByteArray & data )
Builder & setMessageCode (MessageCode code )
Builder & setObjectInstance (quint8 实例 )
Builder & setObjectType (QKnxInterfaceObjectType type )
Builder & setProperty (QKnxInterfaceObjectProperty pid )

详细描述

The typical arguments needed to build a QKnxDeviceManagementFrame 是:

  • The code describing the service to use, QKnxDeviceManagementFrame::MessageCode .
  • The type of the interface object holding the property one wants to access, QKnxInterfaceObjectType .
  • The instance of this interface object (because it is possible to have more than one realization of an interface object in a given device).
  • The property of the interface object one wants to access, QKnxInterfaceObjectProperty .
  • The data part which might consist of the number of elements one wants to read in this property and start index from where to read.

More specialized versions of the builder are also provided and it is recommended to prefer them over the generic version:

另请参阅 QKnxDeviceManagementFrame::MessageCode , QKnxDeviceManagementFrame ,和 Qt KNX Device Management Classes .

成员函数文档编制

QKnxDeviceManagementFrame Builder:: createFrame () const

Creates and returns a device management frame.

The service used depends on the frame's message code . All other fields, such as 对象类型 , object instance , interface object property , and depending on the service data , need to be set as well.

The common way to create a negative confirmation frame is:

auto negativeConfirmation = QKnxDeviceManagementFrame::builder()
    .setMessageCode(QKnxDeviceManagementFrame::MessageCode::FunctionPropertyStateReadConfirmation)
    .setObjectType(...)
    .setObjectInstance(...)
    .setProperty(...)
    .createFrame()
deviceManagement.sendFrame(negativeConfirmation);
					

The above code is equivalent to calling the FunctionPropertyStateReadBuilder::createNegativeConfirmation 函数。

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

另请参阅 QKnxDeviceManagementFrame and QKnxDeviceManagementFrame::isValid ().

Builder &Builder:: setData (const QKnxByteArray & data )

Sets the data of this builder to data and returns a reference to the builder.

Builder &Builder:: setMessageCode ( MessageCode code )

Sets the message code of this builder to code and returns a reference to the builder.

Builder &Builder:: setObjectInstance ( quint8 实例 )

Sets the object instance of this builder to 实例 and returns a reference to the builder.

Builder &Builder:: setObjectType ( QKnxInterfaceObjectType type )

Sets the interface object type of this builder to type and returns a reference to the builder.

Builder &Builder:: setProperty ( QKnxInterfaceObjectProperty pid )

Sets the interface object property of this builder to pid and returns a reference to the builder.