Exemple #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);
 }
Exemple #2
0
 /// <summary>
 /// 退出设置模式
 /// </summary>
 public void ExitSetMode()
 {
     try
     {
         socket?.Send(CmdInfo.GetCmdBytes(CmdId.State0));
     }
     catch
     {
     }
 }
Exemple #3
0
 /// <summary>
 /// 进入设置模式
 /// </summary>
 public void EnterSetMode()
 {
     try
     {
         if (socket != null)
         {
             socket.Send(CmdInfo.GetCmdBytes(CmdId.State2));
         }
     }
     catch
     {
     }
 }
Exemple #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
     {
     }
 }
Exemple #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
     {
     }
 }
Exemple #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
     {
     }
 }