From 699d31b3224a8972fa57f51b8bc78e2ed8526e08 Mon Sep 17 00:00:00 2001
From: Jakub Skowron http://tizen.org/feature/location.batch http://tizen.org/feature/sensor.sleep_monitor http://tizen.org/feature/sensor.activity_recognition When the pedometer, HRM, and GPS sensors are started, a change callback is invoked when data changes. Use the getHumanActivityData() method to get current data. When the pedometer, HRM, GPS and sleep monitor sensors are started, a change callback is invoked when data changes. Use the getHumanActivityData() method to get current data. The GPS sensor provides both the current value and a short history of last recorded GPS positions. The accumulative pedometer sensor does not have to be started by your application as long as step counting is enabled by any other application or the system. Listener registered with the setAccumulativePedometerListener() method is called when accumulative counters are changed. The wrist up sensor is notified when the relevant gesture is performed. The sensor must be enabled using the start() method. An event listener invoked when the gesture is detected. This sensor does not provide any data. Related Info Start the data collection and get monitor data. Track the changes in the step count. Recognizes activity and its accurance. Detects whether or not user is asleep. This tutorial shows how to use the monitor which detects whether or not user is asleep:
Since:
2.3
@@ -164,8 +179,13 @@ WRIST_UP - Wrist up gesture
HRM - Heart rate monitor (Heart rate and RR interval)
Remark :
+ SLEEP_MONITOR is supported since Tizen 3.0
+
+ Since:
+ 3.0
+ Code example: Output example:
+ Since:
+ 3.0
+
+ Since:
+ 3.0
+
+ Since:
+ 3.0
+
+
+ Sleep monitor
+
+
-Activity Recognition
@@ -51,6 +52,7 @@
Prerequisites
@@ -202,7 +204,43 @@ try {
+Sleep monitor
+
+
diff --git a/org.tizen.web.apireference/html/device_api/mobile/tizen/humanactivitymonitor.html b/org.tizen.web.apireference/html/device_api/mobile/tizen/humanactivitymonitor.html
index d12fb5f..7f9e203 100644
--- a/org.tizen.web.apireference/html/device_api/mobile/tizen/humanactivitymonitor.html
+++ b/org.tizen.web.apireference/html/device_api/mobile/tizen/humanactivitymonitor.html
@@ -33,13 +33,20 @@ For more information about how to use Human Activity Monitor API, see
+function onchangedCB(sleepInfo)
+{
+ console.log("Sleep status: " + sleepInfo.status);
+ console.log("Timestamp: " + sleepInfo.timestamp + " milliseconds");
+}
+
+tizen.humanactivitymonitor.start("SLEEP_MONITOR", onchangedCB);
+
+
+function onsuccessCB(sleepInfo)
+{
+ console.log("Sleep status: " + sleepInfo.status);
+ console.log("Timestamp: " + sleepInfo.timestamp + " milliseconds");
+}
+
+function onerrorCB(error)
+{
+ console.log("Error occurred: " + error.message);
+}
+
+tizen.humanactivitymonitor.getHumanActivityData("SLEEP_MONITOR", onsuccessCB, onerrorCB);
+
+
+tizen.humanactivitymonitor.stop("SLEEP_MONITOR");
+
+
-
void getHumanActivityData (HumanActivityType type, HumanActivityMonitorSuccessCallback successCallback, optional ErrorCallback? errorCallback)
+
- void start (HumanActivityType type, optional HumanActivityMonitorSuccessCallback? changedCallback, optional HumanActivityMonitorOption? option)
- void stop (HumanActivityType type)
- void setAccumulativePedometerListener (HumanActivityMonitorSuccessCallback changeCallback)
- void unsetAccumulativePedometerListener ()
- long addActivityRecognitionListener (ActivityRecognitionType type, HumanActivityMonitorSuccessCallback listener, optional ErrorCallback? errorCallback)
- void removeActivityRecognitionListener (long listenerId, optional ErrorCallback? errorCallback)
+
+StepDifference
@@ -126,6 +137,10 @@ For more information about how to use Human Activity Monitor API, see HumanActivitySleepMonitorData
+
+
@@ -135,7 +150,7 @@ For more information about how to use Human Activity Monitor API, see HumanActivityMonitorSuccessCallback
-HumanActivityMonitorOption
void onsuccess (optional HumanActivityData? humanactivitydata)
+
@@ -146,7 +161,7 @@ For more information about how to use Human Activity Monitor API, see
Specifies the supported human activity monitor types.
- enum HumanActivityType { "PEDOMETER", "WRIST_UP", "HRM", "GPS" };
+ enum HumanActivityType { "PEDOMETER", "WRIST_UP", "HRM", "GPS", "SLEEP_MONITOR" };
1.5. SleepStatus
+ enum SleepStatus { "ASLEEP", "AWAKE", "UNKNOWN" };
+
+
+ function onchangedCB(sleepInfo) {
+ console.log("Sleep status : " + sleepInfo.status);
+ console.log("Timestamp : " + sleepInfo.timestamp);
+ }
+
+ tizen.humanactivitymonitor.start("SLEEP_MONITOR", onchangedCB);
+
+ Sleep status : ASLEEP
+ Timestamp : 1456735296123
+
+2. Interfaces
@@ -1275,8 +1330,50 @@ When a user takes off the watch device, the heartRate is set to -3. When a user
2.10. HumanActivitySleepMonitorData
+ [NoInterfaceObject] interface HumanActivitySleepMonitorData : HumanActivityData {
+
+ readonly attribute SleepStatus status;
+
+ readonly attribute long timestamp;
+ };
+Attributes
+
+
+2.10. HumanActivityMonitorOption
+2.11. HumanActivityMonitorOption
2.11. HumanActivityRecognitionData
+2.12. HumanActivityRecognitionData
2.12. HumanActivityMonitorSuccessCallback
+2.13. HumanActivityMonitorSuccessCallback
+To guarantee that the human sleep state tracking application runs on a device with sleep monitor feature, declare the following feature requirements in the config file: +
+module HumanActivityMonitor { - enum HumanActivityType { "PEDOMETER", "WRIST_UP", "HRM", "GPS" }; + enum HumanActivityType { "PEDOMETER", "WRIST_UP", "HRM", "GPS", "SLEEP_MONITOR" }; enum PedometerStepStatus { "NOT_MOVING", "WALKING", "RUNNING" }; @@ -1478,6 +1583,8 @@ To guarantee that the activity information tracking application runs on a device enum ActivityAccuracy { "LOW", "MEDIUM", "HIGH" }; + enum SleepStatus { "ASLEEP", "AWAKE", "UNKNOWN" }; + [NoInterfaceObject] interface HumanActivityMonitorManagerObject { readonly attribute HumanActivityMonitorManager humanactivitymonitor; }; @@ -1580,6 +1687,13 @@ To guarantee that the activity information tracking application runs on a device readonly attribute HumanActivityGPSInfo[] gpsInfo; }; + [NoInterfaceObject] interface HumanActivitySleepMonitorData : HumanActivityData { + + readonly attribute SleepStatus status; + + readonly attribute long timestamp; + }; + dictionary HumanActivityMonitorOption { long? callbackInterval = null; diff --git a/org.tizen.web.apireference/html/device_api/wearable/tizen/humanactivitymonitor.html b/org.tizen.web.apireference/html/device_api/wearable/tizen/humanactivitymonitor.html index 4ac09c4..b925f44 100644 --- a/org.tizen.web.apireference/html/device_api/wearable/tizen/humanactivitymonitor.html +++ b/org.tizen.web.apireference/html/device_api/wearable/tizen/humanactivitymonitor.html @@ -45,6 +45,9 @@ For more information about how to use Human Activity Monitor API, see ActivityAccuracy +
enum HumanActivityType { "PEDOMETER", "WRIST_UP", "HRM", "GPS" };+
enum HumanActivityType { "PEDOMETER", "WRIST_UP", "HRM", "GPS", "SLEEP_MONITOR" };
Since: 2.3 @@ -170,8 +179,13 @@ WRIST_UP - Wrist up gesture HRM - Heart rate monitor (Heart rate and RR interval)
Remark : + SLEEP_MONITOR is supported since Tizen 3.0 +
+enum SleepStatus { "ASLEEP", "AWAKE", "UNKNOWN" };+
+ Since: + 3.0 +
+Code example:
function onchangedCB(sleepInfo) { + console.log("Sleep status : " + sleepInfo.status); + console.log("Timestamp : " + sleepInfo.timestamp); + } + + tizen.humanactivitymonitor.start("SLEEP_MONITOR", onchangedCB); ++
Output example:
Sleep status : ASLEEP + Timestamp : 1456735296123 ++
[NoInterfaceObject] interface HumanActivitySleepMonitorData : HumanActivityData { + + readonly attribute SleepStatus status; + + readonly attribute long timestamp; + };+
+ Since: + 3.0 +
+ ++ Since: + 3.0 +
++ Since: + 3.0 +
++To guarantee that the human sleep state tracking application runs on a device with sleep monitor feature, declare the following feature requirements in the config file: +
+module HumanActivityMonitor { - enum HumanActivityType { "PEDOMETER", "WRIST_UP", "HRM", "GPS" }; + enum HumanActivityType { "PEDOMETER", "WRIST_UP", "HRM", "GPS", "SLEEP_MONITOR" }; enum PedometerStepStatus { "NOT_MOVING", "WALKING", "RUNNING" }; @@ -1500,6 +1599,8 @@ To guarantee that the activity information tracking application runs on a device enum ActivityAccuracy { "LOW", "MEDIUM", "HIGH" }; + enum SleepStatus { "ASLEEP", "AWAKE", "UNKNOWN" }; + [NoInterfaceObject] interface HumanActivityMonitorManagerObject { readonly attribute HumanActivityMonitorManager humanactivitymonitor; }; @@ -1601,6 +1702,13 @@ To guarantee that the activity information tracking application runs on a device readonly attribute HumanActivityGPSInfo[] gpsInfo; }; + [NoInterfaceObject] interface HumanActivitySleepMonitorData : HumanActivityData { + + readonly attribute SleepStatus status; + + readonly attribute long timestamp; + }; + dictionary HumanActivityMonitorOption { long? callbackInterval = null; -- 2.7.4