FindSensorChannel performs a search operation for sensor channels in a S60 device based on the specified search criteria.
The client application specifies the search parameters and queries to the Sensor services, which returns a list containing channel information matching the search parameters.
The following is an example for using FindSensorChannel:
sensor_handle.call('FindSensorChannel', {'SearchCriterion': u'Orientation'})
The following table summarizes the specification of FindSensorChannel:
| Interface | ISensor |
| Description | Performs a search operation for sensor channels in an S60 device based on the specified search criteria. |
| Response Model | Synchronous |
| Pre-condition | ISensor interface is loaded. |
| Post-condition | Receives list of sensor channel which can be used to open channels. |
Input Parameters
Input parameter is a string that specifies the search criteria for performing the search operation.
|
Output Parameters
Add API which misses out on some mandatory input
Output contains ReturnValue. It also contains ErrorCode and an ErrorMessage if the operation fails. ReturnValue is an array of objects, which contains the sensor channel information requested by FindSensorChannel.
|
Errors
The following table lists the error codes and their values:
|
Error Messages
The following table lists the error messages and their description:
|
Example
The following sample code illustrates how to query a list of channel information matching the search parameters:
try:
result = sensor_handle.call('FindSensorChannel', {'SearchCriterion': u'Orientation'})
count_items = len(result)
print count_items
print "ChannelId : ", result[0]['ChannelId']
print "ContextType : ", result[0]['ContextType']
print "Quantity : ", result[0]['Quantity']
print "ChannelType : ", result[0]['ChannelType']
print "Location : ", result[0]['Location']
print "VendorId : ", result[0]['VendorId']
print "DataItemSize : ", result[0]['DataItemSize']
print "ChannelDataTypeId : ", result[0]['ChannelDataTypeId']
except scriptext.ScriptextError, err:
print "Error performing the operation : ", err
See About this document... for information on suggesting changes.