Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

You are here: Forum Home → ANT+ Forums → ANT+ Heart Rate Monitor → Thread

   

How to detect heart rate sensor battery status page in C#?

Rank

Total Posts: 5

Joined 2021-07-07

PM

I am using C# to write a simple Windows 10 desktop app to receive heart rate data from a Garmin chest belt. As example code I use what is provided in the application note "Using the SimulANT+ Library for Simulating ANT+ Devices in C#" which works great for displaying the heart rate. In particular, the second line below takes care of displaying the heart rate, which comes directly from the example code provided:
heartRateDisplay = new HeartRateDisplay(channel0networkAntPlus);
heartRateDisplay.HeartRateDataReceived += HeartRateDisplay_HeartRateDataReceived

I now want to analogously show the battery status of the sensor. According to the SimulANT+ documentation, there should be an event: HeartRateDisplay.BatteryStatusPageReceived. Unfortunately, visual studio does not show this event as option. In particular, the following does not work:
heartRateDisplay.BatteryStatusPageReceived += do_something

The above line is what I would consider to be the natural analogue of the first line, but it's not so, apparently. Does anyone know how to correctly detect the BatteryStatusPageReceived event? Ideally, how one can attach a function to be called when this event occurs?

For completeness: I already know that page 7 is the one that contains the battery status info, and I have checked that my belt does indeed send this page every so often! I just need to know how to capture the event that is triggered when this page gets send.      
RankRankRankRank

Total Posts: 370

Joined 2012-06-27

PM

Which version of SimulANT+ did you get ANT+ProfileLib.dll and .xml from? BatteryStatusPageReceived will be included in the latest 2.3.0 version.      

Signature

Ian Haigh

Rank

Total Posts: 5

Joined 2021-07-07

PM

Thanks Ian! That could solve it. I was using the libraries included in the application note. These are outdated, compared to the ones included in 2.3.0 SimulANT+. I will try with the latest versions, once I get out of the hospital...      
Rank

Total Posts: 5

Joined 2021-07-07

PM

Short follow up: Using the updated version, battery info works as expected.