예제 #1
0
 /// <summary>
 /// 查询终端信息
 /// </summary>
 public bool GetParameters()
 {
     if (updateInfo._cmdExecTime.ContainsKey(CmdId.ReadPara))
     {
         if ((DateTime.Now - updateInfo._cmdExecTime[CmdId.ReadPara]).TotalSeconds < 5)
         {
             return(false);
         }
     }
     try
     {
         if (socket != null)
         {
             socket.Send(CmdInfo.GetCmdBytes(CmdId.ReadPara));
             if (updateInfo != null)
             {
                 updateInfo.lastCmd = CmdId.ReadPara;
             }
             return(true);
         }
     }
     catch
     {
     }
     return(false);
 }
예제 #2
0
 /// <summary>
 /// 退出设置模式
 /// </summary>
 public void ExitSetMode()
 {
     try
     {
         socket?.Send(CmdInfo.GetCmdBytes(CmdId.State0));
     }
     catch
     {
     }
 }
예제 #3
0
 /// <summary>
 /// 进入设置模式
 /// </summary>
 public void EnterSetMode()
 {
     try
     {
         if (socket != null)
         {
             socket.Send(CmdInfo.GetCmdBytes(CmdId.State2));
         }
     }
     catch
     {
     }
 }
예제 #4
0
 /// <summary>
 /// 停止调试
 /// </summary>
 public void StopDebug()
 {
     try
     {
         if (socket != null)
         {
             socket.Send(CmdInfo.GetCmdBytes(CmdId.StopDebug));
             if (updateInfo != null)
             {
                 updateInfo.lastCmd = CmdId.StopDebug;
             }
         }
     }
     catch
     {
     }
 }
예제 #5
0
 /// <summary>
 /// 查询动态参数
 /// </summary>
 public void GetDynamicParameters()
 {
     try
     {
         if (socket != null)
         {
             socket.Send(CmdInfo.GetCmdBytes(CmdId.ReadDynamicPara));
             if (updateInfo != null)
             {
                 updateInfo.lastCmd = CmdId.ReadDynamicPara;
             }
         }
     }
     catch
     {
     }
 }
예제 #6
0
 /// <summary>
 /// 重启设备
 /// </summary>
 public void RebootDevice()
 {
     try
     {
         if (socket != null)
         {
             socket.Send(CmdInfo.GetCmdBytes(CmdId.State2));
             socket.Send(CmdInfo.GetCmdBytes(CmdId.Reboot));
             if (updateInfo != null)
             {
                 updateInfo.lastCmd = CmdId.Reboot;
             }
         }
     }
     catch
     {
     }
 }