| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using Newtonsoft.Json.Linq; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.Entity |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | Trait _trait_swting; |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public Trait trait_swting |
| | |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 拼接、获取A协议操作数据 |
| | | /// </summary> |
| | | public override JObject GetSendJObject(CommandType_A command) |
| | | { |
| | | var sendJob = new JObject(); |
| | | if (command == CommandType_A.write) |
| | | { |
| | | sendJob = new JObject { { "Namespace", vendor_code }, { "Command", command.ToString() }, { "Type", "device" } }; |
| | | JObject data = new JObject { { "sid", sid } }; |
| | | sendJob.Add("objects", data); |
| | | List<ControlData> controlData = new List<ControlData>(); |
| | | controlData.Add(new ControlData() |
| | | { |
| | | name = "on_off", |
| | | data_type = "Bool", |
| | | value = trait_on_off.value.ToString() |
| | | }); |
| | | |
| | | |
| | | } |
| | | else if (command == CommandType_A.read) |
| | | { |
| | | sendJob = new JObject { { "Namespace", vendor_code }, { "Command", command.ToString() }, { "Type", "device" } }; |
| | | var data = new JObject { { "sid", sid } }; |
| | | sendJob.Add("objects", data); |
| | | } |
| | | return sendJob; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | } |