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); }
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(); }
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(); }
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(); }