Exemplo n.º 1
0
        //make it -1 or 0
        private static void MakeConnectionusingThread(string TargetAddress, TextBox ip_address, TextBox platform_username)
        {
            try
            {
                using (XosaClient xox = new XosaClient(TargetAddress))
                {
                    string pathToDriver = ip_address.Text;


                    string DriverPathParent = GetParent(pathToDriver);
                    if (DriverPathParent == "")
                    {//Path is wrong privide
                        MessageBox.Show("Path is wrong, please provide a suitable driver");
                    }
                    else
                    {
                        string[] words = DriverPathParent.Split('\\');
                        string   myPathtoExecute;
                        if (words.Length > 4)
                        {
                            myPathtoExecute = @"C:\Users\" + platform_username.Text + @"\Desktop\" + words[words.Length - 4];
                        }
                        else
                        {
                            myPathtoExecute = @"C:\Users\" + platform_username.Text + @"\Desktop\" + words[0];
                        }

                        xox.File.CreateDirectory(myPathtoExecute);
                        xox.File.Upload(DriverPathParent, myPathtoExecute);

                        //install driver after copying
                        //INSTALLING...

                        new DownloaderThread("", platform_username);
                        //xox.RunCommand(myPathtoExecute+@"\SetupME.exe");
                        //Cli DowProc = xox.RunCommand(myPathtoExecute + @"\SetupME.exe" , new[] { "/s", "/v" ,"/qn" ,"/min" }, myPathtoExecute);
                        //xox.RunCommand("CMD.exe", new[] { myPathtoExecute + @"\SetupME.exe", "/s", "/v", "/qn", "/min" })
                        //Cli DowProc = xox.RunCommand( "CMD.exe", new[] { myPathtoExecute + @"\SetupME.exe", "/s", "/v", "/qn", "/min" }, myPathtoExecute);


                        MessageBox.Show("Driver Installed");
                    }
                }
            }
            catch (Exception)
            {
                MessageBox.Show("MakeConnectionusingThread:\nCant Connect to remote DUT\n make sure XOSA is installed\n make sure IP is configured");
                return;
            }
        }
Exemplo n.º 2
0
        private void setSettingsNowThread()
        {
            try
            {
                using (XosaClient xox = new XosaClient(this.Target_ip))
                {
                    var command = new XosaClient.RunCommandParameters();
                    Cli command_proc;

                    command.Command = "powercfg";
                    command.IsGui   = false;

                    command.Args  = new[] { "/DEVICEDISABLEWAKE", "HID-compliant mouse" };
                    command.IsGui = false;

                    command_proc = xox.RunCommand(command);
                    command_proc.WaitForExit(10);
                    string tmp = "";
                    command_proc.ReadStdOut(out tmp);

                    //8***** Next device

                    command.Args = new[] { "/DEVICEDISABLEWAKE", "Intel(R) Dual Band Wireless-AC 8265" };
                    command_proc = xox.RunCommand(command);
                    command_proc.WaitForExit(10);

                    command_proc.ReadStdOut(out tmp);

                    ////****** Next device Intel(R) Ethernet Connection (2) 1219-LM
                    command.Args = new[] { "/DEVICEDISABLEWAKE", "Intel(R) Ethernet Connection (2) I219-LM" };
                    command_proc = xox.RunCommand(command);
                    command_proc.WaitForExit(10);
                }
            }
            catch (Exception)
            {
                MessageBox.Show("DUT Configs: cant make connection, Check DUT has IP and in S0 State and has Xosa installed");
                return;
            }
        }