Пример #1
0
        public static bool RemoveForwardTcpPort(SDBDeviceInfo device, int localPort, out string errorMessage)
        {
            string lastLine;
            bool   success = SDBLib.RunSdbCommandAndGetLastNonEmptyLine(device,
                                                                        $"forward --remove tcp:{localPort}", out lastLine, out errorMessage);

            if (success && lastLine.StartsWith("error:"))
            {
                errorMessage = lastLine;
                success      = false;
            }
            return(success);
        }
Пример #2
0
        public static bool ForwardTcpPort(SDBDeviceInfo device, int localPort, int remotePort, out string errorMessage)
        {
            // TODO!! do need to remove port forwarding first?
            RemoveForwardTcpPort(device, localPort, out errorMessage); // remove forward error is a valid case

            string lastLine;
            bool   success = SDBLib.RunSdbCommandAndGetLastNonEmptyLine(device,
                                                                        $"forward tcp:{localPort} tcp:{remotePort}", out lastLine, out errorMessage);

            if (success && lastLine.StartsWith("error:"))
            {
                errorMessage = lastLine;
                success      = false;
            }
            return(success);
        }
Пример #3
0
 private bool RunDaemon()
 {
     return(SDBLib.RunSdbCommand(null, "start-server",
                                 (isStdOut, line) => line.Trim().Equals("* server started successfully *"),
                                 TimeOutStart) == SDBLib.SdbRunResult.Success);
 }
Пример #4
0
        private DeviceMonitorResult HandleDeviceMonitorResult(Task <DeviceMonitorResult> devMonitorResult)
        {
            DeviceMonitorResult ret = devMonitorResult.Result;

            if (ret != DeviceMonitorResult.CanceledByUser)
            {
                DeviceManager.SelectDevice(null);
                DeviceManager.DeviceInfoList?.Clear();
                DeviceManager.UpdateDebugTargetList(true);

                string msg = string.Format("SDB Server disconnected.\n({0})\n\nClick 'Retry' or 'Tools -> Tizen -> Restart Sdb Server' to establish the connection.", SDBLib.GetSdbFilePath());

                if (MessageBox.Show(msg, "Visual Studio Tools for Tizen", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error) == DialogResult.Retry)
                {
                    StartService();
                }
            }

            return(ret);
        }