Ejemplo n.º 1
0
        private static void StartBackgroundCheckControlThreadStart()
        {
            int status = 0;

            while (LoopCheckModel.isLinked)
            {
                status = UsbIPUtil.isUsbLinked();
                if (status == 0)
                {
                    LoopCheckModel.isLinked = true;
                }
                else if (status == -1000 || status == -2000)
                {
                    LoopCheckModel.isLinked = false;
                    break;
                }
                Thread.Sleep(5000);
            }
            if (status == -1000)
            {
                if (ChannelUtil.pingRouterConnect())
                {
                    if (UsbIPUtil.isHostLinked())
                    {
                        if (UsbIPUtil.isCableLinked())
                        {
                            status = -1000;
                        }
                        else
                        {
                            status = -3000;
                        }
                    }
                    else
                    {
                        status = -1002;
                    }
                }
                else
                {
                    status = -1001;
                }
            }
            else if (status == -2000)
            {
                UsbIPUtil.RebootService();
                status = -1000;
            }
            AnimationModel.ConnectAnimateionPause();
            LoopCheckModel.ControlInterrupt(status);
        }
Ejemplo n.º 2
0
 private static void ControlInterrupt(int status)
 {
     if (LoopCheckModel.sContext != null && LoopCheckModel.OnControlInterrupt != null)
     {
         if (LoopCheckModel.sContext.InvokeRequired)
         {
             LoopCheckModel.sContext.Invoke(LoopCheckModel.OnControlInterrupt, new object[]
             {
                 status
             });
             return;
         }
         LoopCheckModel.OnControlInterrupt(status);
     }
 }
Ejemplo n.º 3
0
 public static void UnInit()
 {
     LoopCheckModel.sContext = null;
     LoopCheckModel.AbortBackgroundCheckControlThread();
 }