From d28347fd0c13cbcc24a4ff06689a3b53808e83bb Mon Sep 17 00:00:00 2001
From: "taekeun.kang" If a human activity type allows setting the interval at which data is sent to the application or setting the sampling interval, the last parameter of the start() method, option, can be used to specify this information: To register a change listener, use the setChangeListener() method of the Sensor interface (in mobile and wearable applications). To register a change listener, use the setChangeListener() method of the Sensor interface (in mobile and wearable applications). This command requires two parameters. The first one is a handle to the callback method, which will be invoked for every incoming event. The second argument determines the amount of time (in milliseconds) passing between two consecutive events. Valid values are integers in range <10, 1000> inclusively. For example, setting an interval to 100 results in approximately 10 events being send every second.
Since:
- 2.3.2
+ 3.0
@@ -222,7 +222,7 @@ IN_VEHICLE - The in-vehicle activity recognition type
Since:
- 2.3.2
+ 3.0
@@ -427,7 +427,7 @@ That means that both 'http://tizen.org/privilege/healthinfo' and 'http
For other types, only 'http://tizen.org/privilege/healthinfo' should be declared.
Remark :
- option is supported since Tizen 2.3.2
+ option is supported since Tizen 3.0
Parameters:
Since:
- 2.3.2
+ 3.0
@@ -747,7 +747,7 @@ The ErrorCallback method is launched with this error type:
Since:
- 2.3.2
+ 3.0
@@ -1288,7 +1288,7 @@ When a user takes off the watch device, the heartRate is set to -3. When a user
};
Since:
- 2.3.2
+ 3.0
Since:
- 2.3.2
+ 3.0
Since:
- 2.3.2
+ 3.0
Since:
- 2.3.2
+ 3.0
Since:
- 2.3.2
+ 3.0
Since:
- 2.3.2
+ 3.0
Since:
- 2.3.2
+ 3.0
var myCallbackInterval = 240000;
+var mySampleInterval = 10000;
+
+function onchangedCB(gpsInfo)
+{
+ console.log("this callback will be called every " + myCallbackInterval + " milliseconds");
+ console.log("the gpsInfo will include the information of the GPS that is collected every " + mySampleInterval + " millisenconds");
+}
+
+var option = {"callbackInterval": myCallbackInterval,
+ "sampleInterval": mySampleInterval};
+};
+tizen.humanactivitymonitor.start("GPS", onchangedCB, option);
function onchangedCB(sensorData)
{
- console.log("value of pressure is: " + sensorData.pressure);
+ console.log("Light sensor data: " + sensorData.lightLevel);
}
var proximitySensor = tizen.sensorservice.getDefaultSensor("PROXIMITY");
+
The default value of interval parameter is 100. If you do not pass an interval value, a default one will be used:
var lightSensor = tizen.sensorservice.getDefaultSensor("LIGHT");
function onsuccessCB()
{
- console.log("proximity sensor start");
+ console.log("Light sensor service has started successfully.");
}
function onchangedCB(sensorData)
{
- console.log("proximity distance: " + sensorData.proximityState);
+ console.log("Light sensor data: " + sensorData.lightLevel);
}
-proximitySensor.setChangeListener(onchangedCB, 500);
-proximitySensor.start(onsuccessCB);
+lightSensor.setChangeListener(onchangedCB, 500);
+lightSensor.start(onsuccessCB);var lightSensor = tizen.sensorservice.getDefaultSensor("LIGHT");
@@ -159,15 +159,15 @@ function onchangedCB(sensorData)
}
// use the default interval value (100 ms):
-proximitySensor.setChangeListener(onchangedCB);
+lightSensor.setChangeListener(onchangedCB);
-proximitySensor.start(onsuccessCB);
+lightSensor.start(onsuccessCB);
proximitySensor.unsetChangeListener();
+lightSensor.unsetChangeListener();
enum ActivityRecognitionType { "STATIONARY", "WALKING", "RUNNING", "IN_VEHICLE" };
enum ActivityAccuracy { "LOW", "MEDIUM", "HIGH" };
By default, this parameter is set to null.
+ The option to set the period and the interval for several human activity types since Tizen 3.0
By default, this parameter is set to null.
Dictionary members
@@ -1296,11 +1296,11 @@ When a user takes off the watch device, the heartRate is set to -3. When a user
For the GPS type, callbackInterval can be between 120000ms and 600000ms inclusive, however, if it is null or zero, it is set by the default value of 120000ms.
For the HRM type, callbackInterval can be between 10ms and 1000ms inclusive, however, if it is null or zero, it is set set by the default value of 100ms.
For other activity types, callbackInterval will be ignored.
+ The callbackInterval in milliseconds (ms) at which human activity data will be sent to the Web Application since Tizen 3.0
For the GPS type, callbackInterval can be between 120000ms and 600000ms inclusive, however, if it is null or zero, it is set by the default value of 120000ms.
For the HRM type, callbackInterval can be between 10ms and 1000ms inclusive, however, if it is null or zero, it is set set by the default value of 100ms.
For other activity types, callbackInterval will be ignored.
Remark: interval is supported since Tizen 2.3.2
+Remark: interval is supported since Tizen 3.0
Parameters:
enum ActivityRecognitionType { "STATIONARY", "WALKING", "RUNNING", "IN_VEHICLE" };
Since: - 2.3.2 + 3.0
@@ -222,7 +222,7 @@ IN_VEHICLE - The in-vehicle activity recognition type
enum ActivityAccuracy { "LOW", "MEDIUM", "HIGH" };
Since: - 2.3.2 + 3.0
@@ -427,7 +427,7 @@ That means that both 'http://tizen.org/privilege/healthinfo' and 'http For other types, only 'http://tizen.org/privilege/healthinfo' should be declared.
Remark : - option is supported since Tizen 2.3.2 + option is supported since Tizen 3.0
Parameters:
@@ -442,7 +442,7 @@ For other types, only 'http://tizen.org/privilege/healthinfo' should be dSince: - 2.3.2 + 3.0
@@ -747,7 +747,7 @@ The ErrorCallback method is launched with this error type:
Since: - 2.3.2 + 3.0
@@ -1288,7 +1288,7 @@ When a user takes off the watch device, the heartRate is set to -3. When a user };
Since: - 2.3.2 + 3.0
Since: - 2.3.2 + 3.0
Since: - 2.3.2 + 3.0
@@ -1331,7 +1331,7 @@ When a user takes off the watch device, the heartRate is set to -3. When a user };Since: - 2.3.2 + 3.0
Since: - 2.3.2 + 3.0
Since: - 2.3.2 + 3.0
Since: - 2.3.2 + 3.0
diff --git a/org.tizen.web.apireference/html/device_api/wearable/tizen/sensor.html b/org.tizen.web.apireference/html/device_api/wearable/tizen/sensor.html index 068805c..22577ba 100644 --- a/org.tizen.web.apireference/html/device_api/wearable/tizen/sensor.html +++ b/org.tizen.web.apireference/html/device_api/wearable/tizen/sensor.html @@ -532,7 +532,7 @@ Note that the setChangeListener() method only registers the listener. The start() method must be called to turn on the sensor, or the sensor data will not change.Remark: interval is supported since Tizen 2.3.2
+Remark: interval is supported since Tizen 3.0
Parameters: