incyclist-devices 2.1.12 → 2.1.14
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 +0 -0
- package/lib/serial/base/comms.js +0 -0
- package/lib/serial/base/serial-interface.d.ts +0 -0
- package/lib/serial/base/serial-interface.js +2 -3
- 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 +0 -0
- package/lib/serial/bindings/tcp.js +0 -0
- package/lib/serial/daum/DaumAdapter.d.ts +0 -0
- package/lib/serial/daum/DaumAdapter.js +0 -0
- 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 +8 -2
- 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 +3 -1
- package/lib/serial/daum/classic/mock.js +27 -3
- 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 +0 -0
- package/lib/serial/daum/premium/comms.js +0 -0
- 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 +0 -0
- 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
|
|
File without changes
|
package/lib/serial/base/comms.js
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -208,8 +208,7 @@ class SerialInterface extends events_1.default {
|
|
|
208
208
|
if (attemptNo === 0)
|
|
209
209
|
this.logEvent({ message: 'checking for ports', interface: this.ifaceName, port, excludes: this.inUse });
|
|
210
210
|
else
|
|
211
|
-
|
|
212
|
-
attemptNo++;
|
|
211
|
+
attemptNo++;
|
|
213
212
|
try {
|
|
214
213
|
if (isTcpip) {
|
|
215
214
|
const _binding = binding;
|
|
@@ -223,7 +222,7 @@ class SerialInterface extends events_1.default {
|
|
|
223
222
|
this.logEvent({ message: 'error', fn: 'scan#detect ports', error: err.message, interface: this.ifaceName, port, excludes: this.inUse });
|
|
224
223
|
}
|
|
225
224
|
paths = paths.filter(p => !this.inUse.includes(p.path));
|
|
226
|
-
if (!paths || paths.length === 0) {
|
|
225
|
+
if ((!paths || paths.length === 0) && attemptNo === 1) {
|
|
227
226
|
this.logEvent({ message: 'scanning: no ports detected', interface: this.ifaceName, paths: paths.map(p => p.path), timeout });
|
|
228
227
|
yield (0, utils_1.sleep)(1000);
|
|
229
228
|
}
|
|
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
|
|
@@ -39,10 +39,16 @@ class Daum8008 extends comms_1.default {
|
|
|
39
39
|
const parser = this.portPipe(new ByteLength({ length: expected }));
|
|
40
40
|
if (!parser)
|
|
41
41
|
return;
|
|
42
|
-
|
|
42
|
+
const onDataHandler = (data) => {
|
|
43
|
+
if (data.length < expected) {
|
|
44
|
+
this.logEvent({ message: 'Partial response', data: Buffer.from(data).toString('hex') });
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
43
47
|
this.portUnpipe();
|
|
48
|
+
parser.off('data', onDataHandler);
|
|
44
49
|
this.recvState.data.enqueue({ type: 'Response', data });
|
|
45
|
-
}
|
|
50
|
+
};
|
|
51
|
+
parser.on('data', onDataHandler);
|
|
46
52
|
});
|
|
47
53
|
}
|
|
48
54
|
waitForResponse() {
|
|
File without changes
|
|
File without changes
|
|
@@ -66,12 +66,14 @@ export declare class DaumClassicSimulator {
|
|
|
66
66
|
_timeoutResponse: number;
|
|
67
67
|
_simulateNoReponseCnt: number;
|
|
68
68
|
_simulateIllegalResponseCnt: number;
|
|
69
|
+
_simulatePartialDelayed: number;
|
|
69
70
|
openHandles: Array<NodeJS.Timeout>;
|
|
70
71
|
constructor();
|
|
71
72
|
reset(): void;
|
|
72
73
|
simulateTimeout(ms: number): void;
|
|
73
74
|
simulateNoResponse(cnt?: number): void;
|
|
74
75
|
simulateIllegalResponse(cnt?: number): void;
|
|
76
|
+
simulatePartialDelayed(cnt?: number): void;
|
|
75
77
|
addHandle(handle: NodeJS.Timeout): void;
|
|
76
78
|
cleanup(): void;
|
|
77
79
|
isPedalling(): 0 | 1;
|
|
@@ -84,7 +86,7 @@ export declare class DaumClassicMockBinding extends MockPortBinding {
|
|
|
84
86
|
getPath(): string;
|
|
85
87
|
initHandlers(): void;
|
|
86
88
|
write(buffer: Buffer): Promise<void>;
|
|
87
|
-
emitData(data: string | Buffer): void
|
|
89
|
+
emitData(data: string | Buffer): Promise<void>;
|
|
88
90
|
onCheckCockpit(payload: Buffer): void;
|
|
89
91
|
onGetAddress(_payload: Buffer): void;
|
|
90
92
|
onGetVersion(payload: Buffer): void;
|
|
@@ -91,6 +91,7 @@ class DaumClassicSimulator {
|
|
|
91
91
|
this._timeoutResponse = 0;
|
|
92
92
|
this._simulateNoReponseCnt = 0;
|
|
93
93
|
this._simulateIllegalResponseCnt = 0;
|
|
94
|
+
this._simulatePartialDelayed = 0;
|
|
94
95
|
this.openHandles = [];
|
|
95
96
|
for (let i = 0; i < 10; i++)
|
|
96
97
|
this.bikes.push(Object.assign({}, DEFAULT_BIKE_DATA));
|
|
@@ -119,6 +120,9 @@ class DaumClassicSimulator {
|
|
|
119
120
|
simulateIllegalResponse(cnt = 1) {
|
|
120
121
|
this._simulateIllegalResponseCnt += cnt;
|
|
121
122
|
}
|
|
123
|
+
simulatePartialDelayed(cnt = 1) {
|
|
124
|
+
this._simulatePartialDelayed += cnt;
|
|
125
|
+
}
|
|
122
126
|
addHandle(handle) {
|
|
123
127
|
this.openHandles.push(handle);
|
|
124
128
|
}
|
|
@@ -202,9 +206,29 @@ class DaumClassicMockBinding extends binding_mock_1.MockPortBinding {
|
|
|
202
206
|
});
|
|
203
207
|
}
|
|
204
208
|
emitData(data) {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
209
|
+
const _super = Object.create(null, {
|
|
210
|
+
emitData: { get: () => super.emitData }
|
|
211
|
+
});
|
|
212
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
213
|
+
if (!this.isOpen || !this.port)
|
|
214
|
+
return;
|
|
215
|
+
if (this.simulator._simulatePartialDelayed > 0) {
|
|
216
|
+
this.simulator._simulatePartialDelayed--;
|
|
217
|
+
let buffer;
|
|
218
|
+
if (Buffer.isBuffer(data))
|
|
219
|
+
buffer = data;
|
|
220
|
+
else
|
|
221
|
+
buffer = Buffer.from(data);
|
|
222
|
+
const data1 = buffer.subarray(0, buffer.length - 1);
|
|
223
|
+
const data2 = buffer.subarray(buffer.length - 1, buffer.length);
|
|
224
|
+
_super.emitData.call(this, data1);
|
|
225
|
+
yield (0, utils_1.sleep)(10);
|
|
226
|
+
_super.emitData.call(this, data2);
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
_super.emitData.call(this, data);
|
|
230
|
+
}
|
|
231
|
+
});
|
|
208
232
|
}
|
|
209
233
|
onCheckCockpit(payload) {
|
|
210
234
|
const bikeNo = payload.readUInt8(0);
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
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
|
package/lib/utils/utils.d.ts
CHANGED
|
File without changes
|
package/lib/utils/utils.js
CHANGED
|
File without changes
|