| | |
| | | case FunctionAttributeKey.FanSpeed: |
| | | tempAc.trait_fan.curValue = attr.value; |
| | | break; |
| | | case FunctionAttributeKey.Temp: |
| | | case FunctionAttributeKey.SetTemp: |
| | | tempAc.trait_temp.curValue = attr.value; |
| | | switch (tempAc.curModeIndex) |
| | | { |
| | |
| | | case FunctionAttributeKey.OnOff: |
| | | tempFh.trait_on_off.curValue = attr.value; |
| | | break; |
| | | case FunctionAttributeKey.Temp: |
| | | case FunctionAttributeKey.SetTemp: |
| | | tempFh.trait_temp.curValue = attr.value; |
| | | break; |
| | | case FunctionAttributeKey.Mode: |
| | |
| | | var bytes = new byte[] { function.bus_Data.loopId, |
| | | b, |
| | | 254, 0,Convert.ToByte(light.fadeTime) ,3, |
| | | (byte)light.redColor,(byte)light.greenColor, |
| | | (byte)light.blueColor, |
| | | (byte)light.RedColor,(byte)light.GreenColor, |
| | | (byte)light.BlueColor, |
| | | 0,0}; |
| | | ControlBytesSend(Command.SetLogicLoopColor, subnetId, deviceId, bytes, 1); |
| | | break; |
| | |
| | | |
| | | } |
| | | |
| | | //private void signAlinkPacket() |
| | | //{ |
| | | //} |
| | | |
| | | /// <summary> |
| | | /// 发送数据 |
| | | /// </summary> |
| | |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 本地udp控制A协议网关 |
| | | /// 发送udp A协议数据 |
| | | /// </summary> |
| | | public void SendLocalHdlLinkData(byte[] sendBytes) |
| | | { |
| | | if (controlLostCount > 3) |
| | | { |
| | | UdpSocket._BusSocket.Stop(); |
| | | UdpSocket._BusSocket.Start(8585); |
| | | controlLostCount = 0; |
| | | } |
| | | Packet = new Packet(sendBytes, new System.Net.IPEndPoint(System.Net.IPAddress.Parse(Control.Ins.reportIp), 8585)); |
| | | Packet.HaveSendCount = 4;//ps:没有重发,后期有时间可以增加重发判断 |
| | | Packet.HaveSendCount = 2;//ps:没有重发,后期有时间可以增加重发判断 |
| | | |
| | | System.Threading.Thread thread = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(managerSendCount)); |
| | | thread.IsBackground = true; |
| | | thread.Start(Packet); |
| | | //wait();不需要等待 |
| | | MainPage.Log($"发送Hdl-Link数据,IP:{Control.Ins.reportIp}:8585"); |
| | | controlLostCount++; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |