incyclist-devices 2.1.11 → 2.1.13
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/LICENSE +0 -0
- package/README.MD +238 -238
- package/lib/antv2/base/adapter.d.ts +0 -0
- package/lib/antv2/base/adapter.js +0 -0
- package/lib/antv2/base/binding.d.ts +0 -0
- package/lib/antv2/base/binding.js +0 -0
- package/lib/antv2/base/interface.d.ts +0 -0
- package/lib/antv2/base/interface.js +0 -0
- package/lib/antv2/cad/adapter.d.ts +0 -0
- package/lib/antv2/cad/adapter.js +0 -0
- package/lib/antv2/cad/index.d.ts +0 -0
- package/lib/antv2/cad/index.js +0 -0
- package/lib/antv2/consts.d.ts +0 -0
- package/lib/antv2/consts.js +0 -0
- package/lib/antv2/factories/adapter-factory.d.ts +0 -0
- package/lib/antv2/factories/adapter-factory.js +0 -0
- package/lib/antv2/factories/sensor-factory.d.ts +0 -0
- package/lib/antv2/factories/sensor-factory.js +0 -0
- package/lib/antv2/fe/adapter.d.ts +0 -0
- package/lib/antv2/fe/adapter.js +0 -0
- package/lib/antv2/fe/index.d.ts +0 -0
- package/lib/antv2/fe/index.js +0 -0
- package/lib/antv2/hr/adapter.d.ts +0 -0
- package/lib/antv2/hr/adapter.js +0 -0
- package/lib/antv2/hr/index.d.ts +0 -0
- package/lib/antv2/hr/index.js +0 -0
- package/lib/antv2/index.d.ts +0 -0
- package/lib/antv2/index.js +0 -0
- package/lib/antv2/pwr/adapter.d.ts +0 -0
- package/lib/antv2/pwr/adapter.js +0 -0
- package/lib/antv2/pwr/index.d.ts +0 -0
- package/lib/antv2/pwr/index.js +0 -0
- package/lib/antv2/types.d.ts +0 -0
- package/lib/antv2/types.js +0 -0
- package/lib/antv2/utils.d.ts +0 -0
- package/lib/antv2/utils.js +0 -0
- package/lib/base/adpater.d.ts +0 -0
- package/lib/base/adpater.js +0 -0
- package/lib/base/consts.d.ts +0 -0
- package/lib/base/consts.js +0 -0
- package/lib/ble/adapter-factory.d.ts +0 -0
- package/lib/ble/adapter-factory.js +0 -0
- package/lib/ble/base/adapter.d.ts +0 -0
- package/lib/ble/base/adapter.js +0 -0
- package/lib/ble/base/comms-utils.d.ts +0 -0
- package/lib/ble/base/comms-utils.js +0 -0
- package/lib/ble/base/comms.d.ts +0 -0
- package/lib/ble/base/comms.js +0 -0
- package/lib/ble/base/types.d.ts +0 -0
- package/lib/ble/base/types.js +0 -0
- package/lib/ble/bindings/index.d.ts +0 -0
- package/lib/ble/bindings/index.js +0 -0
- package/lib/ble/bindings/linux.d.ts +0 -0
- package/lib/ble/bindings/linux.js +0 -0
- package/lib/ble/bindings/mock.d.ts +0 -0
- package/lib/ble/bindings/mock.js +0 -0
- package/lib/ble/bindings/types.d.ts +0 -0
- package/lib/ble/bindings/types.js +0 -0
- package/lib/ble/ble-interface.d.ts +0 -0
- package/lib/ble/ble-interface.js +0 -0
- package/lib/ble/ble-peripheral.d.ts +0 -0
- package/lib/ble/ble-peripheral.js +0 -0
- package/lib/ble/consts.d.ts +0 -0
- package/lib/ble/consts.js +0 -0
- package/lib/ble/cp/adapter.d.ts +0 -0
- package/lib/ble/cp/adapter.js +0 -0
- package/lib/ble/cp/comm.d.ts +0 -0
- package/lib/ble/cp/comm.js +0 -0
- package/lib/ble/cp/index.d.ts +0 -0
- package/lib/ble/cp/index.js +0 -0
- package/lib/ble/cp/types.d.ts +0 -0
- package/lib/ble/cp/types.js +0 -0
- package/lib/ble/elite/adapter.d.ts +0 -0
- package/lib/ble/elite/adapter.js +0 -0
- package/lib/ble/elite/comms.d.ts +0 -0
- package/lib/ble/elite/comms.js +0 -0
- package/lib/ble/elite/index.d.ts +0 -0
- package/lib/ble/elite/index.js +0 -0
- package/lib/ble/fm/adapter.d.ts +0 -0
- package/lib/ble/fm/adapter.js +0 -0
- package/lib/ble/fm/comms.d.ts +0 -0
- package/lib/ble/fm/comms.js +0 -0
- package/lib/ble/fm/consts.d.ts +0 -0
- package/lib/ble/fm/consts.js +0 -0
- package/lib/ble/fm/index.d.ts +0 -0
- package/lib/ble/fm/index.js +0 -0
- package/lib/ble/fm/types.d.ts +0 -0
- package/lib/ble/fm/types.js +0 -0
- package/lib/ble/hr/adapter.d.ts +0 -0
- package/lib/ble/hr/adapter.js +0 -0
- package/lib/ble/hr/comm.d.ts +0 -0
- package/lib/ble/hr/comm.js +0 -0
- package/lib/ble/hr/index.d.ts +0 -0
- package/lib/ble/hr/index.js +0 -0
- package/lib/ble/hr/mock.d.ts +0 -0
- package/lib/ble/hr/mock.js +0 -0
- package/lib/ble/hr/types.d.ts +0 -0
- package/lib/ble/hr/types.js +0 -0
- package/lib/ble/index.d.ts +0 -0
- package/lib/ble/index.js +0 -0
- package/lib/ble/peripheral-cache.d.ts +0 -0
- package/lib/ble/peripheral-cache.js +0 -0
- package/lib/ble/tacx/adapter.d.ts +0 -0
- package/lib/ble/tacx/adapter.js +0 -0
- package/lib/ble/tacx/comms.d.ts +0 -0
- package/lib/ble/tacx/comms.js +0 -0
- package/lib/ble/tacx/index.d.ts +0 -0
- package/lib/ble/tacx/index.js +0 -0
- package/lib/ble/tacx/types.d.ts +0 -0
- package/lib/ble/tacx/types.js +0 -0
- package/lib/ble/types.d.ts +0 -0
- package/lib/ble/types.js +0 -0
- package/lib/ble/utils.d.ts +0 -0
- package/lib/ble/utils.js +0 -0
- package/lib/ble/wahoo/adapter.d.ts +0 -0
- package/lib/ble/wahoo/adapter.js +0 -0
- package/lib/ble/wahoo/comms.d.ts +0 -0
- package/lib/ble/wahoo/comms.js +0 -0
- package/lib/ble/wahoo/index.d.ts +0 -0
- package/lib/ble/wahoo/index.js +0 -0
- package/lib/ble/wahoo/types.d.ts +0 -0
- package/lib/ble/wahoo/types.js +0 -0
- package/lib/factories/adapters.d.ts +0 -0
- package/lib/factories/adapters.js +0 -0
- package/lib/factories/index.d.ts +0 -0
- package/lib/factories/index.js +0 -0
- package/lib/factories/interfaces.d.ts +0 -0
- package/lib/factories/interfaces.js +0 -0
- package/lib/index.d.ts +0 -0
- package/lib/index.js +0 -0
- package/lib/modes/ant-fe-adv-st-mode.d.ts +0 -0
- package/lib/modes/ant-fe-adv-st-mode.js +0 -0
- package/lib/modes/antble-erg.d.ts +0 -0
- package/lib/modes/antble-erg.js +0 -0
- package/lib/modes/antble-smarttrainer.d.ts +0 -0
- package/lib/modes/antble-smarttrainer.js +0 -0
- package/lib/modes/base.d.ts +0 -0
- package/lib/modes/base.js +0 -0
- package/lib/modes/daum-classic-standard.d.ts +0 -0
- package/lib/modes/daum-classic-standard.js +0 -0
- package/lib/modes/daum-erg.d.ts +0 -0
- package/lib/modes/daum-erg.js +0 -0
- package/lib/modes/daum-power.d.ts +0 -0
- package/lib/modes/daum-power.js +0 -0
- package/lib/modes/daum-premium-standard.d.ts +0 -0
- package/lib/modes/daum-premium-standard.js +0 -0
- package/lib/modes/daum-smarttrainer.d.ts +0 -0
- package/lib/modes/daum-smarttrainer.js +0 -0
- package/lib/modes/kettler-erg.d.ts +0 -0
- package/lib/modes/kettler-erg.js +0 -0
- package/lib/modes/power-base.d.ts +0 -0
- package/lib/modes/power-base.js +0 -0
- package/lib/modes/power-meter.d.ts +0 -0
- package/lib/modes/power-meter.js +0 -0
- package/lib/modes/simulator.d.ts +0 -0
- package/lib/modes/simulator.js +0 -0
- package/lib/modes/types.d.ts +0 -0
- package/lib/modes/types.js +0 -0
- package/lib/serial/base/adapter.d.ts +0 -0
- package/lib/serial/base/adapter.js +0 -0
- package/lib/serial/base/comms.d.ts +2 -0
- package/lib/serial/base/comms.js +6 -0
- package/lib/serial/base/serial-interface.d.ts +0 -0
- package/lib/serial/base/serial-interface.js +0 -0
- package/lib/serial/base/serial-scanner.d.ts +0 -0
- package/lib/serial/base/serial-scanner.js +0 -0
- package/lib/serial/base/serialport.d.ts +0 -0
- package/lib/serial/base/serialport.js +0 -0
- package/lib/serial/bindings/tcp.d.ts +6 -0
- package/lib/serial/bindings/tcp.js +23 -5
- package/lib/serial/daum/DaumAdapter.d.ts +0 -0
- package/lib/serial/daum/DaumAdapter.js +10 -5
- package/lib/serial/daum/classic/adapter.d.ts +0 -0
- package/lib/serial/daum/classic/adapter.js +0 -0
- package/lib/serial/daum/classic/comms.d.ts +0 -0
- package/lib/serial/daum/classic/comms.js +0 -0
- package/lib/serial/daum/classic/consts.d.ts +0 -0
- package/lib/serial/daum/classic/consts.js +0 -0
- package/lib/serial/daum/classic/mock.d.ts +0 -0
- package/lib/serial/daum/classic/mock.js +0 -0
- package/lib/serial/daum/classic/types.d.ts +0 -0
- package/lib/serial/daum/classic/types.js +0 -0
- package/lib/serial/daum/classic/utils.d.ts +0 -0
- package/lib/serial/daum/classic/utils.js +0 -0
- package/lib/serial/daum/premium/adapter.d.ts +0 -0
- package/lib/serial/daum/premium/adapter.js +0 -0
- package/lib/serial/daum/premium/comms.d.ts +3 -0
- package/lib/serial/daum/premium/comms.js +11 -1
- package/lib/serial/daum/premium/consts.d.ts +0 -0
- package/lib/serial/daum/premium/consts.js +0 -0
- package/lib/serial/daum/premium/mock.d.ts +0 -0
- package/lib/serial/daum/premium/mock.js +0 -0
- package/lib/serial/daum/premium/types.d.ts +0 -0
- package/lib/serial/daum/premium/types.js +0 -0
- package/lib/serial/daum/premium/utils.d.ts +0 -0
- package/lib/serial/daum/premium/utils.js +0 -0
- package/lib/serial/daum/types.d.ts +2 -2
- package/lib/serial/daum/types.js +0 -0
- package/lib/serial/factories/adapter-factory.d.ts +0 -0
- package/lib/serial/factories/adapter-factory.js +0 -0
- package/lib/serial/index.d.ts +0 -0
- package/lib/serial/index.js +0 -0
- package/lib/serial/kettler/comms.d.ts +0 -0
- package/lib/serial/kettler/comms.js +0 -0
- package/lib/serial/kettler/ergo-racer/adapter.d.ts +1 -1
- package/lib/serial/kettler/ergo-racer/adapter.js +3 -2
- package/lib/serial/kettler/ergo-racer/mock.d.ts +0 -0
- package/lib/serial/kettler/ergo-racer/mock.js +0 -0
- package/lib/serial/kettler/types.d.ts +0 -0
- package/lib/serial/kettler/types.js +0 -0
- package/lib/serial/types.d.ts +0 -0
- package/lib/serial/types.js +0 -0
- package/lib/simulator/Simulator.d.ts +0 -0
- package/lib/simulator/Simulator.js +0 -0
- package/lib/types/adapter.d.ts +0 -0
- package/lib/types/adapter.js +0 -0
- package/lib/types/capabilities.d.ts +0 -0
- package/lib/types/capabilities.js +0 -0
- package/lib/types/data.d.ts +0 -0
- package/lib/types/data.js +0 -0
- package/lib/types/device.d.ts +0 -0
- package/lib/types/device.js +0 -0
- package/lib/types/index.d.ts +0 -0
- package/lib/types/index.js +0 -0
- package/lib/types/interface.d.ts +0 -0
- package/lib/types/interface.js +0 -0
- package/lib/types/user.d.ts +0 -0
- package/lib/types/user.js +0 -0
- package/lib/utils/calculations.d.ts +0 -0
- package/lib/utils/calculations.js +0 -0
- package/lib/utils/utils.d.ts +0 -0
- package/lib/utils/utils.js +0 -0
- package/package.json +51 -51
- package/lib/adapters.d.ts +0 -7
- package/lib/adapters.js +0 -49
- package/lib/antv2/adapter-factory.d.ts +0 -14
- package/lib/antv2/adapter-factory.js +0 -65
- package/lib/antv2/adapter.d.ts +0 -54
- package/lib/antv2/adapter.js +0 -291
- package/lib/antv2/ant-interface.d.ts +0 -35
- package/lib/antv2/ant-interface.js +0 -285
- package/lib/antv2/base/ant-interface.d.ts +0 -35
- package/lib/antv2/base/ant-interface.js +0 -285
- package/lib/antv2/binding.d.ts +0 -13
- package/lib/antv2/binding.js +0 -27
- package/lib/antv2/hr copy/adapter.d.ts +0 -11
- package/lib/antv2/hr copy/adapter.js +0 -30
- package/lib/antv2/hr copy/index.d.ts +0 -2
- package/lib/antv2/hr copy/index.js +0 -7
- package/lib/antv2/sensor-factory.d.ts +0 -5
- package/lib/antv2/sensor-factory.js +0 -20
- package/lib/interfaces.d.ts +0 -7
- package/lib/interfaces.js +0 -27
- package/lib/serial/SinglePathScanner.d.ts +0 -17
- package/lib/serial/SinglePathScanner.js +0 -87
- package/lib/serial/adapter-factory.d.ts +0 -14
- package/lib/serial/adapter-factory.js +0 -30
- package/lib/serial/adapter.d.ts +0 -17
- package/lib/serial/adapter.js +0 -67
- package/lib/serial/comm.d.ts +0 -7
- package/lib/serial/comm.js +0 -2
- package/lib/serial/comms.d.ts +0 -62
- package/lib/serial/comms.js +0 -280
- package/lib/serial/daum/classic/PROTOCOL_NAME.d.ts +0 -2
- package/lib/serial/daum/classic/PROTOCOL_NAME.js +0 -5
- package/lib/serial/daum/consts.d.ts +0 -0
- package/lib/serial/daum/consts.js +0 -0
- package/lib/serial/serial-interface.d.ts +0 -36
- package/lib/serial/serial-interface.js +0 -288
- package/lib/serial/serial-scanner.d.ts +0 -16
- package/lib/serial/serial-scanner.js +0 -87
- package/lib/serial/serialport.d.ts +0 -17
- package/lib/serial/serialport.js +0 -87
- package/lib/types/Command.d.ts +0 -8
- package/lib/types/Command.js +0 -2
- package/lib/types/command.d.ts +0 -0
- package/lib/types/command.js +0 -0
- package/lib/types/route.d.ts +0 -0
- package/lib/types/route.js +0 -0
- package/lib/types/types.d.ts +0 -8
- package/lib/types/types.js +0 -2
package/lib/ble/cp/index.d.ts
CHANGED
|
File without changes
|
package/lib/ble/cp/index.js
CHANGED
|
File without changes
|
package/lib/ble/cp/types.d.ts
CHANGED
|
File without changes
|
package/lib/ble/cp/types.js
CHANGED
|
File without changes
|
|
File without changes
|
package/lib/ble/elite/adapter.js
CHANGED
|
File without changes
|
package/lib/ble/elite/comms.d.ts
CHANGED
|
File without changes
|
package/lib/ble/elite/comms.js
CHANGED
|
File without changes
|
package/lib/ble/elite/index.d.ts
CHANGED
|
File without changes
|
package/lib/ble/elite/index.js
CHANGED
|
File without changes
|
package/lib/ble/fm/adapter.d.ts
CHANGED
|
File without changes
|
package/lib/ble/fm/adapter.js
CHANGED
|
File without changes
|
package/lib/ble/fm/comms.d.ts
CHANGED
|
File without changes
|
package/lib/ble/fm/comms.js
CHANGED
|
File without changes
|
package/lib/ble/fm/consts.d.ts
CHANGED
|
File without changes
|
package/lib/ble/fm/consts.js
CHANGED
|
File without changes
|
package/lib/ble/fm/index.d.ts
CHANGED
|
File without changes
|
package/lib/ble/fm/index.js
CHANGED
|
File without changes
|
package/lib/ble/fm/types.d.ts
CHANGED
|
File without changes
|
package/lib/ble/fm/types.js
CHANGED
|
File without changes
|
package/lib/ble/hr/adapter.d.ts
CHANGED
|
File without changes
|
package/lib/ble/hr/adapter.js
CHANGED
|
File without changes
|
package/lib/ble/hr/comm.d.ts
CHANGED
|
File without changes
|
package/lib/ble/hr/comm.js
CHANGED
|
File without changes
|
package/lib/ble/hr/index.d.ts
CHANGED
|
File without changes
|
package/lib/ble/hr/index.js
CHANGED
|
File without changes
|
package/lib/ble/hr/mock.d.ts
CHANGED
|
File without changes
|
package/lib/ble/hr/mock.js
CHANGED
|
File without changes
|
package/lib/ble/hr/types.d.ts
CHANGED
|
File without changes
|
package/lib/ble/hr/types.js
CHANGED
|
File without changes
|
package/lib/ble/index.d.ts
CHANGED
|
File without changes
|
package/lib/ble/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/ble/tacx/adapter.js
CHANGED
|
File without changes
|
package/lib/ble/tacx/comms.d.ts
CHANGED
|
File without changes
|
package/lib/ble/tacx/comms.js
CHANGED
|
File without changes
|
package/lib/ble/tacx/index.d.ts
CHANGED
|
File without changes
|
package/lib/ble/tacx/index.js
CHANGED
|
File without changes
|
package/lib/ble/tacx/types.d.ts
CHANGED
|
File without changes
|
package/lib/ble/tacx/types.js
CHANGED
|
File without changes
|
package/lib/ble/types.d.ts
CHANGED
|
File without changes
|
package/lib/ble/types.js
CHANGED
|
File without changes
|
package/lib/ble/utils.d.ts
CHANGED
|
File without changes
|
package/lib/ble/utils.js
CHANGED
|
File without changes
|
|
File without changes
|
package/lib/ble/wahoo/adapter.js
CHANGED
|
File without changes
|
package/lib/ble/wahoo/comms.d.ts
CHANGED
|
File without changes
|
package/lib/ble/wahoo/comms.js
CHANGED
|
File without changes
|
package/lib/ble/wahoo/index.d.ts
CHANGED
|
File without changes
|
package/lib/ble/wahoo/index.js
CHANGED
|
File without changes
|
package/lib/ble/wahoo/types.d.ts
CHANGED
|
File without changes
|
package/lib/ble/wahoo/types.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/factories/index.d.ts
CHANGED
|
File without changes
|
package/lib/factories/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/index.d.ts
CHANGED
|
File without changes
|
package/lib/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/modes/antble-erg.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/modes/base.d.ts
CHANGED
|
File without changes
|
package/lib/modes/base.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/modes/daum-erg.d.ts
CHANGED
|
File without changes
|
package/lib/modes/daum-erg.js
CHANGED
|
File without changes
|
|
File without changes
|
package/lib/modes/daum-power.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/modes/kettler-erg.js
CHANGED
|
File without changes
|
|
File without changes
|
package/lib/modes/power-base.js
CHANGED
|
File without changes
|
|
File without changes
|
package/lib/modes/power-meter.js
CHANGED
|
File without changes
|
package/lib/modes/simulator.d.ts
CHANGED
|
File without changes
|
package/lib/modes/simulator.js
CHANGED
|
File without changes
|
package/lib/modes/types.d.ts
CHANGED
|
File without changes
|
package/lib/modes/types.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -37,6 +37,8 @@ export default class SerialPortComms<T extends CommsState, C extends Request, R
|
|
|
37
37
|
isConnected(): boolean;
|
|
38
38
|
pauseLogging(): void;
|
|
39
39
|
resumeLogging(): void;
|
|
40
|
+
pause(): void;
|
|
41
|
+
resume(): void;
|
|
40
42
|
logEvent(e: any): void;
|
|
41
43
|
connect(): Promise<boolean>;
|
|
42
44
|
onConnected(): void;
|
package/lib/serial/base/comms.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -24,10 +24,16 @@ export declare class TCPPortBinding implements BindingPortInterface {
|
|
|
24
24
|
writeOperation: null | Promise<any>;
|
|
25
25
|
data: Buffer;
|
|
26
26
|
private pendingRead;
|
|
27
|
+
private onDataHandler;
|
|
28
|
+
private onErrorHandler;
|
|
29
|
+
private onTimeoutHandler;
|
|
30
|
+
private onCloseHandler;
|
|
27
31
|
constructor(socket: net.Socket, options: Required<OpenOptions>);
|
|
28
32
|
get isOpen(): boolean;
|
|
29
33
|
onData(data: Buffer): void;
|
|
30
34
|
onError(err: Error): void;
|
|
35
|
+
onTimeout(): void;
|
|
36
|
+
onClose(): void;
|
|
31
37
|
close(): Promise<void>;
|
|
32
38
|
read(buffer: Buffer, offset: number, length: number): Promise<{
|
|
33
39
|
buffer: Buffer;
|
|
@@ -141,6 +141,10 @@ exports.TCPBinding = {
|
|
|
141
141
|
};
|
|
142
142
|
class TCPPortBinding {
|
|
143
143
|
constructor(socket, options) {
|
|
144
|
+
this.onDataHandler = this.onData.bind(this);
|
|
145
|
+
this.onErrorHandler = this.onError.bind(this);
|
|
146
|
+
this.onTimeoutHandler = this.onTimeout.bind(this);
|
|
147
|
+
this.onCloseHandler = this.onClose.bind(this);
|
|
144
148
|
this.logger = new gd_eventlog_1.EventLogger('TCPPort');
|
|
145
149
|
this.socket = socket;
|
|
146
150
|
this.openOptions = options;
|
|
@@ -148,11 +152,11 @@ class TCPPortBinding {
|
|
|
148
152
|
this.writeOperation = null;
|
|
149
153
|
this.data = null;
|
|
150
154
|
this.socket.removeAllListeners();
|
|
151
|
-
this.socket.on('data', this.
|
|
152
|
-
this.socket.on('error', this.
|
|
153
|
-
this.socket.on('close',
|
|
154
|
-
this.socket.on('end',
|
|
155
|
-
this.socket.on('timeout',
|
|
155
|
+
this.socket.on('data', this.onDataHandler);
|
|
156
|
+
this.socket.on('error', this.onErrorHandler);
|
|
157
|
+
this.socket.on('close', this.onCloseHandler);
|
|
158
|
+
this.socket.on('end', this.onCloseHandler);
|
|
159
|
+
this.socket.on('timeout', this.onTimeoutHandler);
|
|
156
160
|
}
|
|
157
161
|
get isOpen() {
|
|
158
162
|
return this.socket !== null;
|
|
@@ -168,11 +172,21 @@ class TCPPortBinding {
|
|
|
168
172
|
}
|
|
169
173
|
}
|
|
170
174
|
onError(err) {
|
|
175
|
+
this.logger.logEvent({ message: 'Port Error', error: err.message });
|
|
171
176
|
if (this.pendingRead) {
|
|
172
177
|
this.pendingRead(err);
|
|
173
178
|
this.socket = null;
|
|
174
179
|
}
|
|
175
180
|
}
|
|
181
|
+
onTimeout() {
|
|
182
|
+
this.logger.logEvent({ message: 'Port Timeout' });
|
|
183
|
+
if (this.pendingRead) {
|
|
184
|
+
this.pendingRead(new Error('timeout'));
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
onClose() {
|
|
188
|
+
this.close();
|
|
189
|
+
}
|
|
176
190
|
close() {
|
|
177
191
|
return __awaiter(this, void 0, void 0, function* () {
|
|
178
192
|
if (!this.isOpen)
|
|
@@ -217,6 +231,10 @@ class TCPPortBinding {
|
|
|
217
231
|
return new Promise((resolve, reject) => {
|
|
218
232
|
this.pendingRead = err => {
|
|
219
233
|
if (err) {
|
|
234
|
+
if (err.message === 'timeout') {
|
|
235
|
+
resolve({ buffer: Buffer.from([]), bytesRead: 0 });
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
220
238
|
return reject(err);
|
|
221
239
|
}
|
|
222
240
|
this.read(buffer, offset, length).then(resolve, reject);
|
|
File without changes
|
|
@@ -117,7 +117,7 @@ class DaumAdapter extends adapter_1.SerialIncyclistDevice {
|
|
|
117
117
|
return __awaiter(this, void 0, void 0, function* () {
|
|
118
118
|
yield this.stopUpdatePull();
|
|
119
119
|
const paused = yield _super.pause.call(this);
|
|
120
|
-
(_a = this.comms) === null || _a === void 0 ? void 0 : _a.
|
|
120
|
+
(_a = this.comms) === null || _a === void 0 ? void 0 : _a.pause();
|
|
121
121
|
return paused;
|
|
122
122
|
});
|
|
123
123
|
}
|
|
@@ -128,7 +128,7 @@ class DaumAdapter extends adapter_1.SerialIncyclistDevice {
|
|
|
128
128
|
var _a;
|
|
129
129
|
return __awaiter(this, void 0, void 0, function* () {
|
|
130
130
|
const resumed = yield _super.resume.call(this);
|
|
131
|
-
(_a = this.comms) === null || _a === void 0 ? void 0 : _a.
|
|
131
|
+
(_a = this.comms) === null || _a === void 0 ? void 0 : _a.resume();
|
|
132
132
|
if (startUpdatePull)
|
|
133
133
|
yield this.startUpdatePull();
|
|
134
134
|
return resumed;
|
|
@@ -256,9 +256,14 @@ class DaumAdapter extends adapter_1.SerialIncyclistDevice {
|
|
|
256
256
|
});
|
|
257
257
|
}
|
|
258
258
|
cleanupInterval() {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
this.iv.
|
|
259
|
+
if (!this.iv)
|
|
260
|
+
return;
|
|
261
|
+
if (this.iv.sync)
|
|
262
|
+
clearInterval(this.iv.sync);
|
|
263
|
+
if (this.iv.sync)
|
|
264
|
+
clearInterval(this.iv.update);
|
|
265
|
+
if (this.iv.emitter)
|
|
266
|
+
this.iv.emitter.removeAllListeners();
|
|
262
267
|
this.iv = undefined;
|
|
263
268
|
}
|
|
264
269
|
stopUpdatePull() {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -5,6 +5,7 @@ import { DaumSerialComms } from "../types";
|
|
|
5
5
|
import { OnDeviceStartCallback, DaumPremiumCommsState, DaumPremiumRequest, ResponseObject, Route } from "./types";
|
|
6
6
|
import SerialPortComms from "../../base/comms";
|
|
7
7
|
export default class Daum8i extends SerialPortComms<DaumPremiumCommsState, DaumPremiumRequest, ResponseObject> implements DaumSerialComms {
|
|
8
|
+
private onDataHandler;
|
|
8
9
|
validatePath(path: string): string;
|
|
9
10
|
getDefaultLoggerName(): string;
|
|
10
11
|
getAckTimeoutValue(): number;
|
|
@@ -43,4 +44,6 @@ export default class Daum8i extends SerialPortComms<DaumPremiumCommsState, DaumP
|
|
|
43
44
|
programUploadDone(): Promise<boolean>;
|
|
44
45
|
startProgram(programId?: number): Promise<boolean>;
|
|
45
46
|
programUpload(bikeType: string, route: Route, onStatusUpdate?: OnDeviceStartCallback): Promise<boolean>;
|
|
47
|
+
pause(): void;
|
|
48
|
+
resume(): void;
|
|
46
49
|
}
|
|
@@ -20,6 +20,10 @@ const utils_2 = require("../../../utils/utils");
|
|
|
20
20
|
const comms_1 = __importDefault(require("../../base/comms"));
|
|
21
21
|
const consts_1 = require("./consts");
|
|
22
22
|
class Daum8i extends comms_1.default {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
this.onDataHandler = this.onData.bind(this);
|
|
26
|
+
}
|
|
23
27
|
validatePath(path) {
|
|
24
28
|
return (0, utils_1.validatePath)(path);
|
|
25
29
|
}
|
|
@@ -33,7 +37,7 @@ class Daum8i extends comms_1.default {
|
|
|
33
37
|
return consts_1.DEFAULT_TIMEOUT;
|
|
34
38
|
}
|
|
35
39
|
onConnected() {
|
|
36
|
-
this.sp.on('data', this.
|
|
40
|
+
this.sp.on('data', this.onDataHandler);
|
|
37
41
|
}
|
|
38
42
|
getInitialCommsState() {
|
|
39
43
|
const state = super.getInitialCommsState();
|
|
@@ -574,5 +578,11 @@ class Daum8i extends comms_1.default {
|
|
|
574
578
|
}
|
|
575
579
|
});
|
|
576
580
|
}
|
|
581
|
+
pause() {
|
|
582
|
+
super.pause();
|
|
583
|
+
}
|
|
584
|
+
resume() {
|
|
585
|
+
super.resume();
|
|
586
|
+
}
|
|
577
587
|
}
|
|
578
588
|
exports.default = Daum8i;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare abstract class DaumSerialComms {
|
|
2
2
|
serial: any;
|
|
3
3
|
abstract getPort(): string;
|
|
4
|
-
abstract
|
|
5
|
-
abstract
|
|
4
|
+
abstract pause(): void;
|
|
5
|
+
abstract resume(): void;
|
|
6
6
|
abstract isConnected(): boolean;
|
|
7
7
|
abstract connect(): Promise<boolean>;
|
|
8
8
|
abstract close(): Promise<boolean>;
|
package/lib/serial/daum/types.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/serial/index.d.ts
CHANGED
|
File without changes
|
package/lib/serial/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -31,7 +31,7 @@ export default class KettlerRacerAdapter extends SerialIncyclistDevice<DevicePro
|
|
|
31
31
|
private requestBusy;
|
|
32
32
|
private comms;
|
|
33
33
|
private prevDistance;
|
|
34
|
-
protected static
|
|
34
|
+
protected static controllers: ControllerConfig;
|
|
35
35
|
constructor(settings: SerialDeviceSettings, props?: DeviceProperties);
|
|
36
36
|
isBike(): boolean;
|
|
37
37
|
isPower(): boolean;
|
|
@@ -485,7 +485,8 @@ class KettlerRacerAdapter extends adapter_1.SerialIncyclistDevice {
|
|
|
485
485
|
});
|
|
486
486
|
}
|
|
487
487
|
refreshRequests() {
|
|
488
|
-
|
|
488
|
+
var _a;
|
|
489
|
+
if (((_a = this.kettlerData) === null || _a === void 0 ? void 0 : _a.cadence) === 0)
|
|
489
490
|
return;
|
|
490
491
|
let bikeRequest = this.getCyclingMode().sendBikeUpdate({ refresh: true }) || {};
|
|
491
492
|
const prev = this.requests[this.requests.length - 1] || {};
|
|
@@ -567,7 +568,7 @@ class KettlerRacerAdapter extends adapter_1.SerialIncyclistDevice {
|
|
|
567
568
|
});
|
|
568
569
|
}
|
|
569
570
|
}
|
|
570
|
-
KettlerRacerAdapter.
|
|
571
|
+
KettlerRacerAdapter.controllers = {
|
|
571
572
|
modes: [power_meter_1.default, kettler_erg_1.default],
|
|
572
573
|
default: kettler_erg_1.default
|
|
573
574
|
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/serial/types.d.ts
CHANGED
|
File without changes
|
package/lib/serial/types.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/types/adapter.d.ts
CHANGED
|
File without changes
|
package/lib/types/adapter.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/types/data.d.ts
CHANGED
|
File without changes
|
package/lib/types/data.js
CHANGED
|
File without changes
|
package/lib/types/device.d.ts
CHANGED
|
File without changes
|
package/lib/types/device.js
CHANGED
|
File without changes
|
package/lib/types/index.d.ts
CHANGED
|
File without changes
|
package/lib/types/index.js
CHANGED
|
File without changes
|
package/lib/types/interface.d.ts
CHANGED
|
File without changes
|
package/lib/types/interface.js
CHANGED
|
File without changes
|
package/lib/types/user.d.ts
CHANGED
|
File without changes
|
package/lib/types/user.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|