Пример #1
0
 public UAVOSOptionsFrm(GroundControlCore.GroundControlCore core)
 {
     InitializeComponent();
     RemoteDevice device = new RemoteDevice(ConfigurationSettings.AppSettings["Remoteip"],ConfigurationSettings.AppSettings["RemoteUsername"],ConfigurationSettings.AppSettings["RemotePassword"]);
     this.device = device;
     this.core = core;
     UpdateSettingsList(core);
 }
Пример #2
0
        public void Start(RemoteDevice target)
        {
            //hacky but openssh seems to ignore signals
            Action start = delegate
            {
                var startexec = new SshExec(target.target.ToString(), target.username, target.password);
                startexec.Connect();
                var result = startexec.RunCommand("mono /root/FlightControl/FlightControl.exe");

                startexec.Close();
            };
            start.Invoke();
        }
Пример #3
0
 public void Kill(RemoteDevice target)
 {
     //hacky but openssh seems to ignore signals
     Action kill = delegate
     {
         var killExec = new SshExec(target.target.ToString(), target.username, target.password);
         killExec.Connect();
         var killcmd = @"killall mono";
         var result = killExec.RunCommand(killcmd);
         result = killExec.RunCommand("killall FCRestarter");
         killExec.Close();
     };
     kill.Invoke();
 }
Пример #4
0
        public static void Upload(RemoteDevice target, string sourcefile, string targetfile, bool overwrite)
        {
            var sftp = new Sftp(target.target.ToString(), target.username, target.password);

               sftp.Connect();
            if (!sftp.Connected)
            {
                //MonoDevelop.Ide.Gui.Dialogs.MultiMessageDialog dlg = new MultiMessageDialog();
                //dlg.AddMessage("Can not connect to Remote Host for File Transfer", "");
                //dlg.ShowAll();
                //return null;
            }

            sftp.Close();
        }