Retrieve Sensor Info

I am implementing Sensors in my WatchApp and enable using:

Snsr.setEnabledSensors( [Snsr.SENSOR_HEARTRATE, Snsr.SENSOR_FOOTPOD, Snsr.SENSOR_STRIDE] );
Snsr.enableSensorEvents( method(:onSnsr) );


With the callback function onSnsr() I read sensor information. I can get heartRate but I don’t see a field for foot pod or stride. How to I retrieve information for foot pod and stride?
  • Former Member
    Former Member over 10 years ago
    I don't believe there is anything available yet for SENSOR_STRIDE. So I think the following is the best you can do with the current release.

    function onSnsr(snsrInfo) {
    var hr = snsrInfo.heartRate;
    var cad = snsrInfo.cadence;
    Sys.println("HR = " + hr );
    Sys.println("Cadence = " + cad );
    }
  • Are you reading from a FIT file or using the simulation?

    -Alpha Monkey
  • Former Member
    Former Member over 10 years ago
    Are you reading from a FIT file or using the simulation?

    -Alpha Monkey
    If he was reading from a fit file then couldn't that be misleading? For example he could receive whatever information he called that is available in the fit file, regardless of whether or not it actually came from the sensor.
  • Former Member
    Former Member over 10 years ago
    If you are working with an actual physical sensor, you can use the generic ANT interface to connect to it and get the real sensor data, but I don't think mrmrlarry is doing that. The Sensors module just uses simulated data (from nowhere, or from a FIT file) that you could receive from sensors supported natively by the device. None of the data comes from an actual sensor in this case. In the 0.1.1 version of the SDK, reading from the FIT file supports more data than our built in data simulation.

    I believe the inclusion of the "stride" sensor in the list for this release was a mistake. There is not a natively supported sensor that is called a stride sensor, so it is probably going to drop out of the Sensors API.