# DeviceSensors

Namespace: **Wisej.Hybrid**

Assembly: **Wisej.Hybrid** (3.5.0.0)

Provides integrations to interact with device sensors.

{% tabs %}
{% tab title="C#" %}

```csharp
public class DeviceSensors
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class DeviceSensors
```

{% endtab %}
{% endtabs %}

Access this class through the [Device](/hybrid/start/api/general/wisej.hybrid.device.md) singleton.

## Constructors

### ![](/files/CCV9PPenlC1YZvNh1I6R)DeviceSensors()

Initializes a new instance of [DeviceSensors](/hybrid/start/api/sensors/wisej.hybrid.devicesensors.md) and attaches to sensor events.

## Methods

### ![](/files/CCV9PPenlC1YZvNh1I6R)IsMonitoring(type)

Gets whether the given [SensorType](/hybrid/start/api/sensors/wisej.hybrid.shared.sensors.sensortype.md) is available for monitoring on the hybrid device.

| Parameter | Type                                                                              | Description         |
| --------- | --------------------------------------------------------------------------------- | ------------------- |
| **type**  | [SensorType](/hybrid/start/api/sensors/wisej.hybrid.shared.sensors.sensortype.md) | The type of sensor. |

**Returns:** [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean). True if the given SensorType is available for monitoring.

### ![](/files/CCV9PPenlC1YZvNh1I6R)IsSupported(type)

Gets whether the given [SensorType](/hybrid/start/api/sensors/wisej.hybrid.shared.sensors.sensortype.md) is supported on the hybrid device.

| Parameter | Type                                                                              | Description         |
| --------- | --------------------------------------------------------------------------------- | ------------------- |
| **type**  | [SensorType](/hybrid/start/api/sensors/wisej.hybrid.shared.sensors.sensortype.md) | The type of sensor. |

**Returns:** [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean). True if the given SensorType is supported.

### ![](/files/CCV9PPenlC1YZvNh1I6R)Start(type)

Starts monitoring the given [SensorType](/hybrid/start/api/sensors/wisej.hybrid.shared.sensors.sensortype.md) on the hybrid device.

| Parameter | Type                                                                              | Description         |
| --------- | --------------------------------------------------------------------------------- | ------------------- |
| **type**  | [SensorType](/hybrid/start/api/sensors/wisej.hybrid.shared.sensors.sensortype.md) | The type of sensor. |

### ![](/files/CCV9PPenlC1YZvNh1I6R)Stop(type)

Stops monitoring the given [SensorType](/hybrid/start/api/sensors/wisej.hybrid.shared.sensors.sensortype.md) on the hybrid device.

| Parameter | Type                                                                              | Description         |
| --------- | --------------------------------------------------------------------------------- | ------------------- |
| **type**  | [SensorType](/hybrid/start/api/sensors/wisej.hybrid.shared.sensors.sensortype.md) | The type of sensor. |

## Events

### ![](/files/CCV9PPenlC1YZvNh1I6R)AccelerometerChanged

[EventHandler\<AccelerometerChangedEventArgs>](https://docs.microsoft.com/dotnet/api/system.eventhandler-1) Occurs when accelerometer reading changes.

### ![](/files/CCV9PPenlC1YZvNh1I6R)BarometerChanged

[EventHandler\<BarometerChangedEventArgs>](https://docs.microsoft.com/dotnet/api/system.eventhandler-1) Occurs when barometer reading changes.

### ![](/files/CCV9PPenlC1YZvNh1I6R)CompassChanged

[EventHandler\<CompassChangedEventArgs>](https://docs.microsoft.com/dotnet/api/system.eventhandler-1) Occurs when compass reading changes.

### ![](/files/CCV9PPenlC1YZvNh1I6R)GyroscopeChanged

[EventHandler\<GyroscopeChangedEventArgs>](https://docs.microsoft.com/dotnet/api/system.eventhandler-1) Occurs when gyroscope reading changes.

### ![](/files/CCV9PPenlC1YZvNh1I6R)MagnetometerChanged

[EventHandler\<MagnetometerChangedEventArgs>](https://docs.microsoft.com/dotnet/api/system.eventhandler-1) Occurs when magnetometer reading changes.

### ![](/files/CCV9PPenlC1YZvNh1I6R)OrientationSensorChanged

[EventHandler\<OrientationSensorChangedEventArgs>](https://docs.microsoft.com/dotnet/api/system.eventhandler-1) Occurs when the orientation sensor reading changes.

### ![](/files/CCV9PPenlC1YZvNh1I6R)ReadingChanged

![](/files/MnSGSMYag23SyEY12n0K)**Deprecated**: This event will be removed in future releases in favor of sensor-specific events. [EventHandler\<SensorChangedEventArgs>](https://docs.microsoft.com/dotnet/api/system.eventhandler-1) Fires when a sensor's reading changes.

### ![](/files/CCV9PPenlC1YZvNh1I6R)Shake

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Occurs when the device is shaken.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/hybrid/start/api/sensors/wisej.hybrid.devicesensors.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
