FunctionPropertyStateReadBuilder Class

class QKnxDeviceManagementFrame ::FunctionPropertyStateReadBuilder

The QKnxDeviceManagementFrame::FunctionPropertyStateReadBuilder class provides the means to create valid device management function property state read service. 更多...

公共函数

QKnxDeviceManagementFrame createConfirmation (QKnxNetIpCemiServer::ReturnCode code , const QKnxByteArray & data , const QKnxDeviceManagementFrame & request = {}) const
QKnxDeviceManagementFrame createNegativeConfirmation (const QKnxDeviceManagementFrame & request = {}) const
QKnxDeviceManagementFrame createRequest (const QKnxByteArray & data ) const
FunctionPropertyStateReadBuilder & setObjectInstance (quint8 实例 )
FunctionPropertyStateReadBuilder & setObjectType (QKnxInterfaceObjectType type )
FunctionPropertyStateReadBuilder & setProperty (QKnxInterfaceObjectProperty pid )

详细描述

The function property state read service is used by a common external message interface (cEMI) client to send a function property state read request frame, M_FuncPropStateRead.req .

It must be followed by a function property state read confirmation frame, M_FuncPropStateRead.con , sent by a cEMI server. The confirmation indicates whether the request was successful.

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

成员函数文档编制

QKnxDeviceManagementFrame FunctionPropertyStateReadBuilder:: createConfirmation ( QKnxNetIpCemiServer::ReturnCode code , const QKnxByteArray & data , const QKnxDeviceManagementFrame & request = {}) const

Creates and returns a device management function property state confirmation frame with the return code set to code and the data field 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 confirmation is:

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

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

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

QKnxDeviceManagementFrame FunctionPropertyStateReadBuilder:: createNegativeConfirmation (const QKnxDeviceManagementFrame & request = {}) const

Creates and returns a negative device management function property state 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 common way to create such a confirmation is:

void MyCemiServer::slotFrameReceived(const QKnxDeviceManagementFrame &request)
{
    // do some work
    bool error = ...
    if (error) {
        auto confirmation = QKnxDeviceManagementFrame::functionPropertyStateReadBuilder()
            .createNegativeConfirmation(request);
        deviceManagement.sendFrame(confirmation);
    }
}
					

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

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

QKnxDeviceManagementFrame FunctionPropertyStateReadBuilder:: createRequest (const QKnxByteArray & data ) const

Creates and returns a device management function property state request frame with the data field set to data .

The common way to create such a request is:

auto request = QKnxDeviceManagementFrame::functionPropertyStateReadBuilder()
    .setObjectType(...)
    .setObjectInstance(...)
    .setProperty(...)
    .createRequest(...);
deviceManagement.sendFrame(request);
					

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

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

FunctionPropertyStateReadBuilder &FunctionPropertyStateReadBuilder:: setObjectInstance ( quint8 实例 )

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

FunctionPropertyStateReadBuilder &FunctionPropertyStateReadBuilder:: setObjectType ( QKnxInterfaceObjectType type )

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

FunctionPropertyStateReadBuilder &FunctionPropertyStateReadBuilder:: setProperty ( QKnxInterfaceObjectProperty pid )

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