QKnxTimeOfDay Class

The QKnxTimeOfDay class is a datapoint type for the time of day. More...

Header: #include <QKnxTimeOfDay>
qmake: QT += knx
Inherits: QKnxFixedSizeDatapointType

Public Functions

QKnxTimeOfDay(quint8 h, quint8 m, quint8 s = 0, QKnxTime::DayOfWeek day = QKnxTime::DayOfWeek::Ignore)
QKnxTimeOfDay(const QKnxTime &time)
QKnxTimeOfDay()
QKnxTime::DayOfWeek dayOfDay() const
quint8 hour() const
quint8 minute() const
quint8 second() const
bool setDayOfWeek(QKnxTime::DayOfWeek day)
bool setHour(quint8 hour)
bool setMinute(quint8 minute)
bool setSecond(quint8 second)
bool setValue(const QKnxTime &time)
QKnxTime value() const

Reimplemented Public Functions

virtual bool isValid() const override

Detailed Description

This is a fixed size datapoint type with the length of 3 bytes.

The left byte of the data holds the day as 3 bits and the hour as 5 bits, the middle byte holds the minutes as 5 bits, and the right byte holds the seconds as 5 bits.

Valid times of day are from No day, 00:00:00 to Sunday, 23:59:59.

See also QKnxDatapointType and Qt KNX Datapoint Type Classes.

Member Function Documentation

QKnxTimeOfDay::QKnxTimeOfDay(quint8 h, quint8 m, quint8 s = 0, QKnxTime::DayOfWeek day = QKnxTime::DayOfWeek::Ignore)

Creates a fixed size datapoint type with the hour set to h, minutes set to m, seconds set to s, and the day of the week set to day.

QKnxTimeOfDay::QKnxTimeOfDay(const QKnxTime &time)

Creates a fixed size datapoint type with the time of day set to time.

QKnxTimeOfDay::QKnxTimeOfDay()

Creates a fixed size datapoint type with the time of day set to 0,0,0.

QKnxTime::DayOfWeek QKnxTimeOfDay::dayOfDay() const

Returns the day of the week stored in the datapoint type.

quint8 QKnxTimeOfDay::hour() const

Returns the hour stored in the datapoint type.

See also setHour().

[override virtual] bool QKnxTimeOfDay::isValid() const

Reimplements: QKnxDatapointType::isValid() const.

quint8 QKnxTimeOfDay::minute() const

Returns the minutes stored in the datapoint type.

See also setMinute().

quint8 QKnxTimeOfDay::second() const

Returns the seconds stored in the datapoint type.

See also setSecond().

bool QKnxTimeOfDay::setDayOfWeek(QKnxTime::DayOfWeek day)

Sets the day of the week to day.

If the value is outside the allowed range , returns false and does not set the value.

bool QKnxTimeOfDay::setHour(quint8 hour)

Sets the hour to hour.

If the value is outside the allowed range (from 0 to 23 included), returns false and does not set the value.

See also hour().

bool QKnxTimeOfDay::setMinute(quint8 minute)

Sets the minute to minute.

If the value is outside the allowed range (from 0 to 59 included), returns false and does not set the value.

See also minute().

bool QKnxTimeOfDay::setSecond(quint8 second)

Sets the seconds to second.

If the value is outside the allowed range (from 0 to 59 included), returns false and does not set the value.

See also second().

bool QKnxTimeOfDay::setValue(const QKnxTime &time)

Sets the time of day stored in the datapoint type to time.

If the value is outside the allowed range, returns false and does not set the value.

See also value().

QKnxTime QKnxTimeOfDay::value() const

Returns the time of day stored in the datapoint type.

See also setValue().

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