Add binary value cluster
parent
e2ac3a48ea
commit
6c2bccd775
|
|
@ -22,6 +22,7 @@ SOURCES += \
|
||||||
zcl/general/zigbeeclusteranalogvalue.cpp \
|
zcl/general/zigbeeclusteranalogvalue.cpp \
|
||||||
zcl/general/zigbeeclusterbinaryinput.cpp \
|
zcl/general/zigbeeclusterbinaryinput.cpp \
|
||||||
zcl/general/zigbeeclusterbinaryoutput.cpp \
|
zcl/general/zigbeeclusterbinaryoutput.cpp \
|
||||||
|
zcl/general/zigbeeclusterbinaryvalue.cpp \
|
||||||
zcl/general/zigbeeclustergroups.cpp \
|
zcl/general/zigbeeclustergroups.cpp \
|
||||||
zcl/general/zigbeeclusteridentify.cpp \
|
zcl/general/zigbeeclusteridentify.cpp \
|
||||||
zcl/general/zigbeeclusterlevelcontrol.cpp \
|
zcl/general/zigbeeclusterlevelcontrol.cpp \
|
||||||
|
|
@ -85,6 +86,7 @@ HEADERS += \
|
||||||
zcl/general/zigbeeclusteranalogvalue.h \
|
zcl/general/zigbeeclusteranalogvalue.h \
|
||||||
zcl/general/zigbeeclusterbinaryinput.h \
|
zcl/general/zigbeeclusterbinaryinput.h \
|
||||||
zcl/general/zigbeeclusterbinaryoutput.h \
|
zcl/general/zigbeeclusterbinaryoutput.h \
|
||||||
|
zcl/general/zigbeeclusterbinaryvalue.h \
|
||||||
zcl/general/zigbeeclustergroups.h \
|
zcl/general/zigbeeclustergroups.h \
|
||||||
zcl/general/zigbeeclusteridentify.h \
|
zcl/general/zigbeeclusteridentify.h \
|
||||||
zcl/general/zigbeeclusterlevelcontrol.h \
|
zcl/general/zigbeeclusterlevelcontrol.h \
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
*
|
||||||
|
* Copyright 2013 - 2020, nymea GmbH
|
||||||
|
* Contact: contact@nymea.io
|
||||||
|
*
|
||||||
|
* This file is part of nymea-zigbee.
|
||||||
|
* This project including source code and documentation is protected by copyright law, and
|
||||||
|
* remains the property of nymea GmbH. All rights, including reproduction, publication,
|
||||||
|
* editing and translation, are reserved. The use of this project is subject to the terms of a
|
||||||
|
* license agreement to be concluded with nymea GmbH in accordance with the terms
|
||||||
|
* of use of nymea GmbH, available under https://nymea.io/license
|
||||||
|
*
|
||||||
|
* GNU Lesser General Public License Usage
|
||||||
|
* Alternatively, this project may be redistributed and/or modified under the terms of the GNU
|
||||||
|
* Lesser General Public License as published by the Free Software Foundation; version 3.
|
||||||
|
* this project is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
* See the GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License along with this project.
|
||||||
|
* If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* For any further details and any questions please contact us under contact@nymea.io
|
||||||
|
* or see our FAQ/Licensing Information on https://nymea.io/license/faq
|
||||||
|
*
|
||||||
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
#include "zigbeeclusterbinaryvalue.h"
|
||||||
|
#include "loggingcategory.h"
|
||||||
|
|
||||||
|
ZigbeeClusterBinaryValue::ZigbeeClusterBinaryValue(ZigbeeNetwork *network, ZigbeeNode *node, ZigbeeNodeEndpoint *endpoint, Direction direction, QObject *parent) :
|
||||||
|
ZigbeeCluster(network, node, endpoint, ZigbeeClusterLibrary::ClusterIdBinaryValue, direction, parent)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void ZigbeeClusterBinaryValue::setAttribute(const ZigbeeClusterAttribute &attribute)
|
||||||
|
{
|
||||||
|
qCDebug(dcZigbeeCluster()) << "Update attribute" << m_node << m_endpoint << this << static_cast<Attribute>(attribute.id()) << attribute.dataType();
|
||||||
|
updateOrAddAttribute(attribute);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,66 @@
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
*
|
||||||
|
* Copyright 2013 - 2020, nymea GmbH
|
||||||
|
* Contact: contact@nymea.io
|
||||||
|
*
|
||||||
|
* This file is part of nymea-zigbee.
|
||||||
|
* This project including source code and documentation is protected by copyright law, and
|
||||||
|
* remains the property of nymea GmbH. All rights, including reproduction, publication,
|
||||||
|
* editing and translation, are reserved. The use of this project is subject to the terms of a
|
||||||
|
* license agreement to be concluded with nymea GmbH in accordance with the terms
|
||||||
|
* of use of nymea GmbH, available under https://nymea.io/license
|
||||||
|
*
|
||||||
|
* GNU Lesser General Public License Usage
|
||||||
|
* Alternatively, this project may be redistributed and/or modified under the terms of the GNU
|
||||||
|
* Lesser General Public License as published by the Free Software Foundation; version 3.
|
||||||
|
* this project is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
* See the GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License along with this project.
|
||||||
|
* If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* For any further details and any questions please contact us under contact@nymea.io
|
||||||
|
* or see our FAQ/Licensing Information on https://nymea.io/license/faq
|
||||||
|
*
|
||||||
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
#ifndef ZIGBEECLUSTERBINARYVALUE_H
|
||||||
|
#define ZIGBEECLUSTERBINARYVALUE_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
#include "zcl/zigbeecluster.h"
|
||||||
|
|
||||||
|
class ZigbeeClusterBinaryValue : public ZigbeeCluster
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
friend class ZigbeeNode;
|
||||||
|
friend class ZigbeeNetwork;
|
||||||
|
|
||||||
|
public:
|
||||||
|
enum Attribute {
|
||||||
|
AttributeActiveText = 0x0004,
|
||||||
|
AttributeDescription = 0x001C,
|
||||||
|
AttributeInactiveText = 0x002E,
|
||||||
|
AttributeMinimumOffTime = 0x0042,
|
||||||
|
AttributeMinimumOnTime = 0x0043,
|
||||||
|
AttributeOutOfService = 0x0051,
|
||||||
|
AttributePresentValue = 0x0055,
|
||||||
|
AttributePriorityArray = 0x0057,
|
||||||
|
AttributeReliability = 0x0067,
|
||||||
|
AttributeRelinquishDefault = 0x0068,
|
||||||
|
AttributeStatusFlags = 0x006F,
|
||||||
|
AttributeApplicationType = 0x0100
|
||||||
|
};
|
||||||
|
Q_ENUM(Attribute)
|
||||||
|
|
||||||
|
explicit ZigbeeClusterBinaryValue(ZigbeeNetwork *network, ZigbeeNode *node, ZigbeeNodeEndpoint *endpoint, Direction direction, QObject *parent = nullptr);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void setAttribute(const ZigbeeClusterAttribute &attribute) override;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // ZIGBEECLUSTERBINARYVALUE_H
|
||||||
|
|
@ -187,6 +187,8 @@ ZigbeeCluster *ZigbeeNodeEndpoint::createCluster(ZigbeeClusterLibrary::ClusterId
|
||||||
return new ZigbeeClusterBinaryInput(m_network, m_node, this, direction, this);
|
return new ZigbeeClusterBinaryInput(m_network, m_node, this, direction, this);
|
||||||
case ZigbeeClusterLibrary::ClusterIdBinaryOutput:
|
case ZigbeeClusterLibrary::ClusterIdBinaryOutput:
|
||||||
return new ZigbeeClusterBinaryOutput(m_network, m_node, this, direction, this);
|
return new ZigbeeClusterBinaryOutput(m_network, m_node, this, direction, this);
|
||||||
|
case ZigbeeClusterLibrary::ClusterIdBinaryValue:
|
||||||
|
return new ZigbeeClusterBinaryValue(m_network, m_node, this, direction, this);
|
||||||
case ZigbeeClusterLibrary::ClusterIdMultistateInput:
|
case ZigbeeClusterLibrary::ClusterIdMultistateInput:
|
||||||
return new ZigbeeClusterMultistateInput(m_network, m_node, this, direction, this);
|
return new ZigbeeClusterMultistateInput(m_network, m_node, this, direction, this);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@
|
||||||
#include "zcl/general/zigbeeclusteranalogvalue.h"
|
#include "zcl/general/zigbeeclusteranalogvalue.h"
|
||||||
#include "zcl/general/zigbeeclusterbinaryinput.h"
|
#include "zcl/general/zigbeeclusterbinaryinput.h"
|
||||||
#include "zcl/general/zigbeeclusterbinaryoutput.h"
|
#include "zcl/general/zigbeeclusterbinaryoutput.h"
|
||||||
|
#include "zcl/general/zigbeeclusterbinaryvalue.h"
|
||||||
#include "zcl/general/zigbeeclustermultistateinput.h"
|
#include "zcl/general/zigbeeclustermultistateinput.h"
|
||||||
|
|
||||||
#include "zcl/closures/zigbeeclusterdoorlock.h"
|
#include "zcl/closures/zigbeeclusterdoorlock.h"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue