Sensor list

I'm writing a start screen for my first app and I'm trying to display on connectivity overview which would include GPS status, phone connection status, HR, power meter and Di2 device list with battery statuses, where applicable. AntPlus.Shifting will probably cover the Di2 and AntPlus BikePower the power meter but where I don't see any subclass for the HR. What is that under? FitnessEquiment?

And can you use the AntPlus.DeviceListener onDeviceStateUpdate for detecting when any AntPlus device changes status? 

Thanks in advance,

  Nik

  • I've been working on app for my Edge 530, which reads out battery status of each connected device. All are ANT+ connected, and I also couldn't find a way to read info from HR device via AntPlus api. Power, candence, speed etc. work fine.

    It could probably be done via Ant api directly, but I didn't start learning it. Instead I used BLE for reading info from my HR device (Polar H10, both BLE and ANT+ supported)

    You can get device state updates, but you have to make class which extend the subclass of the device type (eg. BikePowerListener ). My experience is that you don't always get those updates (or possibly some devices send them more often, some less), in addition I'm using periodic polling to get the info.

  • I think I got most of the sensors covered but the HR still eludes me. Which is really strange, one would think that the HR-sensors would have been one of the first to connect with ANT+. It can't be "FitnessEquiment", right? That sounds more like a ANT+ capable spinning bike or running mat...

  • You want to check out the sensors module to get the HR data.  It will leverage the native device interface for access to any integrated or paired HR sensors.  This is easier that trying to implement HR on your own through the ANT+ module.  Which you can still do but just adds to the complexity of your app.

  • You want to stick with the native HR interface (Sensors) as that way it gets into the fit file properly and is used in conjunction with the first beat stuff.  If you do your own ANT stuff, it can't be paired natively.

  • I think Nik and I are interested to read the battery status of connected HR device, not the heart rate data itself. AntPlus API provides easy methods for reading battery level for all sorts of sensors (power, speed, cadence, lights,), but for some reason not heart rate sensors.

  • One think you need to know is many HR sensors are BLE and not Ant. (some are both, like the Garmin HRM-DUAL)

    And if you want to use ant from an app for the battery level, you'd be dealing with it in the same way as if you were getting HR.

    The AntPlus API is only for specific sensors. Notice there's nothing there for an external HRM.

  • I know AntPlus API is only for specific sensors. I use it to read battery info from my speed, candence and power meters (using BikeCadence, BikePower and BikeSpeed subclasses).  We are mainly wondering why hasn't Garmin provided a subclass for heart rate sensor also. 

    I can try read it using Ant API, it's just that to me AntPlus is much easier to use.

  • Thanks for the replies. I do see the problem with the BT/ANT+ HR-sensor-duality. I can get the currrent HR conveniently from the getActivityInfo() but I'm mostly interested in the connected status and battery info of the HR device for the initial status screen, although I suspect that most devices wouldn't even report the battery level(?). It can't even be read with Sensors, right? I haven't checked if the Activity.Info returns null for currentHeartRate if one is not connected, I guess that one could be used for polling the presence of a connected sensor.

  • You can get HR without an external sensor at all (on devices with OHR).  In sensors, you don't even know if it's OHR or an external sensor, much less ANT or BLE.

    Consider this.  a Fenix broadcasting the OHR over ant to an edge device.  The edge just think's it's paired to an ant sensor.

  • Ok, just as a test I grabbed my HRM-RUN, and put a new battery in it so there would be no doubt that it had a good battery.

    With it paired to two watches, I went to Settings>Sensors&Accessories and allowed it to connect.  Then gave it a bit of time and checked "About" for the HRM-RUN.

    I get all kind of info, such as manufacturer, serial number etc, but in both cases, only "--" for the battery level (which I take to mean the info isn't available).

    So, long story short, you probably can't get the battery level of it no matter how you try.  The info isn't available.