PropertyReadBuilder Class

class QKnxDeviceManagementFrame ::PropertyReadBuilder

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

公共函数

QKnxDeviceManagementFrame createConfirmation (const QKnxByteArray & data , const QKnxDeviceManagementFrame & request = {}) const
QKnxDeviceManagementFrame createNegativeConfirmation (QKnxNetIpCemiServer::Error error , const QKnxDeviceManagementFrame & request = {}) const
QKnxDeviceManagementFrame createRequest () const
PropertyReadBuilder & setNumberOfElements (quint8 noe )
PropertyReadBuilder & setObjectInstance (quint8 实例 )
PropertyReadBuilder & setObjectType (QKnxInterfaceObjectType type )
PropertyReadBuilder & setProperty (QKnxInterfaceObjectProperty pid )
PropertyReadBuilder & setStartIndex (quint16 startIndex )

详细描述

The property read service is used by a common external message interface (cEMI) client to send a property read request frame, M_PropRead.req . It must be followed by a property read confirmation frame, M_PropRead.con , sent by a cEMI server. The confirmation indicates whether the request was successful.

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

成员函数文档编制

QKnxDeviceManagementFrame PropertyReadBuilder:: createConfirmation (const QKnxByteArray & data , const QKnxDeviceManagementFrame & request = {}) const

Creates a and returns a device management property read confirmation frame with the data field set to data .

The available default argument request can be used to fill some of the returned frame fields instead of using the setter functions provided.

The common way to create such a request is:

void MyCemiServer::slotFrameReceived(const QKnxDeviceManagementFrame &request)
{
    // do some work
    auto data = ...
    auto confirmation = QKnxDeviceManagementFrame::propertyReadBuilder()
        .createConfirmation(data, request);
    deviceManagement.sendFrame(confirmation);
}
					

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

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

QKnxDeviceManagementFrame PropertyReadBuilder:: createNegativeConfirmation ( QKnxNetIpCemiServer::Error error , const QKnxDeviceManagementFrame & request = {}) const

Creates and returns a negative device management property read confirmation frame.

The available default argument request can be used to fill some of the returned frame fields instead of using the setter functions provided.

The number of elements of a negative response is set to zero and the start index needs to be set to the value received with the request.

The error field of a negative response contains information about the error as a QKnx::NetIp::CemiServer::Error 值。

The common way to create such a confirmation is:

void MyCemiServer::slotFrameReceived(const QKnxDeviceManagementFrame &request)
{
    // do some work
    bool nonExistingProperty = ...
    if (nonExistingProperty) {
        auto confirmation = QKnxDeviceManagementFrame::propertyReadBuilder()
            .createNegativeConfirmation(QKnxNetIpCemiServer::Error::NonExistingProperty,
                                        request);
        deviceManagement.sendFrame(confirmation);
    }
}
					

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

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

QKnxDeviceManagementFrame PropertyReadBuilder:: createRequest () const

Creates a and returns a device management property read request frame.

The common way to create such a request is:

auto request = QKnxDeviceManagementFrame::propertyReadBuilder()
    .setObjectType(...)
    .setObjectInstance(...)
    .setProperty(...)
    .setNumberOfElements(...)
    .setStartIndex(...)
    .createRequest()
deviceManagement.sendFrame(request);
					

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

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

PropertyReadBuilder &PropertyReadBuilder:: setNumberOfElements ( quint8 noe )

Sets the number of elements of this builder to noe and returns a reference to the builder.

PropertyReadBuilder &PropertyReadBuilder:: setObjectInstance ( quint8 实例 )

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

PropertyReadBuilder &PropertyReadBuilder:: setObjectType ( QKnxInterfaceObjectType type )

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

PropertyReadBuilder &PropertyReadBuilder:: setProperty ( QKnxInterfaceObjectProperty pid )

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

PropertyReadBuilder &PropertyReadBuilder:: setStartIndex ( quint16 startIndex )

Sets the start index of this builder to startIndex and returns a reference to the builder.