I see start := halfHoursToTimeOfDay(n & 0x1F)
Since there are 48 half hours in a day, while n& 0x1f is limited to 31, we can not decode the entire day.
More, In my case, I have time = 21:00 which is 42 in half hours
42 & 0x 1f => A
So, A = 10 half hours is 05:00.
And indeed I'm getting the insulin sensitivities to start at 05:00 and not at 21:00.
Looking at the code here: https://github.com/ecc1/medtronic/blob/835e00374362905fc20f17ddeece0f924168b37f/sensitivities.go#L21
I see start := halfHoursToTimeOfDay(n & 0x1F) Since there are 48 half hours in a day, while n& 0x1f is limited to 31, we can not decode the entire day.
More, In my case, I have time = 21:00 which is 42 in half hours 42 & 0x 1f => A So, A = 10 half hours is 05:00. And indeed I'm getting the insulin sensitivities to start at 05:00 and not at 21:00.