Share via


OrientationSensor.GetDeviceSelector Method

Definition

Overloads

GetDeviceSelector(SensorReadingType)

Gets the device selector.

GetDeviceSelector(SensorReadingType, SensorOptimizationGoal)

Gets the device selector.

GetDeviceSelector(SensorReadingType)

Gets the device selector.

public:
 static Platform::String ^ GetDeviceSelector(SensorReadingType readingType);
/// [Windows.Foundation.Metadata.Overload("GetDeviceSelector")]
 static winrt::hstring GetDeviceSelector(SensorReadingType const& readingType);
[Windows.Foundation.Metadata.Overload("GetDeviceSelector")]
public static string GetDeviceSelector(SensorReadingType readingType);
function getDeviceSelector(readingType)
Public Shared Function GetDeviceSelector (readingType As SensorReadingType) As String

Parameters

readingType
SensorReadingType

The type of sensor to retrieve.

Returns

String

Platform::String

winrt::hstring

Returns the device selector, if it exists; otherwise, null.

Attributes

Windows requirements

Device family
Windows 10 Fall Creators Update (introduced in 10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v5.0)

Applies to

GetDeviceSelector(SensorReadingType, SensorOptimizationGoal)

Gets the device selector.

public:
 static Platform::String ^ GetDeviceSelector(SensorReadingType readingType, SensorOptimizationGoal optimizationGoal);
/// [Windows.Foundation.Metadata.Overload("GetDeviceSelectorWithSensorReadingTypeAndSensorOptimizationGoal")]
 static winrt::hstring GetDeviceSelector(SensorReadingType const& readingType, SensorOptimizationGoal const& optimizationGoal);
[Windows.Foundation.Metadata.Overload("GetDeviceSelectorWithSensorReadingTypeAndSensorOptimizationGoal")]
public static string GetDeviceSelector(SensorReadingType readingType, SensorOptimizationGoal optimizationGoal);
function getDeviceSelector(readingType, optimizationGoal)
Public Shared Function GetDeviceSelector (readingType As SensorReadingType, optimizationGoal As SensorOptimizationGoal) As String

Parameters

readingType
SensorReadingType

The type of sensor to retrieve. An Absolute SensorReadingType returns an OrientationSensor using an accelerometer, a gyromoter, and magnetometer to determine the orientation with respect to magnetic North. A Relative SensorReadingType returns an OrientationSensor using an accelerometer and gyrometer only (no magnetometer), measuring relative to where the sensor was first instantiated.

optimizationGoal
SensorOptimizationGoal

Indicates the preferences of optimization for the sensor. This field is only used if an Absolute SensorReadingType is specified. An optimizationGoal of Precision will return an OrientationSensor using an accelereometer, a gyrometer, and a magnetometer to determine orientation with respect to magnetic North. This has the potential to use a lot of power due to it’s use of a gyrometer. In contrast, specifying an optimizationGoal of PowerEfficiency will return an OrientationSensor using an accelerometer and magnetometer only (no gyrometer) to save power at the a cost of some accuracy (readings will still be relatively accurate in most circumstances).

Returns

String

Platform::String

winrt::hstring

Returns the device selector, if it exists; otherwise, null.

Attributes

Windows requirements

Device family
Windows 10 Fall Creators Update (introduced in 10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v5.0)

Applies to