fixes #57 where diagram would show spikes
This commit is contained in:
parent
b1aebef900
commit
6792ca77c1
|
|
@ -68,8 +68,11 @@ export default class RowerDataCharacteristic extends bleno.Characteristic {
|
||||||
// Total Distance in meters
|
// Total Distance in meters
|
||||||
bufferBuilder.writeUInt24LE(Math.round(data.distanceTotal))
|
bufferBuilder.writeUInt24LE(Math.round(data.distanceTotal))
|
||||||
// Instantaneous Pace in seconds/500m
|
// Instantaneous Pace in seconds/500m
|
||||||
// if split is infinite (i.e. while pausing), use the highest possible number
|
// if split is infinite (i.e. while pausing), should use the highest possible number (0xFFFF)
|
||||||
bufferBuilder.writeUInt16LE(data.split !== Infinity ? Math.round(data.split) : 0xFFFF)
|
// todo: eventhough mathematically correct, setting 0xFFFF (65535s) causes some ugly spikes
|
||||||
|
// in some applications which could shift the axis (i.e. workout diagrams in MyHomeFit)
|
||||||
|
// so instead for now we use 0 here
|
||||||
|
bufferBuilder.writeUInt16LE(data.split !== Infinity ? Math.round(data.split) : 0)
|
||||||
// Instantaneous Power in watts
|
// Instantaneous Power in watts
|
||||||
bufferBuilder.writeUInt16LE(Math.round(data.power))
|
bufferBuilder.writeUInt16LE(Math.round(data.power))
|
||||||
// Energy in kcal
|
// Energy in kcal
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue