wxr
2020-03-19 b69d7735274b8d0f741da8a6bb8b8e1347477a5a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using System;
using System.Collections.Generic;
 
namespace HDL_ON.Entity
{
    public class A_Protocol_FunctionInfo
    {
 
        /*
        HDL统一协议格式:16bytes
        厂商代号:2bytes
        通讯方式:有线/无线/ZIGBEE等1bytes
        产品识别码:以添加设备的年月日时分秒 + 随机数  8bytes  Category
        功能类别:1bytes
        数据表索引地址:2bytes
        回路:2bytes
        举例: 0001-00-2019101209001234-01-0001-0001
        */
 
        public A_Protocol_FunctionInfo()
        {
            dicPropert = new Dictionary<string, string>();
            if (!string.IsNullOrEmpty(trait))
            {
                foreach (string t in trait.Split(",", StringSplitOptions.None))
                {
                    dicPropert.TryAdd(t, "");
                }
            }
        }
        /// <summary>
        /// 功能类别
        /// 如:空调类、灯光类、窗帘类
        /// </summary>
        public FunctionType functionCategory
        {
            get
            {
                var functionType = sid.Substring(22, 2);//截取23,24字符获取控制的设备的类型
                return (FunctionType)Enum.ToObject(typeof(FunctionType), Convert.ToInt32(functionType));
            }
        }
        /// <summary>
        /// 功能ID
        /// </summary>
        public string sid = "00010020200309FF0001000100000000";
        /// <summary>
        /// 备注
        /// </summary>
        public string name;
        /// <summary>
        /// A协议数据格式
        /// </summary>
        public string a_Protocol_Namespace = "HDL";
        /// <summary>
        /// A协议功能的通行
        /// 如:是AC功能:特性包含:Switch/mode/fan/temperature
        /// </summary>
        public string trait="";
 
        //string _trait;
 
        /// <summary>
        /// 功能附带的属性与值的列表
        /// </summary>
        public Dictionary<string, string> dicPropert;
    }
}