Blame domoticz-ozw-barrier-support-0002.patch

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