// Copyright Epic Games, Inc. All Rights Reserved. using System; using System.Collections.Generic; using System.IO; using AutomationTool; using UnrealBuildTool; using System.Threading; using System.Text.RegularExpressions; namespace Gauntlet { /// /// Base class for a device that is able to run applications /// public interface ITargetDevice : IDisposable { /// /// Name of this device /// string Name { get; } /// /// Platform of this device /// UnrealTargetPlatform? Platform { get; } /// /// Options used when running processes /// CommandUtils.ERunOptions RunOptions { get; set; } /// /// Is the device available for use? /// Note: If we are the process holding a connection then this should still return true /// bool IsAvailable { get; } /// /// Are we connected to this device? /// bool IsConnected { get; } /// /// Connect and reserve the device /// /// bool Connect(); /// /// Disconnect the device. /// /// If supported force the device into a disconnected state (e.g. kick other users) /// bool Disconnect(bool bForce=false); /// /// Is the device powered on? /// TODO - Do we need to have a way of expressing whether power changes are supported /// bool IsOn { get; } /// /// Request the device power on. Should block until the change succeeds (or fails) /// /// bool PowerOn(); /// /// Request the device power on. Should block until the change succeeds (or fails) /// /// bool PowerOff(); /// /// Request the device power on. Should block until the change succeeds (or fails) /// /// bool Reboot(); /// /// Returns a Dictionary of EIntendedBaseCopyDirectory keys and their corresponding file path string values. /// If a platform has not set up these mappings, returns an empty Dictionary and warns. /// /// Dictionary GetPlatformDirectoryMappings(); /// /// Checks the device's OS/Firmware version and returns whether an update is necessary /// /// bool IsOSOutOfDate(); /// /// Pushes the latest version of the console's OS/Firmware to the device, returning false if the process fails /// /// bool UpdateOS(); IAppInstall InstallApplication(UnrealAppConfig AppConfiguration); IAppInstance Run(IAppInstall App); }; /// /// Represents a class able to provide devices /// public interface IDeviceSource { bool CanSupportPlatform(UnrealTargetPlatform? Platform); } /// /// Represents a class that provides locally available devices /// public interface IDefaultDeviceSource : IDeviceSource { ITargetDevice[] GetDefaultDevices(); } /// /// Represents a class capable of creating devices of a specific type /// public interface IDeviceFactory : IDeviceSource { ITargetDevice CreateDevice(string InRef, string InLocalCache, string InParam=null); } }