| | |
| | | /// 更新时间 |
| | | /// </summary> |
| | | public DateTime refreshTime = DateTime.MinValue; |
| | | |
| | | /// <summary> |
| | | /// 获取控制发送数据 |
| | | /// </summary> |
| | | public AprotocolControlObj GetControlSendData(Dictionary<string, string> commandDictionary) |
| | | { |
| | | var sendDataObj = new AprotocolControlObj(); |
| | | sendDataObj.from_oid = ""; |
| | | sendDataObj.to_oid = ""; |
| | | sendDataObj.time_stamp = ""; |
| | | sendDataObj.type = "device_sid"; |
| | | sendDataObj.command = "write"; |
| | | |
| | | var acoList = new AprotocolControlData(); |
| | | acoList.sid = sid; |
| | | var aco = new AprotocolControlAttribute(); |
| | | foreach(var dic in commandDictionary) |
| | | { |
| | | aco.name = dic.Key; |
| | | aco.value = dic.Value; |
| | | acoList.function.Add(aco); |
| | | } |
| | | |
| | | sendDataObj.objects.Add(acoList); |
| | | |
| | | |
| | | return sendDataObj; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// A协议控制数据的对象 |
| | | /// </summary> |
| | | public class AprotocolControlObj |
| | | { |
| | | public List<AprotocolControlData> objects = new List<AprotocolControlData>(); |
| | | |
| | | public string from_oid = ""; |
| | | public string to_oid = ""; |
| | | public string time_stamp = ""; |
| | | public string type = ""; |
| | | public string command = ""; |
| | | } |
| | | /// <summary> |
| | | /// A协议控制数据 |
| | | /// </summary> |
| | | public class AprotocolControlData |
| | | { |
| | | |
| | | public string sid = ""; |
| | | public List<AprotocolControlAttribute> function = new List<AprotocolControlAttribute>(); |
| | | } |
| | | /// <summary> |
| | | /// A协议控制属性对象 |
| | | /// </summary> |
| | | public class AprotocolControlAttribute |
| | | { |
| | | public string name; |
| | | public string value; |
| | | } |
| | | |
| | | /// <summary> |