incyclist-devices 2.3.9 → 2.3.11
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.
- package/lib/ble/base/interface.d.ts +6 -3
- package/lib/ble/base/interface.js +83 -48
- package/lib/ble/fm/adapter.d.ts +2 -1
- package/lib/ble/fm/adapter.js +27 -9
- package/lib/ble/fm/sensor.js +9 -2
- package/lib/ble/wahoo/sensor.d.ts +1 -0
- package/lib/ble/wahoo/sensor.js +18 -0
- package/package.json +1 -1
- package/lib/ble/adapter-factory.d.ts +0 -34
- package/lib/ble/adapter-factory.js +0 -110
- package/lib/ble/base/comms-utils.d.ts +0 -7
- package/lib/ble/base/comms-utils.js +0 -90
- package/lib/ble/base/comms.d.ts +0 -75
- package/lib/ble/base/comms.js +0 -599
- package/lib/ble/ble-interface.d.ts +0 -84
- package/lib/ble/ble-interface.js +0 -622
- package/lib/ble/ble-peripheral.d.ts +0 -39
- package/lib/ble/ble-peripheral.js +0 -252
- package/lib/ble/cp/comm.d.ts +0 -30
- package/lib/ble/cp/comm.js +0 -126
- package/lib/ble/elite/adapter.d.ts +0 -21
- package/lib/ble/elite/adapter.js +0 -118
- package/lib/ble/elite/comms.d.ts +0 -31
- package/lib/ble/elite/comms.js +0 -127
- package/lib/ble/elite/index.d.ts +0 -3
- package/lib/ble/elite/index.js +0 -10
- package/lib/ble/fm/comms.d.ts +0 -49
- package/lib/ble/fm/comms.js +0 -506
- package/lib/ble/hr/comm.d.ts +0 -19
- package/lib/ble/hr/comm.js +0 -65
- package/lib/ble/peripheral-cache.d.ts +0 -45
- package/lib/ble/peripheral-cache.js +0 -109
- package/lib/ble/tacx/comms.d.ts +0 -59
- package/lib/ble/tacx/comms.js +0 -634
- package/lib/ble/wahoo/comms.d.ts +0 -64
- package/lib/ble/wahoo/comms.js +0 -399
- package/lib/direct-connect/base/comms.d.ts +0 -3
- package/lib/direct-connect/base/comms.js +0 -7
- package/lib/direct-connect/base/sensor.d.ts +0 -3
- package/lib/direct-connect/base/sensor.js +0 -7
- package/lib/direct-connect/utils.d.ts +0 -5
- package/lib/direct-connect/utils.js +0 -73
- package/lib/factories/index.d.ts +0 -3
- package/lib/factories/index.js +0 -10
- package/lib/utils/operation.d.ts +0 -17
- package/lib/utils/operation.js +0 -20
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { EventLogger } from 'gd-eventlog';
|
|
2
|
-
import BleAdapterFactory from './adapter-factory';
|
|
3
|
-
import { BleInterfaceProps, BlePeripheral, BleDeviceSettings, BleProtocol, BleBinding, BleInterfaceState, BleScanProps, BleCharacteristic } from './types';
|
|
4
|
-
import { BleComms } from './base/comms';
|
|
5
|
-
import { IncyclistInterface, IncyclistScanProps } from '../types';
|
|
6
|
-
import BlePeripheralCache from './peripheral-cache';
|
|
7
|
-
import EventEmitter from 'events';
|
|
8
|
-
export interface ScanState {
|
|
9
|
-
isScanning: boolean;
|
|
10
|
-
isConnecting: boolean;
|
|
11
|
-
isBackgroundScan: boolean;
|
|
12
|
-
timeout?: NodeJS.Timeout;
|
|
13
|
-
peripherals?: Map<string, BlePeripheral>;
|
|
14
|
-
detected?: string[];
|
|
15
|
-
emitter?: EventEmitter;
|
|
16
|
-
}
|
|
17
|
-
export interface ConnectState {
|
|
18
|
-
isConnecting: boolean;
|
|
19
|
-
isConnected: boolean;
|
|
20
|
-
timeout?: NodeJS.Timeout;
|
|
21
|
-
isInitSuccess: boolean;
|
|
22
|
-
connectPromise?: Promise<boolean>;
|
|
23
|
-
}
|
|
24
|
-
export interface BleDeviceInfo {
|
|
25
|
-
device: BleComms;
|
|
26
|
-
isConnected: boolean;
|
|
27
|
-
}
|
|
28
|
-
export interface BleDeviceClassInfo {
|
|
29
|
-
Class: typeof BleComms;
|
|
30
|
-
type: string;
|
|
31
|
-
services: string[];
|
|
32
|
-
id: string;
|
|
33
|
-
}
|
|
34
|
-
export default class BleInterface extends EventEmitter implements IncyclistInterface {
|
|
35
|
-
scanState: ScanState;
|
|
36
|
-
connectState: ConnectState;
|
|
37
|
-
peripheralCache: BlePeripheralCache;
|
|
38
|
-
logger: EventLogger;
|
|
39
|
-
props: BleInterfaceProps;
|
|
40
|
-
binding: BleBinding;
|
|
41
|
-
sensorIsConnecting: boolean;
|
|
42
|
-
emittingAdapters: {
|
|
43
|
-
comms: BleComms;
|
|
44
|
-
cb: (data: any) => void;
|
|
45
|
-
}[];
|
|
46
|
-
loggingPaused: boolean;
|
|
47
|
-
static _instance: BleInterface;
|
|
48
|
-
static getInstance(props?: {
|
|
49
|
-
binding?: BleBinding;
|
|
50
|
-
log?: boolean;
|
|
51
|
-
logger?: EventLogger;
|
|
52
|
-
}): BleInterface;
|
|
53
|
-
constructor(props?: BleInterfaceProps);
|
|
54
|
-
getBinding(): BleBinding;
|
|
55
|
-
setBinding(binding: BleBinding): void;
|
|
56
|
-
getName(): string;
|
|
57
|
-
protected getReconnectPause(): number;
|
|
58
|
-
startConnectSensor(): void;
|
|
59
|
-
stopConnectSensor(): void;
|
|
60
|
-
waitForSensorConnectionFinish(): Promise<void>;
|
|
61
|
-
getAdapterFactory(): BleAdapterFactory;
|
|
62
|
-
pauseLogging(debugOnly?: boolean): void;
|
|
63
|
-
resumeLogging(): void;
|
|
64
|
-
protected isDebugEnabled(): boolean;
|
|
65
|
-
protected logEvent(event: any): void;
|
|
66
|
-
protected onStateChange(state: BleInterfaceState): void;
|
|
67
|
-
protected onError(err: any): void;
|
|
68
|
-
connect(to?: number): Promise<boolean>;
|
|
69
|
-
disconnect(): Promise<boolean>;
|
|
70
|
-
isConnected(): boolean;
|
|
71
|
-
onDisconnect(peripheral: any): void;
|
|
72
|
-
protected scannerWaitForConnection(tsTimeoutExpired?: number): Promise<void>;
|
|
73
|
-
protected getCharacteristics(peripheral: BlePeripheral): Promise<BleCharacteristic[]>;
|
|
74
|
-
protected waitForScanFinished(timeout: any): Promise<unknown>;
|
|
75
|
-
protected onPeripheralFound(p: BlePeripheral, callback: any, props?: {
|
|
76
|
-
request?: BleDeviceSettings;
|
|
77
|
-
comms?: BleComms;
|
|
78
|
-
protocolFilter?: BleProtocol[] | null;
|
|
79
|
-
}): Promise<any>;
|
|
80
|
-
scanForDevice(comms: BleComms, props: IncyclistScanProps): Promise<BlePeripheral>;
|
|
81
|
-
scan(props?: BleScanProps): Promise<BleDeviceSettings[]>;
|
|
82
|
-
stopScan(): Promise<boolean>;
|
|
83
|
-
isScanning(): boolean;
|
|
84
|
-
}
|