Languages

Menu
Sites
Language
reading heartrate from Gear S not working

As you can see in the image above I have a simple function to read the heartrate from my Gear S device but unfortunetly it doesnt work... Normally the green light is coming out from the device when calling this api but it doesn't do nothing. I already declared the privilige; healthinfo and location to be sure.. and as feature I declared the sensor.heart_rate_monitor and humanactivitysensor. Also the samsung extension is correct installed.

Does someone know why I can't start the sensor and How I can make it work?

Thank you

Responses

4 Replies
André Reus

hi houssain elbou, follow this

  1. Define the action to be taken when HRM data changes. In the following example, the heart rate and R-R interval of user are recorded in the console log:
    function onchangedCB(hrmInfo)
    {
       console.log("Heart rate: " + hrmInfo.heartRate);
       console.log("R-R interval: " + hrmInfo.rRInterval);
    }
  2. To start listening to HRM data changes, use the start() method to register the onchangedCBlistener:
    webapis.motion.start("HRM", onchangedCB);
  3. To stop listening to HRM data changes, use the stop() method:
    webapis.motion.stop("HRM");
  4. Also add the privileges. 

And let me know your project api version from config.xml 

houssain elbou
The version of my config file is set to 2.2 to make the api work for older devices such as the GearS. And this are my privileges.
houssain elbou
houssain elbou

Hi Andre I finally got it work! I changed my privilege from 

<tizen:privilege name="http://tizen.org/privilege/healthinfo"/> 

to 

 <privilege name="http://developer.samsung.com/privilege/healthinfo"/>