QKnxDatapointType Class

The QKnxDatapointType class is a base class for datapoint types with specific properties. More...

Header: #include <QKnxDatapointType>
qmake: QT += knx
Inherited By:

QKnxFixedSizeDatapointType and QKnxVariableSizeDatapointType

Public Types

enum Type { Unknow, Dpt1_1Bit, DptSwitch, DptBool, ..., DptColourRGB }

Public Functions

QKnxDatapointType(Type type, int size)
QKnxDatapointType(const QString &dptId, int size)
QKnxDatapointType(quint16 mainType, quint16 subType, int size)
QKnxDatapointType(const QKnxDatapointType &other)
virtual ~QKnxDatapointType()
quint8 byte(quint16 index) const
double coefficient() const
const quint8 *constData() const
quint8 *data()
const quint8 *data() const
QString description() const
virtual bool isValid() const
int mainType() const
QVariant maximum() const
QString maximumText() const
QVariant minimum() const
QString minimumText() const
void setCoefficient(double coef)
void setDescription(const QString &description)
void setMaximum(const QVariant &maximum)
void setMaximumText(const QString &maximumText)
void setMinimum(const QVariant &minimum)
void setMinimumText(const QString &minimumText)
void setRange(const QVariant &minimum, const QVariant &maximum)
void setRangeText(const QString &minimumText, const QString &maximumText)
void setUnit(const QString &unit)
int size() const
int subType() const
void swap(QKnxDatapointType &other)
virtual QString toString() const
Type type() const
QString unit() const
bool operator!=(const QKnxDatapointType &other) const
QKnxDatapointType &operator=(const QKnxDatapointType &other)
QKnxDatapointType &operator=(QKnxDatapointType &&other)
bool operator==(const QKnxDatapointType &other) const
quint8 &operator[](int i)
const quint8 &operator[](int i) const

Protected Functions

void resize(int newSize)
bool setBytes(const T &bytesToSet, quint16 index, quint16 count)

Detailed Description

The QKnxDatapointType class is a base class for datapoint types with specific properties.

A datapoint type represents the data corresponding to a KNX device functionality. It describes the data, setting the rules about the format and values to be allowed, and it holds the bytes containing the data.

This data is used in the data part of the QKnxNpdu class. To retrieve the data of a data point type, call bytes().

There are two types of a QKnxDatapointType: QKnxFixedSizeDatapointType for fixed length datapoint types and QKnxVariableSizeDatapointType for variable length datapoint types.

A datapoint type is identified by its main number and a subnumber. Each main number corresponds to a datapoint type with a particular structure. The subnumbers correspond to different interpretations or naming of this structure.

The Qt KNX module provides a class for each datapoint type with the main number less than 30 and subnumber less than 100. All datapoint types with the same main number inherit from a datapoint type class representing the main number datapoint type characteristics.

Adding Datapoint Types

To implement a datapoint type described in the KNX documentation but not implemented in the Qt KNX module, one can create a class inheriting from QKnxFixedSizeDatapointType or QKnxVariableSizeDatapointType and register this new class using an instance of QKnxDatapointTypeFactory:

#include mynewdatapointtype.h

int main()
{
    int mainType = 65535;
    int subType = 100;
    int typeSize = 1; // size in bytes

    auto &factory = QKnxDatapointTypeFactory::instance() ;
    factory.registerType<MyNewDataPointType>(mainType, subType, typeSize);
}

Member Type Documentation

enum QKnxDatapointType::Type

This enum type holds the type of the datapoint type.

ConstantValueDescription
QKnxDatapointType::Unknow?An unknown datapoint type.
QKnxDatapointType::Dpt1_1Bit100000A fixed size datapoint type with the length of 1 bit. This is a boolean datapoint type, such as: switch on or off, move up or down, open and close, stop and start.
QKnxDatapointType::DptSwitch100001 
QKnxDatapointType::DptBool100002 
QKnxDatapointType::DptEnable100003 
QKnxDatapointType::DptRamp100004 
QKnxDatapointType::DptAlarm100005 
QKnxDatapointType::DptBinaryValue100006 
QKnxDatapointType::DptStep100007 
QKnxDatapointType::DptUpDown100008 
QKnxDatapointType::DptOpenClose100009 
QKnxDatapointType::DptStart100010 
QKnxDatapointType::DptState100011 
QKnxDatapointType::DptInvert100012 
QKnxDatapointType::DptDimSendStyle100013 
QKnxDatapointType::DptInputSource100014 
QKnxDatapointType::DptReset100015 
QKnxDatapointType::DptAck100016 
QKnxDatapointType::DptTrigger100017 
QKnxDatapointType::DptOccupancy100018 
QKnxDatapointType::DptWindowDoor100019 
QKnxDatapointType::DptLogicalFunction100021 
QKnxDatapointType::DptSceneAB100022 
QKnxDatapointType::DptShutterBlindsMode100023 
QKnxDatapointType::DptHeatCool100100 
QKnxDatapointType::Dpt2_1BitControlled200000A fixed size datapoint type with the length of 2 bits.
QKnxDatapointType::DptSwitchControl200001 
QKnxDatapointType::DptBoolControl200002 
QKnxDatapointType::DptEnableControl200003 
QKnxDatapointType::DptRampControl200004 
QKnxDatapointType::DptAlarmControl200005 
QKnxDatapointType::DptBinaryValueControl200006 
QKnxDatapointType::DptStepControl200007 
QKnxDatapointType::DptDirection1Control200008 
QKnxDatapointType::DptDirection2Control200009 
QKnxDatapointType::DptStartControl200010 
QKnxDatapointType::DptStateControl200011 
QKnxDatapointType::DptInvertControl200012 
QKnxDatapointType::Dpt3_3BitControlled300000A fixed size datapoint type with the length of 3 bits.
QKnxDatapointType::DptControlDimming300007Controls light dimming.
QKnxDatapointType::DptControlBlinds300008Controls blinds.
QKnxDatapointType::Dpt4_Character400000A fixed size datapoint type with the length of 1 byte that encodes a character.
QKnxDatapointType::DptCharAscii400001 
QKnxDatapointType::DptChar88591400002 
QKnxDatapointType::Dpt5_8bitUnsigned500000 
QKnxDatapointType::DptScaling500001 
QKnxDatapointType::DptAngle500003 
QKnxDatapointType::DptPercentU8500004 
QKnxDatapointType::DptDecimalFactor500005 
QKnxDatapointType::DptTariff500006 
QKnxDatapointType::DptValue1Ucount500010 
QKnxDatapointType::Dpt6_8bitSigned600000 
QKnxDatapointType::DptPercentV8600001 
QKnxDatapointType::DptValue1Count600010 
QKnxDatapointType::DptStatusMode3600020 
QKnxDatapointType::Dpt7_2ByteUnsigned700000 
QKnxDatapointType::DptValue2UCount700001 
QKnxDatapointType::DptTimePeriodMsec700002 
QKnxDatapointType::DptTimePeriod10Msec700003 
QKnxDatapointType::DptTimePeriod100Msec700004 
QKnxDatapointType::DptTimePeriodSec700005 
QKnxDatapointType::DptTimePeriodMin700006 
QKnxDatapointType::DptTimePeriodHrs700007 
QKnxDatapointType::DptPropertyDataType700010 
QKnxDatapointType::DptLengthMilliMeter700011 
QKnxDatapointType::DptUEICurrentMilliA700012 
QKnxDatapointType::DptBrightness700013 
QKnxDatapointType::Dpt8_2ByteSigned800000 
QKnxDatapointType::DptValue2Count800001 
QKnxDatapointType::DptDeltaTimeMsec800002 
QKnxDatapointType::DptDeltaTime10Msec800003 
QKnxDatapointType::DptDeltaTime100Msec800004 
QKnxDatapointType::DptDeltaTimeSec800005 
QKnxDatapointType::DptDeltaTimeMin800006 
QKnxDatapointType::DptDeltaTimeHrs800007 
QKnxDatapointType::DptPercentV16800010 
QKnxDatapointType::DptRotationAngle800011 
QKnxDatapointType::Dpt9_2ByteFloat900000 
QKnxDatapointType::DptTemperatureCelcius900001 
QKnxDatapointType::DptTemperatureKelvin900002 
QKnxDatapointType::DptTemperatureChange900003 
QKnxDatapointType::DptValueLux900004 
QKnxDatapointType::DptWindSpeed900005 
QKnxDatapointType::DptPressure900006 
QKnxDatapointType::DptHumidity900007 
QKnxDatapointType::DptAirQuality900008 
QKnxDatapointType::DptAirFlow900009 
QKnxDatapointType::DptTimeSecond900010 
QKnxDatapointType::DptTimeMilliSecond900011 
QKnxDatapointType::DptVoltage900020 
QKnxDatapointType::DptCurrent900021 
QKnxDatapointType::DptPowerDensity900022 
QKnxDatapointType::DptKelvinPerPercent900023 
QKnxDatapointType::DptPower900024 
QKnxDatapointType::DptVolumeFlow900025 
QKnxDatapointType::DptAmountRain900026 
QKnxDatapointType::DptTemperatureFahrenheit900027 
QKnxDatapointType::DptWindSpeedKmPerHour900028 
QKnxDatapointType::Dpt10_TimeOfDay1000000 
QKnxDatapointType::DptTimeOfDay1000001 
QKnxDatapointType::Dpt11_Date1100000 
QKnxDatapointType::DptDate1100001 
QKnxDatapointType::Dpt12_4ByteUnsigned1200000 
QKnxDatapointType::DptValue4Ucount1200001 
QKnxDatapointType::Dpt13_4ByteSigned1300000 
QKnxDatapointType::DptValue4Count1300001 
QKnxDatapointType::DptFlowRateCubicMeterPerHour1300002 
QKnxDatapointType::DptApparentEnergy1300011 
QKnxDatapointType::DptReactiveEnergy1300012 
QKnxDatapointType::DptActiveEnergykWh1300013 
QKnxDatapointType::Dpt_ApparentEnergykVAh1300014 
QKnxDatapointType::DptReactiveEnergykVARh1300015 
QKnxDatapointType::DptActiveEnergy1300010 
QKnxDatapointType::DptLongDeltaTimeSec1300100 
QKnxDatapointType::Dpt14_4ByteFloat1400000 
QKnxDatapointType::DptValueAccelerationAngular1400001 
QKnxDatapointType::DptValueActivationEnergy1400002 
QKnxDatapointType::DptValueActivity1400003 
QKnxDatapointType::DptValueMol1400004 
QKnxDatapointType::DptValueAmplitude1400005 
QKnxDatapointType::DptValueAngleRad1400006 
QKnxDatapointType::DptValueAngleDeg1400007 
QKnxDatapointType::DptValueAngularMomentum1400008 
QKnxDatapointType::DptValueAngularVelocity1400009 
QKnxDatapointType::DptValueArea1400010 
QKnxDatapointType::DptValueCapacitance1400011 
QKnxDatapointType::DptValueChargeDensitySurface1400012 
QKnxDatapointType::DptValueChargeDensityVolume1400013 
QKnxDatapointType::DptValueCompressibility1400014 
QKnxDatapointType::DptValueConductance1400015 
QKnxDatapointType::DptValueElectricalConductivity1400016 
QKnxDatapointType::DptValueDensity1400017 
QKnxDatapointType::DptValueElectricCharge1400018 
QKnxDatapointType::DptValueElectricCurrent1400019 
QKnxDatapointType::DptValueElectricCurrentDensity1400020 
QKnxDatapointType::DptValueElectricDipoleMoment1400021 
QKnxDatapointType::DptValueElectricDisplacement1400022 
QKnxDatapointType::DptValueElectricFieldStrength1400023 
QKnxDatapointType::DptValueElectricFlux1400024 
QKnxDatapointType::DptValueElectricFluxDensity1400025 
QKnxDatapointType::DptValueElectricPolarization1400026 
QKnxDatapointType::DptValueElectricPotential1400027 
QKnxDatapointType::DptValueElectricPotentialDifference1400028 
QKnxDatapointType::DptValueElectromagneticMoment1400029 
QKnxDatapointType::DptValueElectromotiveForce1400030 
QKnxDatapointType::DptValueEnergy1400031 
QKnxDatapointType::DptValueForce1400032 
QKnxDatapointType::DptValueFrequency1400033 
QKnxDatapointType::DptValueAngularFrequency1400034 
QKnxDatapointType::DptValueHeatCapacity1400035 
QKnxDatapointType::DptValueHeatFlowRate1400036 
QKnxDatapointType::DptValueHeatQuantity1400037 
QKnxDatapointType::DptValueImpedance1400038 
QKnxDatapointType::DptValueLength1400039 
QKnxDatapointType::DptValueLightQuantity1400040 
QKnxDatapointType::DptValueLuminance1400041 
QKnxDatapointType::DptValueLuminousFlux1400042 
QKnxDatapointType::DptValueLuminousIntensity1400043 
QKnxDatapointType::DptValueMagneticFieldStrength1400044 
QKnxDatapointType::DptValueMagneticFlux1400045 
QKnxDatapointType::DptValueMagneticFluxDensity1400046 
QKnxDatapointType::DptValueMagneticMoment1400047 
QKnxDatapointType::DptValueMagneticPolarization1400048 
QKnxDatapointType::DptValueMagnetization1400049 
QKnxDatapointType::DptValueMagnetomotiveForce1400050 
QKnxDatapointType::DptValueMass1400051 
QKnxDatapointType::DptValueMassFlux1400052 
QKnxDatapointType::DptValueMomentum1400053 
QKnxDatapointType::DptValuePhaseAngleRad1400054 
QKnxDatapointType::DptValuePhaseAngleDeg1400055 
QKnxDatapointType::DptValuePower1400056 
QKnxDatapointType::DptValuePowerFactor1400057 
QKnxDatapointType::DptValuePressure1400058 
QKnxDatapointType::DptValueReactance1400059 
QKnxDatapointType::DptValueResistance1400060 
QKnxDatapointType::DptValueResistivity1400061 
QKnxDatapointType::DptValueSelfInductance1400062 
QKnxDatapointType::DptValueSolidAngle1400063 
QKnxDatapointType::DptValueSoundIntensity1400064 
QKnxDatapointType::DptValueSpeed1400065 
QKnxDatapointType::DptValueStress1400066 
QKnxDatapointType::DptValueSurfaceTension1400067 
QKnxDatapointType::DptValueCommonTemperature1400068 
QKnxDatapointType::DptValueAbsoluteTemperature1400069 
QKnxDatapointType::DptValueTemperatureDifference1400070 
QKnxDatapointType::DptValueThermalCapacity1400071 
QKnxDatapointType::DptValueThermalConductivity1400072 
QKnxDatapointType::DptValueThermoelectricPower1400073 
QKnxDatapointType::DptValueTime1400074 
QKnxDatapointType::DptValueTorque1400075 
QKnxDatapointType::DptValueVolume1400076 
QKnxDatapointType::DptValueVolumeFlux1400077 
QKnxDatapointType::DptValueWeight1400078 
QKnxDatapointType::DptValueWork1400079 
QKnxDatapointType::DptValueAcceleration1400000 
QKnxDatapointType::Dpt15_EntranceAccess1500000 
QKnxDatapointType::Dpt16_CharacterString1600000 
QKnxDatapointType::DptStringASCII1600000 
QKnxDatapointType::DptString885911600001 
QKnxDatapointType::Dpt17_SceneNumber1700000 
QKnxDatapointType::DptSceneNumber1700001 
QKnxDatapointType::Dpt18_SceneControl1800000 
QKnxDatapointType::DptSceneControl1800001 
QKnxDatapointType::Dpt19_DataTime1900000 
QKnxDatapointType::DptDateTime1900001 
QKnxDatapointType::Dpt20_1Byte2000000 
QKnxDatapointType::DptScloMode2000001 
QKnxDatapointType::DptBuildingMode2000002 
QKnxDatapointType::DptOccMode2000003 
QKnxDatapointType::DptPriority2000004 
QKnxDatapointType::DptLightApplicationMode2000005 
QKnxDatapointType::DptApplicationArea2000006 
QKnxDatapointType::DptAlarmClassType2000007 
QKnxDatapointType::DptPsuMode2000008 
QKnxDatapointType::DptErrorClassSystem2000011 
QKnxDatapointType::DptErrorClassHvac2000012 
QKnxDatapointType::DptTimeDelay2000013 
QKnxDatapointType::DptBeaufortWindForceScale2000014 
QKnxDatapointType::DptSensorSelect2000017 
QKnxDatapointType::DptActuatorConnectType2000020 
QKnxDatapointType::DptCommandMode2001000 
QKnxDatapointType::DptAdditionalInfoTypes2001001 
QKnxDatapointType::Dpt21_8BitSet2100000 
QKnxDatapointType::DptGeneralStatus2100001 
QKnxDatapointType::DptDeviceControl2100002 
QKnxDatapointType::Dpt22_16BitSet2200000 
QKnxDatapointType::DptMedia2201000 
QKnxDatapointType::Dpt23_2BitSet2300000 
QKnxDatapointType::DptOnOffAction2300001 
QKnxDatapointType::DptAlarmReaction2300002 
QKnxDatapointType::DptUpDownAction2300003 
QKnxDatapointType::Dpt24_VariableString2400000 
QKnxDatapointType::DptVariableString885912400001 
QKnxDatapointType::Dpt25_2NibbleSet2500000 
QKnxDatapointType::Dpt26_8BitSet2600000 
QKnxDatapointType::DptSceneInfo2600001 
QKnxDatapointType::Dpt27_32BitSet2700000 
QKnxDatapointType::DptCombinedInfoOnOff2700001 
QKnxDatapointType::Dpt28_StringUtf82800000 
QKnxDatapointType::DptUtf82800001 
QKnxDatapointType::Dpt29_ElectricalEnergy2900000 
QKnxDatapointType::DptActiveEnergyV642900010 
QKnxDatapointType::DptApparentEnergyV642900011 
QKnxDatapointType::DptReactiveEnergyV642900012 
QKnxDatapointType::Dpt30_24TimesChannelActivation3000000 
QKnxDatapointType::DPT217_DatapointTypeVersion21700000 
QKnxDatapointType::DptVersion21700001 
QKnxDatapointType::Dpt22122100000 
QKnxDatapointType::DptSerialNumber22100001 
QKnxDatapointType::Dpt225_ScalingSpeed22500000 
QKnxDatapointType::Dpt232_3ByteColourRGB23200000 
QKnxDatapointType::DptColourRGB23200600 

Member Function Documentation

QKnxDatapointType::QKnxDatapointType(Type type, int size)

Default constructs an instance of QKnxDatapointType.

QKnxDatapointType::QKnxDatapointType(const QString &dptId, int size)

Default constructs an instance of QKnxDatapointType.

QKnxDatapointType::QKnxDatapointType(quint16 mainType, quint16 subType, int size)

Default constructs an instance of QKnxDatapointType.

QKnxDatapointType::QKnxDatapointType(const QKnxDatapointType &other)

Copy constructor.

[virtual] QKnxDatapointType::~QKnxDatapointType()

Destroys the instance of QKnxDatapointType. The destructor is virtual.

quint8 QKnxDatapointType::byte(quint16 index) const

double QKnxDatapointType::coefficient() const

See also setCoefficient().

const quint8 *QKnxDatapointType::constData() const

quint8 *QKnxDatapointType::data()

const quint8 *QKnxDatapointType::data() const

QString QKnxDatapointType::description() const

See also setDescription().

[virtual] bool QKnxDatapointType::isValid() const

int QKnxDatapointType::mainType() const

QVariant QKnxDatapointType::maximum() const

See also setMaximum().

QString QKnxDatapointType::maximumText() const

See also setMaximumText().

QVariant QKnxDatapointType::minimum() const

See also setMinimum().

QString QKnxDatapointType::minimumText() const

See also setMinimumText().

[protected] void QKnxDatapointType::resize(int newSize)

[protected] bool QKnxDatapointType::setBytes(const T &bytesToSet, quint16 index, quint16 count)

void QKnxDatapointType::setCoefficient(double coef)

See also coefficient().

void QKnxDatapointType::setDescription(const QString &description)

See also description().

void QKnxDatapointType::setMaximum(const QVariant &maximum)

See also maximum().

void QKnxDatapointType::setMaximumText(const QString &maximumText)

See also maximumText().

void QKnxDatapointType::setMinimum(const QVariant &minimum)

See also minimum().

void QKnxDatapointType::setMinimumText(const QString &minimumText)

See also minimumText().

void QKnxDatapointType::setRange(const QVariant &minimum, const QVariant &maximum)

void QKnxDatapointType::setRangeText(const QString &minimumText, const QString &maximumText)

void QKnxDatapointType::setUnit(const QString &unit)

See also unit().

int QKnxDatapointType::size() const

int QKnxDatapointType::subType() const

void QKnxDatapointType::swap(QKnxDatapointType &other)

[virtual] QString QKnxDatapointType::toString() const

Type QKnxDatapointType::type() const

QString QKnxDatapointType::unit() const

See also setUnit().

bool QKnxDatapointType::operator!=(const QKnxDatapointType &other) const

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

Copy-assignment operator.

QKnxDatapointType &QKnxDatapointType::operator=(QKnxDatapointType &&other)

Move-assignment operator.

bool QKnxDatapointType::operator==(const QKnxDatapointType &other) const

quint8 &QKnxDatapointType::operator[](int i)

const quint8 &QKnxDatapointType::operator[](int i) const

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