/// <summary> /// Sets the perception simulation control mode. /// </summary> /// <param name="mode">The simulation control mode.</param> /// <remarks>This method is only supported on HoloLens devices.</remarks> /// <returns>Task tracking completion of the REST call.</returns> public async Task SetPerceptionSimulationControlMode(SimulationControlMode mode) { if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } string payload = string.Format( "mode={0}", (int)mode); await this.Post(HolographicSimulationModeApi, payload); }
/// <summary> /// Compares the current simulation control mode with the expected mode. /// </summary> /// <param name="expectedMode">The simulation control mode that we expect the device to be in.</param> /// <returns>The simulation control mode.</returns> private async Task <bool> VerifySimulationControlModeAsync(SimulationControlMode expectedMode) { SimulationControlMode simMode = await this.GetPerceptionSimulationControlModeAsync(); return(simMode == expectedMode); }