SecureBuilder Class

class QKnxNetIpTimerNotifyProxy::SecureBuilder

The QKnxNetIpTimerNotifyProxy::SecureBuilder class provides the means to create a KNXnet/IP timer notify frame. More...

Public Functions

SecureBuilder(const SecureBuilder &other)
SecureBuilder()
SecureBuilder &operator=(const SecureBuilder &other)
~SecureBuilder()
QKnxNetIpFrame create(const QKnxByteArray &backboneKey, quint16 ssid) const
SecureBuilder &setMessageTag(quint16 tag)
SecureBuilder &setSerialNumber(const QKnxByteArray &serialNumber)
SecureBuilder &setTimerValue(quint48 timerValue)

Detailed Description

This class is part of the Qt KNX module and currently available as a Technology Preview, and therefore the API and functionality provided by the class may be subject to change at any time without prior notice.

Note: To use this class OpenSSL must be supported on your target system.

This frame will be sent during secure KNXnet/IP multicast group communication to keep the multicast group member's timer values synchronized. The frame is therefore sent to the KNXnet/IP routing endpoint on port 3671 of the configured routing multicast address.

The common way to create a timer notify frame is:

auto sessionId = ...
auto backboneKey = ... // the backbone key used

auto netIpFrame = QKnxNetIpTimerNotifyProxy::builder()
    .setTimerValue(15021976)
    .setSerialNumber(QKnxByteArray::fromHex("0123456789AB"))
    .setMessageTag(quint16(QRandomGenerator::global()->generate())
    .create(backboneKey, sessionId);

See also QKnxCryptographicEngine.

Member Function Documentation

SecureBuilder::SecureBuilder(const SecureBuilder &other)

Constructs a copy of other.

SecureBuilder::SecureBuilder()

Creates a new empty timer notify frame builder object.

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

Assigns the specified other to this object.

SecureBuilder::~SecureBuilder()

Destroys the object and frees any allocated resources.

QKnxNetIpFrame SecureBuilder::create(const QKnxByteArray &backboneKey, quint16 ssid) const

Creates and returns a KNXnet/IP timer notify frame.

The function computes the AES128 CCM message authentication code (MAC) with the given backbone key backboneKey and the session ID ssid and appends it to the newly created frame.

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

See also isValid().

SecureBuilder &SecureBuilder::setMessageTag(quint16 tag)

Sets the message tag of the generic KNXnet/IP timer notify frame to tag and returns a reference to the builder.

In case of a periodic or initial notify the tag contains a random value. In case of an update notify this is the value of the outdated frame triggering the update.

SecureBuilder &SecureBuilder::setSerialNumber(const QKnxByteArray &serialNumber)

Sets the serial number to serialNumber and returns a reference to the builder.

Note: The serial number must contain exactly 6 bytes.

SecureBuilder &SecureBuilder::setTimerValue(quint48 timerValue)

Sets the timer value to timerValue and returns a reference to the builder.

Note: The size of a timer value is limited to 48 bits, so the maximum number can be 281474976710655. Passing a larger value will result in creating an invalid frame.

© 2023 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.