| | |
| | | { |
| | | function.usageCount++; |
| | | function.refreshTime = DateTime.Now; |
| | | DAL.Server.HttpServerRequest httpServer = new DAL.Server.HttpServerRequest(); |
| | | //远程通讯 |
| | | if (Ins.IsRemote) |
| | | { |
| | | //ALink控制 |
| | | if (DB_ResidenceData.residenceData.GatewayType == 0) |
| | | { |
| | | |
| | | } |
| | | //Bus控制 |
| | | else |
| | | { |
| | | |
| | | } |
| | | //ALink控制、Bus控制使用同一个接口控制,由云端负责解析 |
| | | var apiControlData = function.GetApiControlData(commandDictionary); |
| | | var actionObjs = new List<ApiAlinkControlActionObj>(); |
| | | actionObjs.Add(apiControlData); |
| | | httpServer.ControlDevice(actionObjs); |
| | | } |
| | | //本地通讯 |
| | | else |
| | |
| | | { |
| | | if (myUdp != null) |
| | | { |
| | | var functionControlDataObj = function.GetControlSendData(commandDictionary); |
| | | var functionControlDataObj = function.GetGatewayAlinkControlData(commandDictionary); |
| | | var functionControlDataJson = Newtonsoft.Json.JsonConvert.SerializeObject(functionControlDataObj); |
| | | var sendBytes = Ins.ConvertSendBodyData(CommunicationTopic.ct.ControlFunctionTopic, functionControlDataJson); |
| | | myUdp.SendLocalHdlLinkData(sendBytes); |