wei
2020-12-16 dcf60777c9346ff058f06298d03173f0c53d1902
HDL_ON/DAL/DriverLayer/Control_Udp.cs
@@ -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;
@@ -714,7 +714,7 @@
            try
            {
                //MainPage.Log("发送数据:" + SendFlag);
                MainPage.Log("发送数据:" + SendFlag);
                UdpSocket._BusSocket.AsyncBeginSend(Packet);
                Packet.HaveSendCount--;
@@ -787,6 +787,10 @@
        }
        //private void signAlinkPacket()
        //{
        //}
        /// <summary>
        /// 发送数据
        /// </summary>
@@ -845,15 +849,19 @@
        /// </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++;
        }
    }
}