incyclist-devices 1.1.0 → 1.3.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/LICENSE +21 -0
  2. package/lib/CyclingMode.d.ts +72 -0
  3. package/lib/CyclingMode.js +66 -0
  4. package/lib/Device.d.ts +48 -10
  5. package/lib/Device.js +9 -8
  6. package/lib/DeviceProtocol.d.ts +40 -12
  7. package/lib/DeviceProtocol.js +16 -16
  8. package/lib/DeviceRegistry.d.ts +4 -4
  9. package/lib/DeviceRegistry.js +10 -10
  10. package/lib/DeviceSupport.d.ts +4 -3
  11. package/lib/DeviceSupport.js +32 -8
  12. package/lib/ant/AntAdapter.d.ts +11 -2
  13. package/lib/ant/AntAdapter.js +30 -1
  14. package/lib/ant/AntScanner.d.ts +17 -6
  15. package/lib/ant/AntScanner.js +406 -135
  16. package/lib/ant/antfe/AntFEAdapter.d.ts +12 -8
  17. package/lib/ant/antfe/AntFEAdapter.js +404 -182
  18. package/lib/ant/anthrm/AntHrmAdapter.d.ts +4 -2
  19. package/lib/ant/anthrm/AntHrmAdapter.js +72 -25
  20. package/lib/ant/utils.js +2 -1
  21. package/lib/calculations.d.ts +12 -13
  22. package/lib/calculations.js +88 -125
  23. package/lib/daum/DaumAdapter.d.ts +29 -6
  24. package/lib/daum/DaumAdapter.js +219 -96
  25. package/lib/daum/ERGCyclingMode.d.ts +28 -0
  26. package/lib/daum/ERGCyclingMode.js +207 -0
  27. package/lib/daum/PowerMeterCyclingMode.d.ts +18 -0
  28. package/lib/daum/PowerMeterCyclingMode.js +79 -0
  29. package/lib/daum/SmartTrainerCyclingMode.d.ts +41 -0
  30. package/lib/daum/SmartTrainerCyclingMode.js +344 -0
  31. package/lib/daum/classic/DaumClassicAdapter.d.ts +3 -1
  32. package/lib/daum/classic/DaumClassicAdapter.js +46 -32
  33. package/lib/daum/classic/DaumClassicCyclingMode.d.ts +13 -0
  34. package/lib/daum/classic/DaumClassicCyclingMode.js +98 -0
  35. package/lib/daum/classic/DaumClassicProtocol.d.ts +5 -3
  36. package/lib/daum/classic/DaumClassicProtocol.js +39 -6
  37. package/lib/daum/classic/ERGCyclingMode.d.ts +23 -0
  38. package/lib/daum/classic/ERGCyclingMode.js +171 -0
  39. package/lib/daum/classic/bike.d.ts +41 -37
  40. package/lib/daum/classic/bike.js +86 -53
  41. package/lib/daum/classic/utils.d.ts +3 -3
  42. package/lib/daum/classic/utils.js +16 -10
  43. package/lib/daum/indoorbike.d.ts +2 -1
  44. package/lib/daum/indoorbike.js +23 -21
  45. package/lib/daum/premium/DaumPremiumAdapter.d.ts +2 -2
  46. package/lib/daum/premium/DaumPremiumAdapter.js +30 -20
  47. package/lib/daum/premium/DaumPremiumProtocol.d.ts +11 -2
  48. package/lib/daum/premium/DaumPremiumProtocol.js +49 -8
  49. package/lib/daum/premium/bike.d.ts +63 -52
  50. package/lib/daum/premium/bike.js +258 -207
  51. package/lib/daum/premium/tcpserial.d.ts +18 -14
  52. package/lib/daum/premium/tcpserial.js +50 -20
  53. package/lib/daum/premium/utils.d.ts +2 -2
  54. package/lib/simulator/Simulator.d.ts +13 -7
  55. package/lib/simulator/Simulator.js +62 -21
  56. package/lib/utils.d.ts +3 -1
  57. package/lib/utils.js +39 -18
  58. package/package.json +12 -11
  59. package/lib/ant/AntScanner.unit.tests.d.ts +0 -1
  60. package/lib/ant/AntScanner.unit.tests.js +0 -25
  61. package/lib/ant/antfe/AntFEProcessor.d.ts +0 -40
  62. package/lib/ant/antfe/AntFEProcessor.js +0 -238
  63. package/lib/ant/antfe/AntHrmProtocol.d.ts +0 -9
  64. package/lib/ant/antfe/AntHrmProtocol.js +0 -30
  65. package/lib/ant/antfe/bike.d.ts +0 -47
  66. package/lib/ant/antfe/bike.js +0 -602
  67. package/lib/ant/anthrm/anthrm.d.ts +0 -33
  68. package/lib/ant/anthrm/anthrm.js +0 -523
  69. package/lib/simulator/Simulator.unit.tests.d.ts +0 -1
  70. package/lib/simulator/Simulator.unit.tests.js +0 -79
@@ -1,5 +1,5 @@
1
1
  import { EventLogger } from "gd-eventlog";
2
- import DeviceProtocol from "../DeviceProtocol";
2
+ import DeviceProtocolBase, { DeviceProtocol, DeviceSettings } from "../DeviceProtocol";
3
3
  import AntAdapter from "./AntAdapter";
4
4
  declare type ScanState = {
5
5
  isScanning: boolean;
@@ -11,21 +11,28 @@ declare type AntAdapterInfo = {
11
11
  name: string;
12
12
  Adapter: any;
13
13
  };
14
- export declare class AntProtocol extends DeviceProtocol {
14
+ interface AntDeviceSettings extends DeviceSettings {
15
+ deviceID: string;
16
+ profile: string;
17
+ }
18
+ export declare class AntProtocol extends DeviceProtocolBase implements DeviceProtocol {
15
19
  logger: EventLogger;
16
20
  ant: any;
17
21
  activeScans: Record<string, ScanState>;
18
22
  profiles: Array<AntAdapterInfo>;
19
23
  sensors: any;
20
24
  sticks: Array<any>;
25
+ scanning: boolean;
21
26
  constructor(antClass: any);
27
+ add(settings: AntDeviceSettings): any;
28
+ getAnt(): any;
22
29
  getName(): string;
23
- getInterfaces(): string;
30
+ getInterfaces(): Array<string>;
24
31
  isBike(): boolean;
25
32
  isHrm(): boolean;
26
33
  isPower(): boolean;
27
34
  isScanning(): boolean;
28
- getSupportedProfiles(): string[];
35
+ getSupportedProfiles(): Array<string>;
29
36
  getUSBDeviceInfo(d: any): {
30
37
  port: string;
31
38
  vendor: any;
@@ -35,14 +42,18 @@ export declare class AntProtocol extends DeviceProtocol {
35
42
  getStickInfo(sticks: any): any;
36
43
  findStickByPort(port: any): any;
37
44
  logStickInfo(): void;
38
- getStick(): any;
39
- getSticks(): Promise<Array<any>>;
45
+ getDetailedStickInfo(stick: any): void;
46
+ getStick(onStart: (stick: any) => void, onError: (reason: string) => void): Promise<any>;
47
+ getFirstStick(): Promise<any>;
40
48
  closeStick(stick: any): Promise<unknown>;
41
49
  stopScanOnStick(stickInfo: any): Promise<boolean>;
50
+ stillScanning(): boolean;
42
51
  scanOnStick(stickInfo: any, props?: any): Promise<unknown>;
43
52
  scan(props: any): Promise<void>;
44
53
  stopScan(): Promise<boolean>;
54
+ waitForStickOpenedForSensor(): Promise<unknown>;
45
55
  attachSensors(d: AntAdapter | Array<AntAdapter>, SensorClass: any, message: any): Promise<unknown>;
56
+ detachSensor(adapter: AntAdapter): Promise<unknown>;
46
57
  closeSensor(device: any): Promise<void>;
47
58
  }
48
59
  export declare function AntScanner(antClass: any): any;