Wrong Human Activity Monitor HRM values

Wrong Human Activity Monitor HRM values

BY 12 Apr 2016 Web Application Development

Hey, I’m trying to retreave the HeartRate from HRM using:  

var HRUtils = {
    abc : function(){
        var count = 0;
        
         function onsuccessCB(heartInfo) {
             console.log(“Rate: ” + heartInfo.heartRate);
             
             count++;
             if(count >= 100){
                 tizen.humanactivitymonitor.stop(“HRM”);
             }
         }

         function onerrorCB(error) {
             alert(“Erro!”);
         }

         function onchangedCB(heartData) {
             tizen.humanactivitymonitor.getHumanActivityData(“HRM”, onsuccessCB, onerrorCB);
         }

         tizen.humanactivitymonitor.start(“HRM”, onchangedCB);
    }
};

 

But it works once at while and I have no idea why. Sometimes the output is totally correct (75, 73, 74… 80) and other times (0, 0, 0, 0…).

Written by