From 0d65f8fdcc320d8cc154c1a491a4984ef83a9040 Mon Sep 17 00:00:00 2001 From: jowerg Date: Sat, 22 Apr 2017 08:45:11 -0400 Subject: [PATCH] Initial COMMAND_CLASS_BARRIER_OPERATOR support --- .../openzwave/command_classes/BarrierOperator.h | 70 ++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 hardware/openzwave/command_classes/BarrierOperator.h diff --git a/hardware/openzwave/command_classes/BarrierOperator.h b/hardware/openzwave/command_classes/BarrierOperator.h new file mode 100644 index 000000000..0899304a1 --- /dev/null +++ b/hardware/openzwave/command_classes/BarrierOperator.h @@ -0,0 +1,70 @@ +//----------------------------------------------------------------------------- +// +// BarrierOperator.h +// +// Implementation of the COMMAND_CLASS_BARRIER_OPERATOR +// +// Copyright (c) 2016 srirams (https://github.com/srirams) +// +// SOFTWARE NOTICE AND LICENSE +// +// This file is part of OpenZWave. +// +// OpenZWave is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published +// by the Free Software Foundation, either version 3 of the License, +// or (at your option) any later version. +// +// OpenZWave 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 OpenZWave. If not, see . +// +//----------------------------------------------------------------------------- + +#ifndef _BarrierOperator_H +#define _BarrierOperator_H + +#include "command_classes/CommandClass.h" + +namespace OpenZWave +{ + class ValueByte; + class ValueBool; + + /** \brief Implements COMMAND_CLASS_BARRIER_OPERATOR (0x66), a Z-Wave device command class. + * \ingroup CommandClass + */ + class BarrierOperator: public CommandClass + { + public: + static CommandClass* Create( uint32 const _homeId, uint8 const _nodeId ){ return new BarrierOperator( _homeId, _nodeId ); } + virtual ~BarrierOperator(){} + + static uint8 const StaticGetCommandClassId(){ return 0x66; } + static string const StaticGetCommandClassName(){ return "COMMAND_CLASS_BARRIER_OPERATOR"; } + + // From CommandClass + virtual bool RequestState( uint32 const _requestFlags, uint8 const _instance, Driver::MsgQueue const _queue ); + virtual bool RequestValue( uint32 const _requestFlags, uint8 const _index, uint8 const _instance, Driver::MsgQueue const _queue ); + bool RequestSignalSupport( uint8 const _instance, Driver::MsgQueue const _queue ); + virtual uint8 const GetCommandClassId()const{ return StaticGetCommandClassId(); } + virtual string const GetCommandClassName()const{ return StaticGetCommandClassName(); } + virtual bool HandleMsg( uint8 const* _data, uint32 const _length, uint32 const _instance = 1 ); + virtual bool SetValue(Value const& _value); + + virtual uint8 GetMaxVersion(){ return 3; } + + protected: + virtual void CreateVars( uint8 const _instance ); + + private: + BarrierOperator( uint32 const _homeId, uint8 const _nodeId ); + }; + +} // namespace OpenZWave + +#endif