JavaScript Sensor Service API

The Sensor Service API is supported since WRT 1.1.

The Sensor Service API allows widgets to access data provided by the physical sensors of a device. The data from a given sensor is mapped to one or more sensor channels, which the API can listen to. The available sensors depend on the device. The API is integrated into WRT through the device object.

For an overview of the service and the API, see section Accessing data from the physical sensors of a device.

Using the Sensor Service API

To use the Sensor Service API, your widget must first create a service object for it using the device.getServiceObject() method. Use Service.Sensor to identify the service provider and ISensor to identify the supported interface:

var so = device.getServiceObject("Service.Sensor", "ISensor");

This service object can then be used to access the services provided by the API:

Emulator support

The Sensors Service API is supported only on the 5th Edition Forum Nokia SDK.