AWAKE: 'AWAKE'
};
+function convertActivityData(type, data) {
+ switch (type) {
+ case HumanActivityType.PEDOMETER:
+ return new HumanActivityPedometerData(data);
+ case ACCUMULATIVE_PEDOMETER_DATA:
+ return new HumanActivityAccumulativePedometerData(data);
+ case HumanActivityType.HRM:
+ return new HumanActivityHRMData(data);
+ case HumanActivityType.GPS:
+ var gpsInfo = [];
+ for (var i = 0, max = data.gpsInfo.length; i < max; i++) {
+ gpsInfo.push(new HumanActivityGPSInfo(data.gpsInfo[i]));
+ }
+ return new HumanActivityGPSInfoArray(gpsInfo);
+ case HumanActivityType.SLEEP_MONITOR:
+ return new HumanActivitySleepMonitorData(data);
+ case HumanActivityType.SLEEP_DETECTOR:
+ return new HumanActivitySleepDetectorData(data);
+ case HumanActivityType.STRESS_MONITOR:
+ return new HumanActivityStressMonitorData(data);
+ default:
+ utils_.error('Uknown human activity type: ' + type);
+ }
+}
+
+function createRecorderData(func, data) {
+ var array = [];
+
+ data.forEach(function(d) {
+ array.push(new func(d));
+ });
+
+ return array;
+}
+
function convertActivityRecorderData(type, data) {
var func = undefined;
switch (type) {
accumulativePedometerListener = null;
};
-HumanActivityMonitorManager.prototype.addActivityRecognitionListener = function () {
+HumanActivityMonitorManager.prototype.addActivityRecognitionListener = function() {
throw new WebAPIException(
'NotSupportedError',
'addActivityRecognitionListener is not longer supported since Tizen 7.0.'
);
-}
+};
-HumanActivityMonitorManager.prototype.removeActivityRecognitionListener = function () {
+HumanActivityMonitorManager.prototype.removeActivityRecognitionListener = function() {
throw new WebAPIException(
'NotSupportedError',
'removeActivityRecognitionListener is not longer supported since Tizen 7.0.'
);
-}
+};
HumanActivityMonitorManager.prototype.startRecorder = function() {
var args = validator_.validateArgs(arguments, [