From 8dd8516b54fe1a149f73e64713c6738aa0087db5 Mon Sep 17 00:00:00 2001 From: Pawel Wasowski
Related Info
You can enable the sensor, read sensor data, and disable the sensor.
You can retrieve information about the technical limits of the sensor.
The supported sensor types and their capabilities are listed in the following table.
@@ -120,6 +123,7 @@Check, whether the sensor is supported, enable the sensor, read sensor data, and disable the sensor.
Register an event handler to receive notifications on sensor data changes.
Retrieve information about the technical limits of the sensor.
Learning how to register a change event handler for sensor data enables your application to react to changes without the need to check current values constantly.
+Learning how to register a change event handler for sensor data enables your application to react to changes without the need to check current values constantly:
Learning how to retrieve information about the sensor hardware enables your application to know the sensor's technical limits:
+ ++function onsuccessCB(hwInfo) +{ + console.log("name: " + hwInfo.name); + console.log("type: " + hwInfo.type); + console.log("vendor: " + hwInfo.vendor); + console.log("minValue: " + hwInfo.minValue); + console.log("maxValue: " + hwInfo.maxValue); + console.log("resolution: " + hwInfo.resolution); + console.log("minInterval: " + hwInfo.minInterval); + console.log("maxBatchCount: " + hwInfo.maxBatchCount); +} + +function onerrorCB(error) +{ + console.log("An error occurred: " + error.message); +} ++
+var proximitySensor = tizen.sensorservice.getDefaultSensor("PROXIMITY"); + +proximitySensor.getSensorHardwareInfo(onsuccessCB, onerrorCB); ++