public static int ConnectControl() { string linkStatus = UsbIPUtil.checkDevStateString(); if (!string.IsNullOrEmpty(linkStatus)) { if (linkStatus.Contains("no available")) { return(-2000); } if (!linkStatus.Contains("disconnected")) { return(0); } string output = UsbIPUtil.getDevStateString(); if (!string.IsNullOrEmpty(output)) { if (output.Contains("disconnected")) { return(-1000); } return(0); } } return(-1000); }
public static bool isCableLinked() { UsbIPUtil.log.Trace("isCableLinked"); string cableState = UsbIPUtil.checkHelmetCableString(); return(!string.IsNullOrEmpty(cableState) && !cableState.Contains("disconnected") && !cableState.Contains("failed")); }
public static int isHostConnected() { if (!ChannelUtil.pingRouterConnect()) { return(-1001); } if (UsbIPUtil.isHostLinked()) { return(0); } return(-1002); }
private void adapterConnectedThreadStart() { while (!UsbIPUtil.isHostLinked()) { Thread.Sleep(5000); } Thread.Sleep(5000); if (this.socketModel != null) { this.socketModel.GetVersion(); } }
public static int ForceConnectControl() { string output = UsbIPUtil.getDevStateString(); if (string.IsNullOrEmpty(output)) { return(-1000); } if (output.Contains("disconnected")) { return(-1000); } return(0); }
public static int isUSBConnected() { int status = UsbIPUtil.isHostConnected(); if (status != 0) { return(status); } if (UsbIPUtil.isCableLinked()) { return(UsbIPUtil.ConnectControl()); } return(-3000); }
public static bool RebootService() { string result = UsbIPUtil.rebootTPCASTService(); if (string.IsNullOrEmpty(result)) { return(false); } if (result.Contains("is enable")) { return(true); } result.Contains("Error"); return(false); }
public static int isUsbLinked() { string output = UsbIPUtil.checkDevStateString(); if (string.IsNullOrEmpty(output)) { return(-1000); } if (output.Contains("disconnected")) { return(-1000); } if (output.Contains("no available")) { return(-2000); } return(0); }
private void checkDriver() { if (UsbIPUtil.isDriverInstalled()) { if (!UsbIPUtil.isServiceOk()) { BroadcastModel.instance.send(92); Util.showGrayBackground(); new ServerExceptionDialog().Show(Util.sContext); return; } } else { BroadcastModel.instance.send(91); Util.showGrayBackground(); new DriverDialog().Show(Util.sContext); } }
public static bool isDevStateConnect() { string output = UsbIPUtil.checkDevStateString(); return(!string.IsNullOrEmpty(output) && !output.Contains("disconnected") && !output.Contains("no available")); }
public static bool isServiceOk() { string serviceState = UsbIPUtil.checkServerString(); return(!string.IsNullOrEmpty(serviceState) && serviceState.Contains("OK")); }
public static bool isDriverInstalled() { string driverState = UsbIPUtil.checkDriverString(); return(!string.IsNullOrEmpty(driverState) && driverState.Contains("OK")); }
public static bool isHostLinked() { string hostState = UsbIPUtil.checkDevHostString(); return(!string.IsNullOrEmpty(hostState) && !hostState.Contains("can not connect") && !hostState.Contains("fail")); }