Description:
The GetChannelProperty method retrieves information
about a sensor channel property.
This is a synchronous method.
Syntax:
GetChannelProperty(parameters:Object):Object
Arguments:
parameters:
This is an object that specifies which sensor channel property to retrieve information about. For more information about the object properties and how to define them, see section Parameters for retrieving channel property information.
Return value:
The GetChannelProperty method returns an object
that contains the requested channel property information, an error code, and
an error message.
|
Property |
Description |
Value |
|---|---|---|
|
|
This is an object that contains the information for the specified sensor channel property. |
|
|
|
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 get the channel property of the specified sensor channel:
import com.nokia.lib.Service;
var sensor = new Service("Service.Sensor", "ISensor");
var channelInfo = {ChannelId:channelId, ContextType:contextType, Quantity:quantity, ChannelType:channelType, Location:location, VendorId:vendorId, DataItemSize:dataItemSize, ChannelDataTypeId:channelDataTypeId}; //Valid values must be passed to Channelinfo
var inParams = {ChannelInfoMap:channelInfo, PropertyId:"DataRate"};
var outParams = sensor.GetChannelProperty(inParams);
if (outParams.ErrorCode == 0) {
var channelProperty = outParams.ReturnValue;
var propertyValue = channelProperty.PropertyValue;
} else {
var errorId = outParams.ErrorCode;
}