Connect IQ on Vivoactive HR Bug ..

Former Member
Former Member
I have determined that there is a bug on the Vivoactive HR and Connect IQ SDK 1.28

The code that demonstrates it is below, and the line in question is bolded, as well as data below from running on the Vivoactive HR. I am running the latest firmware on the VAHR .. though my device does not show a version. I believe it is 2.40 though as Garmin Connect says it is current.

var hrh = Act.getHeartRateHistory(1, true); // Get Last HR value from HeartRateHistory

hrs = hrh.next(); //this gets to the first value

if(hrs.heartRate != Act.INVALID_HR_SAMPLE and hrs.heartRate > 0) // Make sure it is not INVALID and > 0
{
// ALWAYS DISPLAY LAST VALID HR Value to Screen
dc.drawText(67,129,Gfx.FONT_MEDIUM, hrs.heartRate.toString(), Gfx.TEXT_JUSTIFY_RIGHT);

var when=hrs.when; // this gets the timeStamp of the HR Reading
var infoHRS=Calendar.info(when, Time.FORMAT_SHORT);
var DayOfLastHR = infoHRS.day; // The DAY of the LastHR Value

}

The issue is that the infoHRS.day is returning the wrong day. It is ahead by one day in the VAHR device. I removed the error handling .. but this should be enough to see the issue.

Here is my debugging data from the VAHR device via System.println .. I started the device at 11:57 PM May 28th .. let it run until 12:05 AM May 29th.
Showing Timestamp (hour/min), TodaysDate (correct) and DayOfLastHR (incorrect).

TimeStamp(hour:min): 23:57
TodaysDate: 28
DayOfLastHRReading: 29
TimeStamp(hour:min): 23:58
TodaysDate: 28
DayOfLastHRReading: 29
TimeStamp(hour:min): 23:59
TodaysDate: 28
DayOfLastHRReading: 29
TimeStamp(hour:min): 0:0
TodaysDate: 29
DayOfLastHRReading: 29
TimeStamp(hour:min): 0:1
TodaysDate: 29
DayOfLastHRReading: 29
TimeStamp(hour:min): 0:2
TodaysDate: 29
DayOfLastHRReading: 30
TimeStamp(hour:min): 0:3
TodaysDate: 29
DayOfLastHRReading: 30
TimeStamp(hour:min): 0:4
TodaysDate: 29
DayOfLastHRReading: 30
TimeStamp(hour:min): 0:5
TodaysDate: 29
DayOfLastHRReading: 30

Thanks ..
Kevin