incyclist-devices 2.2.9 → 2.3.0

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 (142) hide show
  1. package/lib/antv2/base/interface.js +2 -2
  2. package/lib/antv2/factories/index.d.ts +1 -0
  3. package/lib/antv2/factories/index.js +17 -0
  4. package/lib/antv2/fe/adapter.js +5 -4
  5. package/lib/antv2/index.d.ts +1 -0
  6. package/lib/antv2/index.js +12 -8
  7. package/lib/base/adpater.js +1 -1
  8. package/lib/ble/adapter-factory.d.ts +20 -24
  9. package/lib/ble/adapter-factory.js +13 -36
  10. package/lib/ble/base/adapter.d.ts +16 -5
  11. package/lib/ble/base/adapter.js +169 -52
  12. package/lib/ble/base/comms.d.ts +2 -74
  13. package/lib/ble/base/comms.js +3 -596
  14. package/lib/ble/base/interface.d.ts +96 -0
  15. package/lib/ble/base/interface.js +544 -0
  16. package/lib/ble/base/peripheral.d.ts +34 -0
  17. package/lib/ble/base/peripheral.js +286 -0
  18. package/lib/ble/base/sensor.d.ts +31 -0
  19. package/lib/ble/base/sensor.js +130 -0
  20. package/lib/ble/base/types.d.ts +7 -0
  21. package/lib/ble/base/types.js +7 -0
  22. package/lib/ble/bindings/mock.js +6 -0
  23. package/lib/ble/bindings/types.d.ts +3 -4
  24. package/lib/ble/ble-interface.d.ts +7 -4
  25. package/lib/ble/ble-interface.js +16 -2
  26. package/lib/ble/ble-peripheral.d.ts +1 -0
  27. package/lib/ble/ble-peripheral.js +7 -11
  28. package/lib/ble/consts.d.ts +0 -6
  29. package/lib/ble/consts.js +1 -7
  30. package/lib/ble/cp/adapter.d.ts +3 -3
  31. package/lib/ble/cp/adapter.js +12 -13
  32. package/lib/ble/cp/comm.d.ts +1 -1
  33. package/lib/ble/cp/comm.js +2 -2
  34. package/lib/ble/cp/index.d.ts +1 -1
  35. package/lib/ble/cp/index.js +2 -2
  36. package/lib/ble/cp/sensor.d.ts +27 -0
  37. package/lib/ble/cp/sensor.js +107 -0
  38. package/lib/ble/elite/comms.d.ts +1 -1
  39. package/lib/ble/elite/comms.js +2 -2
  40. package/lib/ble/factories/adapter-factory.d.ts +32 -0
  41. package/lib/ble/factories/adapter-factory.js +104 -0
  42. package/lib/ble/factories/index.d.ts +2 -0
  43. package/lib/ble/factories/index.js +18 -0
  44. package/lib/ble/factories/interface-factory.d.ts +7 -0
  45. package/lib/ble/factories/interface-factory.js +18 -0
  46. package/lib/ble/fm/adapter.d.ts +9 -4
  47. package/lib/ble/fm/adapter.js +104 -108
  48. package/lib/ble/fm/comms.d.ts +1 -1
  49. package/lib/ble/fm/comms.js +3 -3
  50. package/lib/ble/fm/consts.d.ts +93 -0
  51. package/lib/ble/fm/consts.js +55 -1
  52. package/lib/ble/fm/index.d.ts +1 -1
  53. package/lib/ble/fm/index.js +2 -2
  54. package/lib/ble/fm/sensor.d.ts +44 -0
  55. package/lib/ble/fm/sensor.js +384 -0
  56. package/lib/ble/hr/adapter.d.ts +3 -3
  57. package/lib/ble/hr/adapter.js +5 -8
  58. package/lib/ble/hr/comm.d.ts +1 -1
  59. package/lib/ble/hr/comm.js +2 -2
  60. package/lib/ble/hr/index.d.ts +1 -1
  61. package/lib/ble/hr/index.js +2 -2
  62. package/lib/ble/hr/sensor.d.ts +17 -0
  63. package/lib/ble/hr/sensor.js +52 -0
  64. package/lib/ble/index.d.ts +4 -3
  65. package/lib/ble/index.js +29 -13
  66. package/lib/ble/tacx/adapter.d.ts +4 -2
  67. package/lib/ble/tacx/adapter.js +26 -66
  68. package/lib/ble/tacx/comms.d.ts +1 -1
  69. package/lib/ble/tacx/comms.js +2 -2
  70. package/lib/ble/tacx/consts.d.ts +23 -0
  71. package/lib/ble/tacx/consts.js +27 -0
  72. package/lib/ble/tacx/index.d.ts +1 -1
  73. package/lib/ble/tacx/index.js +2 -2
  74. package/lib/ble/tacx/sensor.d.ts +63 -0
  75. package/lib/ble/tacx/sensor.js +596 -0
  76. package/lib/ble/types.d.ts +81 -52
  77. package/lib/ble/utils.d.ts +7 -2
  78. package/lib/ble/utils.js +84 -9
  79. package/lib/ble/wahoo/adapter.d.ts +2 -2
  80. package/lib/ble/wahoo/adapter.js +4 -72
  81. package/lib/ble/wahoo/comms.d.ts +1 -1
  82. package/lib/ble/wahoo/comms.js +2 -2
  83. package/lib/ble/wahoo/consts.d.ts +16 -0
  84. package/lib/ble/wahoo/consts.js +7 -0
  85. package/lib/ble/wahoo/index.d.ts +1 -1
  86. package/lib/ble/wahoo/index.js +2 -2
  87. package/lib/ble/wahoo/sensor.d.ts +48 -0
  88. package/lib/ble/wahoo/sensor.js +356 -0
  89. package/lib/direct-connect/base/comms.d.ts +3 -0
  90. package/lib/direct-connect/base/comms.js +7 -0
  91. package/lib/direct-connect/base/interface.d.ts +75 -0
  92. package/lib/direct-connect/base/interface.js +306 -0
  93. package/lib/direct-connect/base/peripheral.d.ts +50 -0
  94. package/lib/direct-connect/base/peripheral.js +413 -0
  95. package/lib/direct-connect/base/sensor.d.ts +3 -0
  96. package/lib/direct-connect/base/sensor.js +7 -0
  97. package/lib/direct-connect/bindings/index.d.ts +1 -0
  98. package/lib/direct-connect/bindings/index.js +17 -0
  99. package/lib/direct-connect/bindings/types.d.ts +36 -0
  100. package/lib/direct-connect/bindings/types.js +2 -0
  101. package/lib/direct-connect/consts.d.ts +17 -0
  102. package/lib/direct-connect/consts.js +20 -0
  103. package/lib/direct-connect/index.d.ts +3 -0
  104. package/lib/direct-connect/index.js +22 -0
  105. package/lib/direct-connect/messages/CharacteristicNotification.d.ts +12 -0
  106. package/lib/direct-connect/messages/CharacteristicNotification.js +23 -0
  107. package/lib/direct-connect/messages/DiscoverCharacteristics.d.ts +22 -0
  108. package/lib/direct-connect/messages/DiscoverCharacteristics.js +43 -0
  109. package/lib/direct-connect/messages/DiscoverServices.d.ts +15 -0
  110. package/lib/direct-connect/messages/DiscoverServices.js +33 -0
  111. package/lib/direct-connect/messages/EnableCharacteristicNotifications.d.ts +18 -0
  112. package/lib/direct-connect/messages/EnableCharacteristicNotifications.js +35 -0
  113. package/lib/direct-connect/messages/ReadCharacteristic.d.ts +18 -0
  114. package/lib/direct-connect/messages/ReadCharacteristic.js +34 -0
  115. package/lib/direct-connect/messages/WriteCharacteristic.d.ts +18 -0
  116. package/lib/direct-connect/messages/WriteCharacteristic.js +36 -0
  117. package/lib/direct-connect/messages/error.d.ts +5 -0
  118. package/lib/direct-connect/messages/error.js +18 -0
  119. package/lib/direct-connect/messages/factory.d.ts +6 -0
  120. package/lib/direct-connect/messages/factory.js +44 -0
  121. package/lib/direct-connect/messages/index.d.ts +9 -0
  122. package/lib/direct-connect/messages/index.js +25 -0
  123. package/lib/direct-connect/messages/message.d.ts +20 -0
  124. package/lib/direct-connect/messages/message.js +90 -0
  125. package/lib/direct-connect/types.d.ts +24 -0
  126. package/lib/direct-connect/types.js +9 -0
  127. package/lib/direct-connect/utils.d.ts +5 -0
  128. package/lib/direct-connect/utils.js +73 -0
  129. package/lib/factories/adapters.js +16 -4
  130. package/lib/factories/interfaces.d.ts +2 -1
  131. package/lib/factories/interfaces.js +10 -7
  132. package/lib/index.d.ts +5 -4
  133. package/lib/index.js +6 -2
  134. package/lib/serial/bindings/tcp.d.ts +5 -4
  135. package/lib/serial/bindings/tcp.js +16 -23
  136. package/lib/types/device.d.ts +2 -1
  137. package/lib/types/device.js +1 -0
  138. package/lib/utils/operation.d.ts +17 -0
  139. package/lib/utils/operation.js +20 -0
  140. package/lib/utils/task.d.ts +44 -0
  141. package/lib/utils/task.js +127 -0
  142. package/package.json +3 -1
@@ -0,0 +1,306 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.DirectConnectInterfaceFactory = void 0;
16
+ const events_1 = __importDefault(require("events"));
17
+ const gd_eventlog_1 = require("gd-eventlog");
18
+ const task_1 = require("../../utils/task");
19
+ const peripheral_1 = require("./peripheral");
20
+ const ble_1 = require("../../ble");
21
+ const types_1 = require("../../ble/base/types");
22
+ const DC_TYPE = 'wahoo-fitness-tnp';
23
+ const DC_EXPIRATION_TIMEOUT = 10 * 1000 * 60;
24
+ let instanceId = 0;
25
+ class DirectConnectInterface extends events_1.default {
26
+ static getInstance(props = {}) {
27
+ if (DirectConnectInterface._instance === undefined)
28
+ DirectConnectInterface._instance = new DirectConnectInterface(props);
29
+ else {
30
+ if (props.binding) {
31
+ DirectConnectInterface._instance.setBinding(props.binding);
32
+ }
33
+ if (props.logger) {
34
+ DirectConnectInterface._instance.logger = props.logger;
35
+ }
36
+ if (props.log && !DirectConnectInterface._instance.logger) {
37
+ DirectConnectInterface._instance.logger = new gd_eventlog_1.EventLogger('DirectConnect');
38
+ }
39
+ }
40
+ return DirectConnectInterface._instance;
41
+ }
42
+ constructor(props) {
43
+ var _a;
44
+ super();
45
+ this.services = [];
46
+ this.matching = [];
47
+ this.connected = false;
48
+ this.props = props;
49
+ this.logEnabled = props.log || true;
50
+ const { binding } = props;
51
+ this.setLogger((_a = props.logger) !== null && _a !== void 0 ? _a : new gd_eventlog_1.EventLogger('DirectConnect'));
52
+ if (binding) {
53
+ this.setBinding(binding);
54
+ }
55
+ this.internalEvents = new events_1.default();
56
+ this.instance = ++instanceId;
57
+ if (this.binding)
58
+ this.autoConnect();
59
+ }
60
+ createPeripheral(announcement) {
61
+ return peripheral_1.DirectConnectPeripheral.create(announcement);
62
+ }
63
+ createDeviceSetting(service) {
64
+ const name = service.name;
65
+ const protocol = this.getProtocol(service);
66
+ return { interface: DirectConnectInterface.INTERFACE_NAME, name, protocol };
67
+ }
68
+ createPeripheralFromSettings(settings) {
69
+ const info = this.getAll().find(a => a.service.name === settings.name);
70
+ if (!(info === null || info === void 0 ? void 0 : info.service))
71
+ return null;
72
+ return this.createPeripheral(info.service);
73
+ }
74
+ getLogger() {
75
+ return this.logger;
76
+ }
77
+ setLogger(logger) {
78
+ this.logger = logger;
79
+ }
80
+ getName() {
81
+ return DirectConnectInterface.INTERFACE_NAME;
82
+ }
83
+ setBinding(binding) {
84
+ const prev = this.binding;
85
+ this.binding = binding;
86
+ if (!prev)
87
+ this.autoConnect();
88
+ }
89
+ getBinding() {
90
+ return this.binding;
91
+ }
92
+ autoConnect() {
93
+ this.connect();
94
+ }
95
+ connect(reconnect) {
96
+ return __awaiter(this, void 0, void 0, function* () {
97
+ var _a;
98
+ if (this.connected) {
99
+ return true;
100
+ }
101
+ try {
102
+ if (!((_a = this.getBinding()) === null || _a === void 0 ? void 0 : _a.mdns)) {
103
+ this.logEvent({ message: 'Direct Connect not available' });
104
+ return false;
105
+ }
106
+ this.logEvent({ message: 'connecting to Direct Connect' });
107
+ this.getBinding().mdns.connect();
108
+ if (!reconnect)
109
+ this.logEvent({ message: 'starting multicast DNS scan ..' });
110
+ this.getBinding().mdns.find({ type: DC_TYPE }, (service) => {
111
+ this.addService(service);
112
+ });
113
+ }
114
+ catch (err) {
115
+ this.logError(err, 'connect');
116
+ return false;
117
+ }
118
+ this.connected = true;
119
+ return true;
120
+ });
121
+ }
122
+ disconnect() {
123
+ return __awaiter(this, void 0, void 0, function* () {
124
+ var _a, _b;
125
+ if (!this.isConnected())
126
+ return true;
127
+ this.logEvent({ message: 'Disconnecting from Direct Connect' });
128
+ yield this.stopScan();
129
+ (_b = (_a = this.getBinding()) === null || _a === void 0 ? void 0 : _a.mdns) === null || _b === void 0 ? void 0 : _b.disconnect();
130
+ this.internalEvents.removeAllListeners();
131
+ this.connected = false;
132
+ return !this.isConnected();
133
+ });
134
+ }
135
+ isConnected() {
136
+ var _a;
137
+ return this.connected && ((_a = this.getBinding()) === null || _a === void 0 ? void 0 : _a.mdns) !== undefined && this.binding.mdns !== null;
138
+ }
139
+ scan(props) {
140
+ return __awaiter(this, void 0, void 0, function* () {
141
+ this.logDisabled = false;
142
+ if (this.isScanning()) {
143
+ this.logEvent({ message: 'starting scan - already scanning' });
144
+ yield this.scanTask.getPromise();
145
+ }
146
+ this.logEvent({ message: 'starting scan ..' });
147
+ yield this.reconnect();
148
+ this.scanTask = new task_1.InteruptableTask(this.startScan(), {
149
+ timeout: props.timeout,
150
+ state: { matching: [] },
151
+ name: 'scan',
152
+ errorOnTimeout: false,
153
+ log: this.logEvent.bind(this),
154
+ onDone: this.onScanDone.bind(this)
155
+ });
156
+ return this.scanTask.run();
157
+ });
158
+ }
159
+ stopScan() {
160
+ return __awaiter(this, void 0, void 0, function* () {
161
+ if (!this.isScanning())
162
+ return Promise.resolve(true);
163
+ this.logEvent({ message: 'stopping scan ...' });
164
+ const res = yield this.scanTask.stop();
165
+ delete this.scanTask;
166
+ return res;
167
+ });
168
+ }
169
+ onScanDone() {
170
+ this.logEvent({ message: 'scan stopped' });
171
+ return this.buildDeviceSettings(this.matching);
172
+ }
173
+ pauseLogging() {
174
+ this.logDisabled = true;
175
+ }
176
+ resumeLogging() {
177
+ this.logDisabled = false;
178
+ }
179
+ isLoggingPaused() {
180
+ return this.logDisabled;
181
+ }
182
+ waitForPeripheral(settings) {
183
+ const peripheral = this.createPeripheralFromSettings(settings);
184
+ if (peripheral)
185
+ return Promise.resolve(peripheral);
186
+ return new Promise((done) => {
187
+ const onDevice = (device) => {
188
+ if (device.name === settings.name) {
189
+ const peripheral = this.createPeripheralFromSettings(settings);
190
+ if (peripheral) {
191
+ this.off('device', onDevice);
192
+ done(peripheral);
193
+ }
194
+ }
195
+ };
196
+ this.on('device', onDevice);
197
+ });
198
+ }
199
+ reconnect() {
200
+ return __awaiter(this, void 0, void 0, function* () {
201
+ yield this.disconnect();
202
+ yield this.connect(true);
203
+ });
204
+ }
205
+ isScanning() {
206
+ var _a;
207
+ return (_a = this.scanTask) === null || _a === void 0 ? void 0 : _a.isRunning();
208
+ }
209
+ startScan() {
210
+ this.logEvent({ message: 'scan started', success: this.isScanning() });
211
+ this.emitCachedDevices();
212
+ return new Promise(() => {
213
+ });
214
+ }
215
+ emitCachedDevices() {
216
+ const announced = this.getAll();
217
+ this.matching = announced.map(a => a.service.name);
218
+ announced.forEach(a => {
219
+ this.emitDevice(a.service);
220
+ });
221
+ }
222
+ emitDevice(service) {
223
+ this.emit('device', this.createDeviceSetting(service), service);
224
+ }
225
+ buildDeviceSettings(matching = []) {
226
+ return matching.map((name) => ({ interface: DirectConnectInterface.INTERFACE_NAME, name }));
227
+ }
228
+ addService(service) {
229
+ var _a;
230
+ try {
231
+ service.transport = this.getName();
232
+ const existing = this.find(service);
233
+ if (existing) {
234
+ const idx = this.services.indexOf(existing);
235
+ this.services[idx] = { ts: Date.now(), service };
236
+ }
237
+ else {
238
+ this.logEvent({ message: 'device announced', device: service.name, announcement: service });
239
+ this.services.push({ ts: Date.now(), service });
240
+ this.emitDevice(service);
241
+ (_a = this.matching) === null || _a === void 0 ? void 0 : _a.push(service.name);
242
+ }
243
+ }
244
+ catch (err) {
245
+ this.logError(err, 'addService');
246
+ }
247
+ }
248
+ find(service) {
249
+ return this.services.find(a => a.service.name === service.name && a.ts > Date.now() - DC_EXPIRATION_TIMEOUT);
250
+ }
251
+ getAll() {
252
+ return this.services.filter(a => a.ts > Date.now() - DC_EXPIRATION_TIMEOUT);
253
+ }
254
+ setDebug(enabled) {
255
+ this.debug = enabled;
256
+ }
257
+ logEvent(event) {
258
+ if (this.logDisabled && event.message !== 'Error')
259
+ return;
260
+ this.getLogger().logEvent(event);
261
+ const emitPayload = Object.assign({}, event);
262
+ delete emitPayload.ts;
263
+ this.emit('log', emitPayload);
264
+ const w = global.window;
265
+ if (this.debug || (w === null || w === void 0 ? void 0 : w.SERVICE_DEBUG) || process.env.DEBUG)
266
+ console.log(`~~~ ${this.logger.getName().toUpperCase()}-SVC`, event);
267
+ }
268
+ logError(err, fn, args) {
269
+ const logInfo = args || {};
270
+ this.logEvent(Object.assign(Object.assign({ message: 'Error', fn }, logInfo), { error: err.message, stack: err.stack }));
271
+ }
272
+ getProtocol(announcement) {
273
+ var _a;
274
+ const DeviceClasses = (_a = this.getAdapterFactory().getAllSupportedSensors()) !== null && _a !== void 0 ? _a : [];
275
+ const matching = DeviceClasses.filter(C => {
276
+ const device = new C(null);
277
+ return device.isMatching(announcement.serviceUUIDs);
278
+ });
279
+ let DeviceClass;
280
+ DeviceClass = this.getBestDeviceMatch(matching);
281
+ const C = new DeviceClass(null);
282
+ return C.getProtocol();
283
+ }
284
+ getBestDeviceMatch(DeviceClasses) {
285
+ if (!DeviceClasses || DeviceClasses.length === 0)
286
+ return;
287
+ const details = DeviceClasses.map(c => ({ name: c.prototype.constructor.name, priority: c.detectionPriority || 0, class: c }));
288
+ details.sort((a, b) => b.priority - a.priority);
289
+ return details[0].class;
290
+ }
291
+ getAdapterFactory() {
292
+ return ble_1.BleAdapterFactory.getInstance('wifi');
293
+ }
294
+ }
295
+ DirectConnectInterface.INTERFACE_NAME = 'wifi';
296
+ exports.default = DirectConnectInterface;
297
+ class DirectConnectInterfaceFactory extends types_1.InterfaceFactory {
298
+ constructor() {
299
+ super();
300
+ this.iface = DirectConnectInterface.getInstance();
301
+ }
302
+ getInterface() {
303
+ return this.iface;
304
+ }
305
+ }
306
+ exports.DirectConnectInterfaceFactory = DirectConnectInterfaceFactory;
@@ -0,0 +1,50 @@
1
+ import { BleCharacteristic, BleService, BleWriteProps, IBlePeripheral } from "../../ble/types";
2
+ import { DirectConnectBinding, MulticastDnsAnnouncement, Socket } from "../bindings";
3
+ import { InteruptableTask, TaskState } from "../../utils/task";
4
+ import DirectConnectInterface from "./interface";
5
+ import EventEmitter from "events";
6
+ export declare class DirectConnectPeripheral implements IBlePeripheral {
7
+ protected announcement: MulticastDnsAnnouncement;
8
+ static readonly instances: Record<string, DirectConnectPeripheral>;
9
+ static create(announcement: MulticastDnsAnnouncement): DirectConnectPeripheral;
10
+ protected socket: Socket;
11
+ protected connectTask: InteruptableTask<TaskState, boolean>;
12
+ protected msgSeqNo: number;
13
+ protected onDataHandler: any;
14
+ protected onPortErrorHandler: any;
15
+ protected onPortCloseHandler: any;
16
+ protected partialBuffer: any;
17
+ protected remainingBuffer: any;
18
+ protected eventEmitter: EventEmitter<[never]>;
19
+ protected subscribed: Array<string>;
20
+ protected onDisconnectHandler: () => void;
21
+ constructor(announcement: MulticastDnsAnnouncement);
22
+ get services(): BleService[];
23
+ connect(): Promise<boolean>;
24
+ disconnect(): Promise<boolean>;
25
+ isConnected(): boolean;
26
+ isConnecting(): boolean;
27
+ onDisconnect(callback: () => void): void;
28
+ discoverServices(): Promise<string[]>;
29
+ discoverCharacteristics(serviceUUID: string): Promise<BleCharacteristic[]>;
30
+ subscribe(characteristicUUID: string, callback: (characteristicUuid: string, data: Buffer) => void): Promise<boolean>;
31
+ unsubscribe(characteristicUUID: string): Promise<boolean>;
32
+ subscribeAll(callback: (characteristicUuid: string, data: Buffer) => void): Promise<boolean>;
33
+ subscribeSelected(characteristics: string[], callback: (characteristicUuid: string, data: Buffer) => void): Promise<boolean>;
34
+ unsubscribeAll(): Promise<boolean>;
35
+ read(characteristicUUID: string): Promise<Buffer>;
36
+ write(characteristicUUID: string, data: Buffer, options?: BleWriteProps): Promise<Buffer>;
37
+ protected startConnection(): Promise<boolean>;
38
+ protected onPortError(err: Error): void;
39
+ protected onPortClose(): Promise<void>;
40
+ protected getPath(): string;
41
+ protected stopConnection(): Promise<boolean>;
42
+ protected getNextSeqNo(): number;
43
+ protected send(seqNo: number, data: Buffer): Promise<Buffer>;
44
+ protected getNextMessage(data: Buffer): Buffer;
45
+ protected processRemaining(): void;
46
+ protected onData(data: Buffer): Promise<void>;
47
+ protected getInterface(): DirectConnectInterface;
48
+ protected logEvent(event: any): void;
49
+ protected getBinding(): DirectConnectBinding;
50
+ }