wei
2020-12-16 dcf60777c9346ff058f06298d03173f0c53d1902
HDL_ON/DAL/DriverLayer/Control_Udp.cs
@@ -196,7 +196,7 @@
                                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)
                                    {
@@ -261,7 +261,7 @@
                                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:
@@ -331,8 +331,8 @@
                                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;
@@ -787,6 +787,10 @@
        }
        //private void signAlinkPacket()
        //{
        //}
        /// <summary>
        /// 发送数据
        /// </summary>
@@ -841,19 +845,23 @@
            }
        }
        /// <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++;
        }
    }
}