GameControllerFirmwareCorruptReason Enum
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
The state of firmware corruption for a device.
public enum class GameControllerFirmwareCorruptReason
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Gaming.Input.GamingInputPreviewContract, 131072)]
enum class GameControllerFirmwareCorruptReason
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Gaming.Input.GamingInputPreviewContract), 131072)]
public enum GameControllerFirmwareCorruptReason
var value = Windows.Gaming.Input.Preview.GameControllerFirmwareCorruptReason.unknown
Public Enum GameControllerFirmwareCorruptReason
- Inheritance
-
GameControllerFirmwareCorruptReason
- Attributes
Windows requirements
Device family |
Windows Desktop Extension SDK (introduced in 10.0.23665.0)
|
API contract |
Windows.Gaming.Input.GamingInputPreviewContract (introduced in v2.0)
|
Fields
Name | Value | Description |
---|---|---|
Unknown | 0 | It is not known whether firmware is corrupt. |
NotCorrupt | 1 | The firmware is not corrupt. |
TwoUpCorrupt | 2 | The 2Up firmware is corrupt. |
AppCorrupt | 3 | The app firmware is corrupt. |
RadioCorrupt | 4 | The radio firmware is corrupt. |
EepromCorrupt | 5 | The EEPROM is corrupt. |
SafeToUpdate | 6 | The firmware can be safely updated to recover from corruption. |
Examples
public void EnumerateControllerProperties()
{
foreach (Gamepad gamepad in Gamepad.Gamepads)
{
// Create the provider
LegacyGipGameControllerProvider legacyGipGameControllerProvider =
LegacyGipGameControllerProvider.FromGameController(gamepad);
if (legacyGipGameControllerProvider == null)
{
// Not every gamepad is a legacy GIP game controller, continue enumerating
continue;
}
// Check properties
GameControllerBatteryChargingState chargeState =
legacyGipGameControllerProvider.BatteryChargingState;
GameControllerBatteryKind batteryKind =
legacyGipGameControllerProvider.BatteryKind;
GameControllerBatteryLevel batteryLevel =
legacyGipGameControllerProvider.BatteryLevel;
bool isOldFirmwareCorrupted =
legacyGipGameControllerProvider.IsFirmwareCorrupted;
bool isNewFirmwareCorrupted =
legacyGipGameControllerProvider.GetDeviceFirmwareCorruptionState()
!= GameControllerFirmwareCorruptReason.NotCorrupt;
bool isSynthetic = legacyGipGameControllerProvider.IsSyntheticDevice;
byte[] extendedDeviceInfo = legacyGipGameControllerProvider.GetExtendedDeviceInfo();
// Check for a particular GIP interface
bool supportsSomeCustomInterface =
legacyGipGameControllerProvider.IsInterfaceSupported(
new Guid(
0xaaaaaaaa, 0xbbbb, 0xcccc, 0xe, 0xf, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6));
IReadOnlyList<string> preferredTypes =
legacyGipGameControllerProvider.PreferredTypes;
bool isGamepad = preferredTypes.Contains("Windows.Xbox.Input.Gamepad");
bool isHeadset = preferredTypes.Contains("Windows.Xbox.Input.Headset");
// Change the LED to half brightness
legacyGipGameControllerProvider.SetHomeLedIntensity(50);
}
}
Remarks
Caution
To avoid damaging devices, the firmware corruption and update APIs should only be used with hardware you have developed.