Class WindowsPC
The WindowsPC implementation for the deployment of packages
Implements
Inherited Members
Namespace: Phoenix.Devices
Assembly: Phoenix.Devices.WindowsPC.dll
Syntax
public sealed class WindowsPC : DeviceBase, IServiceProvider, IDevice, ICapability, IDeviceDxdiag, IDeviceInput, IDisposable, IDeviceStatus
Constructors
View SourceWindowsPC(IPAddress, String, String, IPhoenixLogger, DevicePortalConnectionInfo, String, IEventAggregator, Guid)
Initializes a new instance of the WindowsPC class.
Declaration
public WindowsPC(IPAddress deviceIP, string name, string alias, IPhoenixLogger logger, DevicePortalConnectionInfo connectionInfo, string deviceId, IEventAggregator events, Guid phoenixId)
Parameters
Type | Name | Description |
---|---|---|
System.Net.IPAddress | deviceIP | The IP address of the device. |
System.String | name | The name of the device. |
System.String | alias | The alias of the device if known. |
IPhoenixLogger | logger | The current logger. |
DevicePortalConnectionInfo | connectionInfo | Contains the device portal auth settings. |
System.String | deviceId | The expected device id that will be matched to the id the device provides. |
IEventAggregator | events | The event aggregator service. |
System.Guid | phoenixId | The id for the device. |
Fields
View SourceSystemPackageRegex
Gets the regex used to determine if a package is a system package.
Declaration
public static readonly Regex SystemPackageRegex
Field Value
Type | Description |
---|---|
System.Text.RegularExpressions.Regex |
Properties
View SourceConnectionInfo
Gets or sets the device connection info.
Declaration
public DevicePortalConnectionInfo ConnectionInfo { get; set; }
Property Value
Type | Description |
---|---|
DevicePortalConnectionInfo |
IsDevicePortalConnected
Gets a value indicating whether or not there is a device portal connection.
Declaration
public bool IsDevicePortalConnected { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
LocalMachine
Gets a value indicating whether or not the WindowsPC is the local machine.
Declaration
public bool LocalMachine { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
MaxNumConnectedGamepads
Gets the maximum number of connected gamepads that the device supports at once.
Declaration
public int MaxNumConnectedGamepads { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
StatusCheckInterval
Gets the duration to wait before refreshing device status.
Declaration
public TimeSpan StatusCheckInterval { get; }
Property Value
Type | Description |
---|---|
System.TimeSpan |
SupportedInteractions
Gets the supported interactions for the device. Interactions will throw a DeviceNotSupportedException if an attempt to use an unsupported interaction takes place.
Declaration
public PackageInteractions SupportedInteractions { get; }
Property Value
Type | Description |
---|---|
PackageInteractions |
XboxLiveDeviceId
Gets a value representing the XBL device Id.
Declaration
public override string XboxLiveDeviceId { get; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
Methods
View SourceAddCapturePrerequisites()
Enables skipping the Microsoft root certificate check in UTC. Required to use Fiddler cert for monitoring UTC HTTP requests.
Declaration
public async Task AddCapturePrerequisites()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Returns a task representing the work to enable root certificate checks for UTC. |
CaptureDxdiag(String, Boolean)
Captures dxdiag info.
Declaration
public int CaptureDxdiag(string targetPath, bool useCache)
Parameters
Type | Name | Description |
---|---|---|
System.String | targetPath | The location to save the dxdiag file at. |
System.Boolean | useCache | Indicates whether or not to use a cached dxdiag, if one exists. |
Returns
Type | Description |
---|---|
System.Int32 | The exit code of the dxdiag process |
CheckCsiUploaderConfig(String)
Checks if the correct CSI uploader configuration is on the pc.
Declaration
[DeviceConfigCheckMethod("CSI Uploader Config", "Windows PC")]
public DeviceConfigResult CheckCsiUploaderConfig(string expected)
Parameters
Type | Name | Description |
---|---|---|
System.String | expected | The path to the expected configuration file. |
Returns
Type | Description |
---|---|
DeviceConfigResult | The kit config result object. |
CheckDeveloperMode(String)
Checks the developer mode status and checks if it matches the expected value.
Declaration
[DeviceConfigCheckMethod("Developer Mode", "Windows PC")]
public DeviceConfigResult CheckDeveloperMode(string expectedValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | expectedValue | The expected developer mode state (must be true or false) |
Returns
Type | Description |
---|---|
DeviceConfigResult | The result of the check |
Remarks
The expectedValue parameter must stay as a string for reflection dependencies for now, which is why "True" or "False" need to be passed in. Any other values will be treated as not matching.
CheckSandboxId(String)
Checks the sandbox ID and checks if it matches the expected value.
Declaration
[DeviceConfigCheckMethod("Sandbox ID", "Windows PC")]
public DeviceConfigResult CheckSandboxId(string expectedValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | expectedValue | The sandbox ID to check against |
Returns
Type | Description |
---|---|
DeviceConfigResult | The result of the check |
Cleanup()
Declaration
public override void Cleanup()
Overrides
View SourceConstrain(IPackage)
Declaration
public Task Constrain(IPackage package)
Parameters
Type | Name | Description |
---|---|---|
IPackage | package |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
CreateGamepad()
Creates a virtual gamepad for the device.
Declaration
public Guid CreateGamepad()
Returns
Type | Description |
---|---|
System.Guid | The id for the gamepad. |
DisconnectAllGamepads()
Disconnects all virtual gamepads from the device.
Declaration
public Task DisconnectAllGamepads()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | awaitable task |
DisconnectGamepad(Guid)
Disconnects the specified gamepad from the device.
Declaration
public void DisconnectGamepad(Guid gamepadId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | gamepadId | The gamepad to disconnect. |
Dispose()
Disposes of the server resources.
Declaration
public void Dispose()
FixCsiUploaderConfig(String)
Puts the correct CSI uploader configuration on the pc.
Declaration
[DeviceConfigFixMethod("CSI Uploader Config", "Windows PC")]
public DeviceConfigResult FixCsiUploaderConfig(string expected)
Parameters
Type | Name | Description |
---|---|---|
System.String | expected | The path to the expected configuration file. |
Returns
Type | Description |
---|---|
DeviceConfigResult | The kit config result object. |
FixDeveloperMode(String)
Fixes the developer mode status to the provided value
Declaration
[DeviceConfigFixMethod("Developer Mode", "Windows PC")]
public DeviceConfigResult FixDeveloperMode(string expectedValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | expectedValue | The desired developer mode state (must be true or false, or it will not perform the fix) |
Returns
Type | Description |
---|---|
DeviceConfigResult | The result of the check |
Remarks
The expectedValue parameter must stay as a string for reflection dependencies for now, which is why "True" or "False" need to be passed in. Any other values will be treated as not matching.
FixSandboxId(String)
Sets the sandbox ID to a specified value
Declaration
[DeviceConfigFixMethod("Sandbox ID", "Windows PC")]
public DeviceConfigResult FixSandboxId(string expectedValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | expectedValue | The sandbox ID to set |
Returns
Type | Description |
---|---|
DeviceConfigResult | The result of the fix |
GetAllPackages()
Declaration
public Task<IList<IPackage>> GetAllPackages()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IList<IPackage>> |
GetButtonsState(Guid)
Gets the button state for the specified gamepad.
Declaration
public GamepadButtons? GetButtonsState(Guid gamepadId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | gamepadId | The gamepad to query buttons from. |
Returns
Type | Description |
---|---|
System.Nullable<GamepadButtons> | The button states (null if the gamepad cannot be found) |
GetIsRunningAsync(IPackage)
Declaration
public Task<bool> GetIsRunningAsync(IPackage package)
Parameters
Type | Name | Description |
---|---|---|
IPackage | package |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> |
GetJoystickPosition(Guid, JoystickType)
Gets the joystick position for the specified gamepad.
Declaration
public JoystickPosition GetJoystickPosition(Guid gamepadId, JoystickType joystick)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | gamepadId | The gamepad to get the joystick position from. |
JoystickType | joystick | The joystick type to query. |
Returns
Type | Description |
---|---|
JoystickPosition | The joystick position for the specified gamepad and joystick type. (null if not found) |
GetPackages(PackageFilter)
Declaration
public async Task<IList<IPackage>> GetPackages(PackageFilter filter)
Parameters
Type | Name | Description |
---|---|---|
PackageFilter | filter |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IList<IPackage>> |
GetRunningPackages()
Declaration
public Task<IList<IPackage>> GetRunningPackages()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IList<IPackage>> |
GetService(Type)
Declaration
public override object GetService(Type serviceType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | serviceType |
Returns
Type | Description |
---|---|
System.Object |
Overrides
View SourceGetTriggerPosition(Guid, TriggerType)
Gets the trigger position for the specified gamepad.
Declaration
public float? GetTriggerPosition(Guid gamepadId, TriggerType trigger)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | gamepadId | The gamepad to get the trigger position from. |
TriggerType | trigger | The trigger type to query. |
Returns
Type | Description |
---|---|
System.Nullable<System.Single> | The trigger position for the specified gamepad and trigger type (null if gamepad not found) |
HoldButtons(Guid, GamepadButtons)
Holds the specified buttons.
Declaration
public void HoldButtons(Guid gamepadId, GamepadButtons buttons)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | gamepadId | The gamepad to send the button hold to. |
GamepadButtons | buttons | The buttons to hold. |
InstallPackageAsync(String)
Installs an application package on the device.
Declaration
public async Task<bool> InstallPackageAsync(string packageFile)
Parameters
Type | Name | Description |
---|---|---|
System.String | packageFile | The package to install on the device. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> | True upon success |
IsSystem(WinPackageInfo)
Gets whether or not the package is a system package.
Declaration
public static bool IsSystem(WinPackageInfo package)
Parameters
Type | Name | Description |
---|---|---|
WinPackageInfo | package | The windows pc package to check. |
Returns
Type | Description |
---|---|
System.Boolean | Whether or not the passed in package is a system package. |
Launch(IApplication)
Declaration
public Task Launch(IApplication application)
Parameters
Type | Name | Description |
---|---|---|
IApplication | application |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Launch(IApplication, String)
Declaration
public Task Launch(IApplication application, string commandLine)
Parameters
Type | Name | Description |
---|---|---|
IApplication | application | |
System.String | commandLine |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Launch(String)
Declaration
public Task Launch(string aumid)
Parameters
Type | Name | Description |
---|---|---|
System.String | aumid |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Launch(String, String)
Declaration
public Task Launch(string aumid, string commandLine)
Parameters
Type | Name | Description |
---|---|---|
System.String | aumid | |
System.String | commandLine |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
OnDeviceAliasChanged(String, String)
Declaration
protected override void OnDeviceAliasChanged(string oldValue, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | oldValue | |
System.String | value |
Overrides
View SourceReleaseButtons(Guid, GamepadButtons)
Releases the specified buttons.
Declaration
public void ReleaseButtons(Guid gamepadId, GamepadButtons buttons)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | gamepadId | The gamepad to send the button release to. |
GamepadButtons | buttons | The buttons to release. |
RemoveCapturePrerequisites()
Disables skipping the Microsoft root certificate check in UTC.
Declaration
public async Task RemoveCapturePrerequisites()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Returns a task representing the work to disable root certificate checks for UTC. |
Resume(IPackage)
Declaration
public Task Resume(IPackage package)
Parameters
Type | Name | Description |
---|---|---|
IPackage | package |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Serialize()
Serializes device information.
Declaration
public override SerializableIDevice Serialize()
Returns
Type | Description |
---|---|
SerializableIDevice | The SerializableIDevice. |
Overrides
View SourceSetJoystickPosition(Guid, JoystickType, JoystickPosition)
Sets the joystick position for the specified gamepad.
Declaration
public void SetJoystickPosition(Guid gamepadId, JoystickType joystick, JoystickPosition position)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | gamepadId | The gamepad to set the joystick position for. |
JoystickType | joystick | The joystick type. |
JoystickPosition | position | The joystick position. |
SetTriggerPosition(Guid, TriggerType, Single)
Sets the trigger position for the specified gamepad.
Declaration
public void SetTriggerPosition(Guid gamepadId, TriggerType trigger, float position)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | gamepadId | The gamepad to set the trigger position for. |
TriggerType | trigger | The trigger type. |
System.Single | position | The trigger position. |
Snap(IApplication)
Declaration
public Task Snap(IApplication application)
Parameters
Type | Name | Description |
---|---|---|
IApplication | application |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Suspend(IPackage)
Declaration
public Task Suspend(IPackage package)
Parameters
Type | Name | Description |
---|---|---|
IPackage | package |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Terminate(IPackage)
Declaration
public Task Terminate(IPackage package)
Parameters
Type | Name | Description |
---|---|---|
IPackage | package |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
TryPairWithUser(Guid, PhoenixUser, Boolean)
Tries to pair a gamepad with a user.
Declaration
public Task<bool> TryPairWithUser(Guid gamepadId, PhoenixUser user, bool exclusive)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | gamepadId | The gamepad to pair the user to. |
PhoenixUser | user | The user to pair with the gamepad. |
System.Boolean | exclusive | Whether or not the gamepad should be paired exclusively with the user or not. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> | Whether or not the pairing was successful. |
Unconstrain(IPackage)
Declaration
public Task Unconstrain(IPackage package)
Parameters
Type | Name | Description |
---|---|---|
IPackage | package |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Uninstall(IPackage)
Declaration
public Task Uninstall(IPackage package)
Parameters
Type | Name | Description |
---|---|---|
IPackage | package |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Unsnap(IPackage)
Declaration
public Task Unsnap(IPackage package)
Parameters
Type | Name | Description |
---|---|---|
IPackage | package |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Explicit Interface Implementations
View SourceIDeviceStatus.GetAsync()
Gets the DeviceConnectionStatus of a device.
Declaration
async Task<DeviceConnectionStatus> IDeviceStatus.GetAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DeviceConnectionStatus> | The status of the device. |
IDeviceStatus.Set(DeviceConnectionStatus)
Sets the DeviceConnectionStatus for a device.
Declaration
void IDeviceStatus.Set(DeviceConnectionStatus status)
Parameters
Type | Name | Description |
---|---|---|
DeviceConnectionStatus | status | The status to set. |