| | |
| | | } |
| | | } |
| | | |
| | | MainPage.Log($"发送数据:{Newtonsoft.Json.JsonConvert.SerializeObject(commandDictionary)}"); |
| | | //MainPage.Log($"发送数据:{Newtonsoft.Json.JsonConvert.SerializeObject(commandDictionary)}"); |
| | | |
| | | ///第三方涂鸦设备统一使用远程控制 |
| | | switch(function.spk) |
| | |
| | | |
| | | string sendDataString = topicString + lengthString + bodyDataString; |
| | | byte[] sendDataBytes = Encoding.ASCII.GetBytes(sendDataString); |
| | | //MainPage.Log($"转换HDL-Link数据\r\n{sendDataString}\r\n"); |
| | | MainPage.Log($"转换HDL-Link数据\r\n{sendDataString}\r\n"); |
| | | |
| | | return sendDataBytes; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | MainPage.Log($"局域网信息: {receiveObj.Topic}"); |
| | | MainPage.Log($"内容: {res[1]}"); |
| | | MainPage.Log($"局域网信息: {receiveObj.Topic} : 内容: {res[1]}"); |
| | | |
| | | |
| | | //验证有效数据长度 |
| | |
| | | } |
| | | |
| | | var device = Newtonsoft.Json.JsonConvert.DeserializeObject<DeviceModule>(bodyJObj.objects.ToString()); |
| | | if (device.device_mac == DB_ResidenceData.Instance.residenceGatewayMAC) |
| | | if (device.device_mac.ToUpper() == DB_ResidenceData.Instance.HomeGateway.mac.ToUpper()) |
| | | { |
| | | MainPage.Log("本地搜索网关成功"); |
| | | Ins.IsSearchLocalGatewaySuccessful = true; |
| | |
| | | { |
| | | Ins.GatewayId = device.device_mac; |
| | | } |
| | | reportIp = "239.0.168.188";// device.ip_address; |
| | | reportIp = "239.0.168.188";// device.ip_address;//主播地址也能控制设备 |
| | | } |
| | | } |
| | | else if (receiveObj.Topic == CommunicationTopic.ct.ReadStatus + "_reply" || |
| | |
| | | Function localObj = null; |
| | | switch (localFunction.spk) |
| | | { |
| | | case SPK.ElectricEnergy: |
| | | EnergyMainPage.UpdataStatus(localFunction); |
| | | break; |
| | | case SPK.LightSwitch: |
| | | RelayPage.UpdataState(localFunction); |
| | | break; |
| | |
| | | case SPK.SensorTVOC: |
| | | case SPK.SensorTemperature: |
| | | case SPK.SensorHumidity: |
| | | EnvironmentalSciencePage.LoadEvent_UpdataStatus(localFunction); |
| | | if(localFunction.spk == SPK.SensorTemperature) |
| | | { |
| | | HomePage.LoadEvent_RefreshEnvirIndoorTemp(); |
| | | } |
| | | else if (localFunction.spk == SPK.SensorHumidity) |
| | | { |
| | | HomePage.LoadEvent_RefreshEnvirIndoorHumi(); |
| | | } |
| | | EnvironmentalPage.LoadEvent_UpdataStatus(localFunction); |
| | | break; |
| | | case SPK.ElectricSocket: |
| | | SocketPage.UpdataState(localFunction); |