public Boolean ConnectTarget() { if (!IsConnected) { try { xboxMgr = new XboxManager(); xbCon = xboxMgr.OpenConsole(DeviceIdent); dbgXbox = xbCon.DebugTarget; connectioncode = xbCon.OpenConnection(null); IsConnected = true; } catch { xbCon = null; xboxMgr = null; dbgXbox = null; return(false); } try { XboxType = xbCon.ConsoleType.ToString(); } catch { XboxType = "Can't get"; } } return(IsConnected); }
/// <summary> /// Connect to default xbox console /// </summary> private void ConnectXBOX() { try { var XboxManager = new XboxManager(); Xbox = XboxManager.OpenConsole(XboxManager.DefaultConsole); Xbox.OpenConnection(null); IsConsoleConnected = true; ConsoleType = "XBOX"; SetStatusConsole(Xbox.Name); EnableConsoleActions(); MenuItemConnectPS3.Enabled = false; MenuItemXBOXConnect.Visible = false; MenuItemXBOXDisconnect.Visible = true; SetStatus("Successfully connected to console."); XtraMessageBox.Show(this, "Connected to console.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { SetStatus("Couldn't connect to console - Error: " + ex.Message, ex); XtraMessageBox.Show(this, "Unable to connect to console.\n\nError Message:/n: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
//[DllImport("XSimWrapperDll.dll", CharSet = CharSet.Ansi)] //public static extern uint XSimInitialize(UInt32 dwComponentFrameRate); public Program() { manager = new XboxManager(); console = manager.OpenConsole(manager.DefaultConsole); automation = console.XboxAutomation; gamepad = new XBOX_AUTOMATION_GAMEPAD(); result = false; enableMU = false; }
public Boolean Connection() { if (!activeConnection) { xboxMgr = new XDevkit.XboxManager(); xbCon = xboxMgr.OpenConsole(xboxMgr.DefaultConsole); try { xbConnection = xbCon.OpenConnection(null); } catch (Exception) { } string text; string text2; if (xbCon.DebugTarget.IsDebuggerConnected(out text, out text2)) { activeConnection = true; } xbCon.DebugTarget.ConnectAsDebugger("XboxLib", XboxDebugConnectFlags.Force); if (!xbCon.DebugTarget.IsDebuggerConnected(out text, out text2)) { } activeConnection = true; } else { string text; string text2; if (xbCon.DebugTarget.IsDebuggerConnected(out text, out text2)) { } activeConnection = false; } return(activeConnection); }