Closed AAZANOVICH closed 8 months ago
A bitmask needs to be applied to this value to get the distribution, 0x7F
will give right side (if it's set, that can be checked by value % 0x80 != 0
).
174 % 0x7F
is 47. So that would be right 47% / left 53 %.
Ideally we should generate an IsSet
, RightValue
and LeftValue
for the LeftRightBalance type.
Thanks for clarification! Definitely dealing with binary values and masks is not very transparent.
@tormoder What about Altitude value in decoded Activity, fit.RecordMsg.Altitude = 3090 .. actual value 118m ???
@tormoder What about Altitude value in decoded Activity, fit.RecordMsg.Altitude = 3090 .. actual value 118m ???
@tormoder What about Altitude value in decoded Activity, fit.RecordMsg.Altitude = 3090 .. actual value 118m ???
It's a scaled field wih offset, (alt / 5) - 500.
See https://github.com/tormoder/fit/blob/52784557089cbcd87823f3d8002df1aba6e7f586/messages.go#L2652
@tormoder Got it, so basically Get*Scaled() functions should be used to access record values all the time, I'm I correct ?
@tormoder Got it, so basically Get*Scaled() functions should be used to access record values all the time, I'm I correct ?
Normally, yes.
I.e. RecordMsg.LeftRightBalance what does 174 value mean ? Real value is 46% left / 54% right.