mirror of
https://github.com/dvmarinoff/Auuki.git
synced 2026-02-17 23:47:39 +01:00
- Data class from FTMS control-point.js becomes Spec and is in ble/common.js
- StateValue from CSCS becomes State and is in ble/common.js
- refactoring power meter to use Speed and Cadence from CSCS
- adding tests for power meter
- adding very basic support for wahoo cycling power service
- add Wahoo advanced FTMS to ble filter add cycling power service to
optional services,
- add WahooCyclingPower service,
- add Wahoo Trainer control characteristic
- request control
- setting power target
NOTE: Wahoo Cycling power is untested at the moment
33 lines
728 B
JavaScript
33 lines
728 B
JavaScript
import { uuids } from '../../src/ble/uuids.js';
|
|
import { measurement, _ } from '../../src/ble/cps/cycling-power-measurement.js';
|
|
|
|
global.console = {
|
|
log: jest.fn(),
|
|
error: console.error,
|
|
warn: console.warn,
|
|
};
|
|
|
|
describe('index', () => {
|
|
|
|
test('flagsIndex', () => {
|
|
expect(_.flagsIndex()).toBe(0);
|
|
});
|
|
|
|
test('wheelRevolutionsIndex', () => {
|
|
expect(_.wheelRevolutionsIndex(48)).toBe(4);
|
|
});
|
|
|
|
test('wheelEventIndex', () => {
|
|
expect(_.wheelEventIndex(48)).toBe(8);
|
|
});
|
|
|
|
test('crankRevolutionsIndex', () => {
|
|
expect(_.crankRevolutionsIndex(48)).toBe(10);
|
|
});
|
|
|
|
test('crankEventIndex', () => {
|
|
expect(_.crankEventIndex(48)).toBe(12);
|
|
});
|
|
});
|
|
|