/// <summary> /// Starts the EyeX host and waits for all profiles to become available. /// </summary> /// <param name="host">The host.</param> /// <param name="version">The engine version.</param> private static bool StartHost(EyeXHost host, out Version version) { // Start the host. host.Start(); // Wait for the client to connect. if (!host.WaitUntilConnected(TimeSpan.FromSeconds(5))) { version = null; return(false); } // Get the engine version number. version = host.GetEngineVersion().Result; return(true); }
private static int startHost(EyeXHost host) { switch (EyeXHost.EyeXAvailability) { case EyeXAvailability.NotAvailable: Console.WriteLine("This sample requires the EyeX Engine, but it isn't available."); Console.WriteLine("Please install the EyeX Engine and try again."); return(Globs.TRACKER_ENGINE_NOT_AVAILABLE); case EyeXAvailability.NotRunning: Console.WriteLine("This sample requires the EyeX Engine, but it isn't rnning."); Console.WriteLine("Please make sure that the EyeX Engine is started."); return(Globs.TRACKER_ENGINE_NOT_RUNNING); } Version engineVersion; host.Start(); if (!host.WaitUntilConnected(TimeSpan.FromSeconds(5))) { Console.WriteLine("Could not connect to EyeX Engine."); return(Globs.TRACKER_FAILED_TO_ACTIVATE); } else { engineVersion = host.GetEngineVersion().Result; if (engineVersion.Major != 1 || engineVersion.Major == 1 && engineVersion.Minor < 4) { Console.WriteLine("This sample requires EyeX Engine 1.4."); return(Globs.TRACKER_ENGINE_OUTDATED); } } Console.WriteLine("Tracker Activated Sucessfully"); return(Globs.TRACKER_ACTIVATED); }