LegacyGipGameControllerProvider.ExecuteCommand(DeviceCommand) 方法

定义

在旧版 GIP (游戏输入协议) 头戴显示设备上执行命令。

public:
 virtual void ExecuteCommand(DeviceCommand command) = ExecuteCommand;
void ExecuteCommand(DeviceCommand const& command);
public void ExecuteCommand(DeviceCommand command);
function executeCommand(command)
Public Sub ExecuteCommand (command As DeviceCommand)

参数

command
DeviceCommand

要执行的命令。

示例

public void SetupHeadset(IGameControllerProvider headsetProvider)
{
    LegacyGipGameControllerProvider legacyGipGameControllerProvider =
        LegacyGipGameControllerProvider.FromGameControllerProvider(headsetProvider);

    // Reset the device
    legacyGipGameControllerProvider.ExecuteCommand(DeviceCommand.Reset);

    // Check the smart mute level
    byte[] smartMuteBuffer =
        legacyGipGameControllerProvider.GetHeadsetOperation(HeadsetOperation.SmartMute);
    HeadsetLevel smartMuteValue = (HeadsetLevel)smartMuteBuffer[0];

    // Set bass boost to 3db
    byte[] bassBuffer = BitConverter.GetBytes((UInt32)3);
    legacyGipGameControllerProvider.SetHeadsetOperation(HeadsetOperation.BassBoostGain,
        bassBuffer);
}

注解

注意

为了避免损坏设备,头戴显示设备控制 API 应仅与你开发的硬件一起使用。

适用于

另请参阅