/// <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); }
/// <summary> /// 退出设置模式 /// </summary> public void ExitSetMode() { try { socket?.Send(CmdInfo.GetCmdBytes(CmdId.State0)); } catch { } }
/// <summary> /// 进入设置模式 /// </summary> public void EnterSetMode() { try { if (socket != null) { socket.Send(CmdInfo.GetCmdBytes(CmdId.State2)); } } catch { } }
/// <summary> /// 停止调试 /// </summary> public void StopDebug() { try { if (socket != null) { socket.Send(CmdInfo.GetCmdBytes(CmdId.StopDebug)); if (updateInfo != null) { updateInfo.lastCmd = CmdId.StopDebug; } } } catch { } }
/// <summary> /// 查询动态参数 /// </summary> public void GetDynamicParameters() { try { if (socket != null) { socket.Send(CmdInfo.GetCmdBytes(CmdId.ReadDynamicPara)); if (updateInfo != null) { updateInfo.lastCmd = CmdId.ReadDynamicPara; } } } catch { } }
/// <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 { } }