mirror of
https://github.com/dvmarinoff/Auuki.git
synced 2026-02-17 23:47:39 +01:00
fix ant+ DataPage51 grade field min and max values
- they were set to 0 and 400, which are the values after offset of 200 is applied, - this resulted in grages encoding correctly only in the range 0,200, - they are now -200 and 200,
This commit is contained in:
@@ -171,7 +171,7 @@ function DataPage51(args = {}) {
|
||||
|
||||
const definitions = {
|
||||
grade: {
|
||||
resolution: 0.01, unit: '%', min: 0, max: 400, invalid: 0xFFFF, default: 0, offset: 200
|
||||
resolution: 0.01, unit: '%', min: -200, max: 200, invalid: 0xFFFF, default: 0, offset: 200
|
||||
},
|
||||
crr: {
|
||||
resolution: 0.00005, unit: '', min: 0, max: 0.0127, invalid: 0xFF, default: 0.004
|
||||
|
||||
@@ -137,6 +137,16 @@ describe('Data Page 51 - Track Resistance', () => {
|
||||
expect(dataviewToArray(msg)).toEqual([51, 0,0,0,0, 176,79, 80]);
|
||||
});
|
||||
|
||||
test('grade 200', () => {
|
||||
const msg = fec.dataPage51.encode({grade: 200});
|
||||
expect(dataviewToArray(msg)).toEqual([51, 0,0,0,0, 64,156, 80]);
|
||||
});
|
||||
|
||||
test('grade -200', () => {
|
||||
const msg = fec.dataPage51.encode({grade: -200});
|
||||
expect(dataviewToArray(msg)).toEqual([51, 0,0,0,0, 0,0, 80]);
|
||||
});
|
||||
|
||||
test('crr', () => {
|
||||
const msg = fec.dataPage51.encode({crr: 0.00321});
|
||||
expect(dataviewToArray(msg)).toEqual([51, 0,0,0,0, 32,78, 64]);
|
||||
|
||||
Reference in New Issue
Block a user