public MobileDeviceInstance StartTCPTunnel(string inDeviceID, ref IntPtr TCPService, short Port = 8888)
        {
            MobileDeviceInstance targetDevice = null;

            PerformActionOnAllDevices(2 * StandardEnumerationDelayMS, delegate(MobileDeviceInstance Device)
            {
                if (inDeviceID == Device.DeviceId)
                {
                    targetDevice = Device;
                }
                return(true);
            });
            if (targetDevice != null)
            {
                if (targetDevice.StartTCPRelayService(ref TCPService))
                {
                    return(targetDevice);
                }
                ReportIF.Error("Could not start TCP relay to " + inDeviceID);
            }
            else
            {
                ReportIF.Error("Could not find device " + inDeviceID);
            }
            return(null);
        }
        public void TunnelToDevice(string inDeviceID, String Command)
        {
            MobileDeviceInstance TargetDevice = null;

            PerformActionOnAllDevices(2 * StandardEnumerationDelayMS, delegate(MobileDeviceInstance Device)
            {
                if (inDeviceID == Device.DeviceId)
                {
                    TargetDevice = Device;
                }
                return(true);
            });
            IntPtr TCPService = new IntPtr();

            if (TargetDevice != null)
            {
                TargetDevice.StartTCPRelayService(ref TCPService);

                int SentDat = TargetDevice.TunnelData(Command, TCPService);

                TargetDevice.StopSyslogService();
            }
            else
            {
                ReportIF.Error("Could not find device " + inDeviceID);
            }
        }