Nayangar
Nayangar

Reputation: 139

How to access sleep monitor Data on Samsung Gear S3?

I would like to use the humanactivitymonitor in order to access or record the sleepmonitor data which should previously have been recorded by sHealth. Although in the docs it says it is available since Tizen 2.3, I am getting the Error "Not supported type was passed" everytime I try to use the function tizen.humanactivitymonitor.startRecorder('SLEEP_MONITOR'); or tizen.humanactivitymonitor.readRecorderData('SLEEP_MONITOR',query, sleepStateChangedCB,onSleepError);.

By the way: using the function tizen.humanactivitymonitor.start('SLEEP_MONITOR', sleepStateChangedCB, sleepStateChangedErrorCB ); works perfectly fine but is not what i need.

Does anyone have an idea what the problem could be? My Gear S3 is running on Tizen 2.3.2.3

Upvotes: 1

Views: 499

Answers (1)

tymbark
tymbark

Reputation: 1369

try this code:

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);
    }

}

Upvotes: 1

Related Questions