using System.Runtime.InteropServices;
using UnityEngine.InputSystem.Utilities;
namespace UnityEngine.InputSystem.LowLevel
{
///
/// Device command to instruct the underlying platform to pair a user account to the targeted device.
///
///
///
/// If successful, the platform should then send an
/// to signal that the device configuration has been changed. In response, a
/// may be sent to fetch the paired user ID from the device.
///
[StructLayout(LayoutKind.Explicit, Size = kSize)]
public struct InitiateUserAccountPairingCommand : IInputDeviceCommandInfo
{
public static FourCC Type { get { return new FourCC('P', 'A', 'I', 'R'); } }
internal const int kSize = InputDeviceCommand.kBaseCommandSize;
[FieldOffset(0)]
public InputDeviceCommand baseCommand;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1008:EnumsShouldHaveZeroValue", Justification = "Enum values mandated by native code")]
public enum Result
{
///
/// User pairing UI has been successfully opened.
///
SuccessfullyInitiated = 1,
///
/// System does not support application-invoked user pairing.
///
ErrorNotSupported = (int)InputDeviceCommand.GenericFailure,
///
/// There already is a pairing operation in progress and the system does not support
/// pairing multiple devices at the same time.
///
ErrorAlreadyInProgress = -2,
}
public FourCC typeStatic
{
get { return Type; }
}
public static InitiateUserAccountPairingCommand Create()
{
return new InitiateUserAccountPairingCommand
{
baseCommand = new InputDeviceCommand(Type, kSize),
};
}
}
}