我想使用humanactivitymonitor来访问或记录以前应该由sHealth记录的睡眠监视器数据。尽管文档中说它从Tizen2.3就可以使用,但每次我尝试使用函数tizen.humanactivitymonitor.startRecorder('SLEEP_MONITOR');或tizen.humanactivitymonitor.readRecorderData('SLEEP_MONITOR',query, sleepStateChangedCB,onSleepError);时,都会收到错误消息“传递了不支持的类型”。
顺便说一句:使用函数tizen.humanactivitymonitor.start('SLEEP_MONITOR', sleepStateChangedCB, sleepStateChangedErrorCB );可以很好地工作,但不是我所需要的。
有人知道问题出在哪里吗?我的Gear S3在Tizen 2.3.2.3上运行
发布于 2018-03-22 21:15:41
尝试以下代码:
function startRecording() {
var type = 'SLEEP_MONITOR';
var options = {
retentionPeriod : 1
};
try {
tizen.humanactivitymonitor.startRecorder(type, options);
} catch (err) {
var message = 'cannot start recording' + err.name + ': ' + err.message
console.log(message);
}
}https://stackoverflow.com/questions/47377020
复制相似问题