Description:
The FindSensorChannel method searches for sensor
channels available on the device.
This is a synchronous method.
Syntax:
FindSensorChannel(parameters:Object):Object
Arguments:
parameters:
This is an object that specifies the search parameters. For more information about the object properties and how to define them, see section Parameters for searching sensor channels.
Return value:
The FindSensorChannel method returns an object
that contains the requested sensor channel information, an error code, and
an error message.
|
Property |
Description |
Value |
|---|---|---|
|
|
This is an array of objects that contains information about the sensor channels matching the search criteria. |
|
|
|
This is a number that specifies a predefined error code. |
|
|
|
This is a text string that describes the error. |
Example code:
The following sample code illustrates how to find a specific sensor:
import com.nokia.lib.Service;
var sensor = new Service("Service.Sensor", "ISensor");
var inParams = {SearchCriterion:"Orientation"};
var outParams = sensor.FindSensorChannel(inParams);
if (outParams.ErrorCode == 0) {
var channelInfo = outParams.ReturnValue;
var channelId = channelInfo[0].ChannelId;
} else {
var errorId = outParams.ErrorCode;
}