⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 zw_cmd_classes.cs

📁 zwave 无线通讯协议 PC controller 控制器源码
💻 CS
📖 第 1 页 / 共 5 页
字号:
//////////////////////////////////////////////////////////////////////////////////////////////// 
//
//          #######
//          #   ##    ####   #####    #####  ##  ##   #####
//             ##    ##  ##  ##  ##  ##      ##  ##  ##
//            ##  #  ######  ##  ##   ####   ##  ##   ####
//           ##  ##  ##      ##  ##      ##   #####      ##
//          #######   ####   ##  ##  #####       ##  #####
//                                           #####
//          Z-Wave, the wireless language.
//
//          Copyright Zensys A/S, 2003
//
//          All Rights Reserved
//
//          Description:   Device and Command Class types and definitions.
//                         Remember to increase ?_VERSION constant when the Command Class 
//                         is changed. Updated in accordance with Z-Wave Device Class 
//                         Specification, Doc. nr. 903100206, Version 1.06.
//
//          Author:   Samer Seoud
//
//          Last Changed By:  $Author: jrm $
//          Revision:         $Revision: 1.13 $
//          Last Changed:     $Date: 2007/01/26 16:07:41 $
//
//////////////////////////////////////////////////////////////////////////////////////////////
using System;
using System.IO;
using System.Collections;
using System.Globalization;
using System.Text;
#if !WIN_CE
using System.Runtime.Serialization;
#endif
using System.Xml;
using System.Xml.Serialization;

namespace ZWaveCmdClass
{
    /// <summary>
    /// 
    /// </summary>
    public enum ZWaveCmdClsType
    {
        ZW_CLASS_PROTOCOL = 0x01,
        ZW_CLASS_APPL = 0x20,
        ZW_CLASS_NONE = 0xFF
    }
    /// <summary>
    /// 
    /// </summary>
    public enum ZWaveProtocolCmdClass
    {
        ZWAVE_CMD_CLASS_PROTOCOL = 0x01,    /* Z-Wave protocol class command */
        ZWAVE_CMD_CLASS_APPL_MIN = 0x20,    /* application specific command range */
        ZWAVE_CMD_CLASS_APPL_MAX = 0xFF
    }

    /// <summary>
    /// 
    /// </summary>
    public enum ZWaveProtocolCmd
    {
        ZWAVE_CMD_NOP = 0x00,
        ZWAVE_CMD_NODE_INFO = 0x01,
        ZWAVE_CMD_REQUEST_NODE_INFO = 0x02,
        ZWAVE_CMD_ASSIGN_IDS = 0x03,
        ZWAVE_CMD_FIND_NODES_IN_RANGE = 0x04,
        ZWAVE_CMD_GET_NODES_IN_RANGE = 0x05,
        ZWAVE_CMD_RANGE_INFO = 0x06,
        ZWAVE_CMD_CMD_COMPLETE = 0x07,
        ZWAVE_CMD_TRANSFER_PRESENTATION = 0x08,
        ZWAVE_CMD_TRANSFER_NODE_INFO = 0x09,
        ZWAVE_CMD_TRANSFER_RANGE_INFO = 0x0a,
        ZWAVE_CMD_TRANSFER_END = 0x0b,
        ZWAVE_CMD_ASSIGN_RETURN_ROUTE = 0x0c,
        ZWAVE_CMD_NEW_NODE_REGISTERED = 0x0d,
        ZWAVE_CMD_NEW_RANGE_REGISTERED = 0x0e,
        ZWAVE_CMD_TRANSFER_NEW_PRIMARY_COMPLETE = 0x0f,
        ZWAVE_CMD_AUTOMATIC_CONTROLLER_UPDATE_START = 0x10,
        ZWAVE_CMD_SUC_NODE_ID = 0x11,
        ZWAVE_CMD_SET_SUC = 0x12,
        ZWAVE_CMD_SET_SUC_ACK = 0x13,
        ZWAVE_CMD_ASSIGN_SUC_RETURN_ROUTE = 0x14,
        ZWAVE_CMD_STATIC_ROUTE_REQUEST = 0x15,
        ZWAVE_CMD_LOST = 0x16,
        ZWAVE_CMD_ACCEPT_LOST = 0x17,
        ZWAVE_CMD_NOP_POWER = 0x18,
        ZWAVE_CMD_RESERVE_NODE_IDS = 0x19,
        ZWAVE_CMD_RESERVED_IDS = 0x1a

    }

    /// <summary>
    /// Summary description for Class1.
    /// </summary>
    public class ZW_cmd_classes
    {
        public ZW_cmd_classes()
        {
        }

        internal enum sucStat
        {
            ZW_SUC_UPDATE_DONE = 0x00,
            ZW_SUC_UPDATE_ABORT = 0x01,
            ZW_SUC_UPDATE_WAIT = 0x02,
            ZW_SUC_UPDATE_DISABLED = 0x03,
            ZW_SUC_UPDATE_OVERFLOW = 0x04

        }
        const byte ZWAVE_APPLICATION_VAL_OFFSET = 2;
        public enum ZWaveStat
        {
            /* Z-Wave protocol status */
            ZWAVE_TRANSFER_FAIL = 0x00,
            ZWAVE_TRANSFER_OK = 0x01,
            /* These values are calculated from values in ZW_controller_api.h
             * and should not be changed without checking effects*/
            ZWAVE_TRANSFER_UPDATE_DONE = (ZWAVE_APPLICATION_VAL_OFFSET + sucStat.ZW_SUC_UPDATE_DONE),
            ZWAVE_TRANSFER_UPDATE_ABORT = (ZWAVE_APPLICATION_VAL_OFFSET + sucStat.ZW_SUC_UPDATE_ABORT),
            ZWAVE_TRANSFER_UPDATE_WAIT = (ZWAVE_APPLICATION_VAL_OFFSET + sucStat.ZW_SUC_UPDATE_WAIT),
            ZWAVE_TRANSFER_UPDATE_DISABLED = (ZWAVE_APPLICATION_VAL_OFFSET + sucStat.ZW_SUC_UPDATE_DISABLED),
            ZWAVE_TRANSFER_UPDATE_OVERFLOW = (ZWAVE_APPLICATION_VAL_OFFSET + sucStat.ZW_SUC_UPDATE_OVERFLOW)
        }


        public enum ParamType
        {
            BYTE = 0x01,
            WORD = 0x02,
            DWORD = 0x03,
            BIT_24 = 0x04,
            ARRAY = 0x05,
            BITMASK = 0x06,
            STRUCT_BYTE = 0x07,
            ENUM = 0x08,
            ENUM_ARRAY = 0x09,
            MULTI_ARRAY = 0x0a,
            CONST = 0xb,
            VARIANT = 0xc,
            VARIANT_GROUP = 0xd
        }
        [Serializable]
        public class ZWaveCmdClass
        {
            const string assemplyName = "";
            [Serializable]
            public struct ValueAttrib // the attribute of  byte word dword or bit_24 value
            {
                public bool hasDefines;
                public bool showHex;

            }

            [Serializable]
            public struct ArrayAttrib // the attribute of  an array parameter
            {
                public byte len;  // dynamic array if the len is 0xFF
                public bool isAscii;  // 
            }

            [Serializable]
            public struct ArrayLen // used to descript the filed containing the daynamic array length information
            {
                public byte paramOffes;  // the offest of the byte containing the length inoformation
                public byte lenMask;     // the mask used to exctract the length information
                public byte lenOffs;     // the offset of the length informastion within a byte.
            }


            [Serializable]
            public struct Variant // the size of the variable is defined in another paramter
            {
                public byte paramOffs;  // the offset of the the parameter that hold the size of the variant
                public byte sizeMask;     // the mask used to extract the size value.
                public byte sizeOffs;     // the offset of the start bit of the size value
                public bool signed;
                public bool showHex;
            }

            [Serializable]
            public struct Variant_Group
            {
                public string variantGroupName;
                public Hashtable grpParams;
                public byte paramKey;
                public byte paramOffs;
                public byte sizeMask;     // the mask used to extract the size value.
                public byte sizeOffs;     // the offset of the start bit of the size value
            }

            /// <summary>
            /// This struct is used to locate a parameter descriptor within a command
            /// </summary>
            [Serializable]
            public struct ParamDescLoc
            {
                public byte param;
                public byte paramStart;
                public byte paramDesc;
            }

            [Serializable]
            public struct BitFlag
            {
                public string flagName;
                public byte flagMask;
            }

            [Serializable]
            public struct BitField
            {
                public string fieldName;
                public byte shifter;
                public byte fieldMask;

            }

            [Serializable]
            public struct FieldEnum
            {
                public string fieldName;
                public byte shifter;
                public byte fieldMask;
                public ArrayList fieldEnum;
            }
            [Serializable]
            public struct MultiArryField
            {
                public string fieldName;
                public byte shifter;
                public byte fieldMask;
                public byte paramOffs;  // the offset of the the parameter that hold the first demension value
                public byte valueMask;     // the mask used to extract the  value.
                public byte valueOffs;     // the offset of the start bit of the value
                public ArrayList fieldEnum;
            }


            [Serializable]
            public struct ParamAttrib
            {
                public int index;
                public object paramAttrib;
            }

            [Serializable]
            public struct CmdParam
            {
                public string paramName;
                public ParamType paramType;
                public Hashtable paramAttribs;
                public string paramRecurType;
            }

            [Serializable]
            public struct ZWaveCmd
            {
                public string cmdName;
                public string CmdHelp;
                public Hashtable cmdParams;
                public Hashtable variantGroups;
                public bool cmdRecursive;
            }
            [Serializable]
            public struct ZWaveClass
            {
                public string cmdClassName;
                public string cmdClassHelp;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -