QKnxNpdu Class

This class represents the part of the QKnxCemiFrame to be read by the network, transport and application layers. More...

Header: #include <QKnxNpdu>
qmake: QT += knx
Inherits: QKnxByteStore (private)

Public Types

enum ApplicationControlField { GroupValueRead, GroupValueResponse, GroupValueWrite, IndividualAddressWrite, ..., Invalid }
enum EraseCode { Reserved, ConfirmedRestart, FactoryReset, ResetIa, ..., Invalid }
enum ErrorCode { NoError, Error }
enum LinkWriteFlags { AddGroupAddress, AddSendingGroupAddress, AddNotSendingGroupAddress, DeleteGroupAddress }
enum ResetType { BasicRestart, MasterRestart }
enum TransportControlField { DataGroup, DataBroadcast, DataSystemBroadcast, DataTagGroup, ..., Invalid }

Public Functions

QKnxNpdu() = default
QKnxNpdu(TransportControlField tpci)
QKnxNpdu(TransportControlField tpci, ApplicationControlField apci)
QKnxNpdu(TransportControlField tpci, ApplicationControlField apci, const QByteArray &data)
QKnxNpdu(TransportControlField tpci, ApplicationControlField apci, quint8 seqNumber, const QByteArray &data = {})
~QKnxNpdu() override = default
ApplicationControlField applicationControlField() const
QByteArray data() const
quint8 dataSize() const
bool isValid() const
quint8 sequenceNumber() const
void setApplicationControlField(ApplicationControlField apci)
void setData(const QByteArray &data)
void setSequenceNumber(quint8 seqNumber)
void setTransportControlField(TransportControlField tpci)
TransportControlField transportControlField() const

Static Public Members

QKnxNpdu fromBytes(const T &type, quint16 index, quint8 size = 0)

Additional Inherited Members

Detailed Description

This class represents the part of the QKnxCemiFrame to be read by the network, transport and application layers.

To build a valid NPDU it is recommended to use the QKnxNpduFactory. Reading the bytes from left to right, a NPDU is composed of the following information:

If applicable, the T_CONNECT NPDU holds no application layer service for example, and the data and other information (if applicable, depending on the chosen service).

Member Type Documentation

enum QKnxNpdu::ApplicationControlField

This enum describes the message code dedicated to the application and representing an application service.

ConstantValue
QKnxNpdu::GroupValueRead0x0000
QKnxNpdu::GroupValueResponse0x0040
QKnxNpdu::GroupValueWrite0x0080
QKnxNpdu::IndividualAddressWrite0x00c0
QKnxNpdu::IndividualAddressRead0x0100
QKnxNpdu::IndividualAddressResponse0x0140
QKnxNpdu::AdcRead0x0180
QKnxNpdu::AdcResponse0x01c0
QKnxNpdu::SystemNetworkParameterRead0x01c8
QKnxNpdu::SystemNetworkParameterResponse0x01c9
QKnxNpdu::SystemNetworkParameterWrite0x01ca
QKnxNpdu::MemoryRead0x0200
QKnxNpdu::MemoryResponse0x0240
QKnxNpdu::MemoryWrite0x0280
QKnxNpdu::UserMemoryRead0x02c0
QKnxNpdu::UserMemoryResponse0x02c1
QKnxNpdu::UserMemoryWrite0x02c2
QKnxNpdu::UserManufacturerInfoRead0x02c5
QKnxNpdu::UserManufacturerInfoResponse0x02c6
QKnxNpdu::FunctionPropertyCommand0x02c7
QKnxNpdu::FunctionPropertyStateRead0x02c8
QKnxNpdu::FunctionPropertyStateResponse0x02c9
QKnxNpdu::DeviceDescriptorRead0x0300
QKnxNpdu::DeviceDescriptorResponse0x0340
QKnxNpdu::Restart0x0380
QKnxNpdu::AuthorizeRequest0x03d1
QKnxNpdu::AuthorizeResponse0x03d2
QKnxNpdu::KeyWrite0x03d3
QKnxNpdu::KeyResponse0x03d4
QKnxNpdu::PropertyValueRead0x03d5
QKnxNpdu::PropertyValueResponse0x03d6
QKnxNpdu::PropertyValueWrite0x03d7
QKnxNpdu::PropertyDescriptionRead0x03d8
QKnxNpdu::PropertyDescriptionResponse0x03d9
QKnxNpdu::NetworkParameterRead0x03da
QKnxNpdu::NetworkParameterResponse0x03db
QKnxNpdu::IndividualAddressSerialNumberRead0x03dc
QKnxNpdu::IndividualAddressSerialNumberResponse0x03dd
QKnxNpdu::IndividualAddressSerialNumberWrite0x03de
QKnxNpdu::DomainAddressWrite0x03e0
QKnxNpdu::DomainAddressRead0x03e1
QKnxNpdu::DomainAddressResponse0x03e2
QKnxNpdu::DomainAddressSelectiveRead0x03e3
QKnxNpdu::NetworkParameterWrite0x03e4
QKnxNpdu::NetworkParameterInfoReport0x03db
QKnxNpdu::LinkRead0x03e5
QKnxNpdu::LinkResponse0x03e6
QKnxNpdu::LinkWrite0x03e7
QKnxNpdu::GroupPropValueRead0x03e8
QKnxNpdu::GroupPropValueResponse0x03e9
QKnxNpdu::GroupPropValueWrite0x03ea
QKnxNpdu::GroupPropValueInfoReport0x03eb
QKnxNpdu::DomainAddressSerialNumberRead0x03ec
QKnxNpdu::DomainAddressSerialNumberResponse0x03ed
QKnxNpdu::DomainAddressSerialNumberWrite0x03ee
QKnxNpdu::FileStreamInfoReport0x03f0
QKnxNpdu::Invalid0xffff

enum QKnxNpdu::EraseCode

This enum describes the possible erase codes needing in the building of NPDU with service QKnxNpdu::Restart.

ConstantValue
QKnxNpdu::Reserved0
QKnxNpdu::ConfirmedRestart1
QKnxNpdu::FactoryReset2
QKnxNpdu::ResetIa3
QKnxNpdu::ResetAp4
QKnxNpdu::ResetParam5
QKnxNpdu::ResetLinks6
QKnxNpdu::ResetWithoutIa7
QKnxNpdu::Invalid8

enum QKnxNpdu::ErrorCode

This enum describes the possible error codes needing in the building of NPDU with service QKnxNpdu::FunctionPropertyStateResponse or QKnxNpdu::Restart

ConstantValue
QKnxNpdu::NoError0x00
QKnxNpdu::Error0x01

enum QKnxNpdu::LinkWriteFlags

This enum describes the possible link write flags needing in the building of NPDU with service QKnxNpdu::LinkWrite.

ConstantValue
QKnxNpdu::AddGroupAddress0x00
QKnxNpdu::AddSendingGroupAddress0x01
QKnxNpdu::AddNotSendingGroupAddress0x00
QKnxNpdu::DeleteGroupAddress0x02

enum QKnxNpdu::ResetType

This enum describes the possible reset types needing in the building of NPDU with service QKnxNpdu::Restart.

ConstantValue
QKnxNpdu::BasicRestart0x00
QKnxNpdu::MasterRestart0x01

enum QKnxNpdu::TransportControlField

This enum describes the possible message code dedicated to the transport layer.

ConstantValue
QKnxNpdu::DataGroup0x00
QKnxNpdu::DataBroadcast0x00
QKnxNpdu::DataSystemBroadcast0x00
QKnxNpdu::DataTagGroup0x04
QKnxNpdu::DataIndividual0x00
QKnxNpdu::DataConnected0x40
QKnxNpdu::Connect0x80
QKnxNpdu::Disconnect0x81
QKnxNpdu::Acknowledge0xc2
QKnxNpdu::NoAcknowledge0xc3
QKnxNpdu::Invalid0xfc

Member Function Documentation

[default] QKnxNpdu::QKnxNpdu()

Default constructs an instance of QKnxNpdu.

QKnxNpdu::QKnxNpdu(TransportControlField tpci)

Default constructs an instance of QKnxNpdu.

QKnxNpdu::QKnxNpdu(TransportControlField tpci, ApplicationControlField apci)

Default constructs an instance of QKnxNpdu.

QKnxNpdu::QKnxNpdu(TransportControlField tpci, ApplicationControlField apci, const QByteArray &data)

Default constructs an instance of QKnxNpdu.

QKnxNpdu::QKnxNpdu(TransportControlField tpci, ApplicationControlField apci, quint8 seqNumber, const QByteArray &data = {})

Default constructs an instance of QKnxNpdu.

[default] QKnxNpdu::~QKnxNpdu()

Destroys the instance of QKnxNpdu.

ApplicationControlField QKnxNpdu::applicationControlField() const

Returns the Application layer control field of the QKnxNpdu.

See also setApplicationControlField().

QByteArray QKnxNpdu::data() const

See also setData().

quint8 QKnxNpdu::dataSize() const

[static] QKnxNpdu QKnxNpdu::fromBytes(const T &type, quint16 index, quint8 size = 0)

bool QKnxNpdu::isValid() const

Returns true if the current NPDU is valid.

Note: This function is not implemented for every services. To make sure your NPDU is correct, use the QKnxNpduFactory.

quint8 QKnxNpdu::sequenceNumber() const

See also setSequenceNumber().

void QKnxNpdu::setApplicationControlField(ApplicationControlField apci)

Sets the Application layer control field to apci.

See also applicationControlField().

void QKnxNpdu::setData(const QByteArray &data)

See also data().

void QKnxNpdu::setSequenceNumber(quint8 seqNumber)

See also sequenceNumber().

void QKnxNpdu::setTransportControlField(TransportControlField tpci)

Sets the Transport layer control field to tpci.

See also transportControlField().

TransportControlField QKnxNpdu::transportControlField() const

Returns the Transport layer control field of the QKnxNpdu.

See also setTransportControlField().

© 2017 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.