@ray-js/robot-data-stream 0.0.13-beta-7 → 0.0.13-beta-8

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 (55) hide show
  1. package/lib/api/index.d.ts +2 -12
  2. package/lib/api/index.js +1 -172
  3. package/lib/api/p2pApi.d.ts +8 -27
  4. package/lib/api/p2pApi.js +271 -169
  5. package/lib/api/sweeperP2p.d.ts +54 -21
  6. package/lib/api/sweeperP2p.js +324 -245
  7. package/lib/constant.d.ts +0 -52
  8. package/lib/constant.js +0 -54
  9. package/lib/index.d.ts +11 -1
  10. package/lib/index.js +166 -2
  11. package/lib/mqtt/createCommonOptions.d.ts +15 -56
  12. package/lib/mqtt/createCommonOptions.js +8 -44
  13. package/lib/mqtt/mqttProvider.d.ts +15 -23
  14. package/lib/mqtt/mqttProvider.js +26 -63
  15. package/lib/mqtt/myError.d.ts +4 -0
  16. package/lib/mqtt/myError.js +6 -0
  17. package/lib/mqtt/promise.js +3 -8
  18. package/lib/mqtt/type/index.d.ts +0 -9
  19. package/lib/mqtt/type/index.js +0 -8
  20. package/lib/mqtt/type/requestType.d.ts +0 -3
  21. package/lib/mqtt/type/requestType.js +0 -4
  22. package/lib/mqtt/useDevInfo.d.ts +7 -2
  23. package/lib/mqtt/useDevInfo.js +9 -25
  24. package/lib/mqtt/useHistoryMap.d.ts +21 -13
  25. package/lib/mqtt/useHistoryMap.js +32 -82
  26. package/lib/mqtt/usePartDivision.d.ts +7 -5
  27. package/lib/mqtt/usePartDivision.js +16 -41
  28. package/lib/mqtt/usePartMerge.d.ts +7 -5
  29. package/lib/mqtt/usePartMerge.js +18 -36
  30. package/lib/mqtt/usePassword.js +28 -59
  31. package/lib/mqtt/useQuiteHours.d.ts +24 -9
  32. package/lib/mqtt/useQuiteHours.js +52 -95
  33. package/lib/mqtt/useResetMap.d.ts +7 -10
  34. package/lib/mqtt/useResetMap.js +11 -40
  35. package/lib/mqtt/useRoomProperty.js +16 -23
  36. package/lib/mqtt/useSchedule.d.ts +4 -17
  37. package/lib/mqtt/useSchedule.js +49 -101
  38. package/lib/mqtt/useSelectRoomClean.d.ts +16 -20
  39. package/lib/mqtt/useSelectRoomClean.js +49 -145
  40. package/lib/mqtt/useSpotClean.d.ts +3 -3
  41. package/lib/mqtt/useSpotClean.js +51 -71
  42. package/lib/mqtt/useVirtualArea.d.ts +9 -6
  43. package/lib/mqtt/useVirtualArea.js +42 -112
  44. package/lib/mqtt/useVirtualWall.d.ts +10 -13
  45. package/lib/mqtt/useVirtualWall.js +34 -97
  46. package/lib/mqtt/useVoice.d.ts +6 -3
  47. package/lib/mqtt/useVoice.js +33 -73
  48. package/lib/mqtt/useWifiMap.js +18 -34
  49. package/lib/mqtt/useZoneClean.d.ts +13 -13
  50. package/lib/mqtt/useZoneClean.js +76 -149
  51. package/lib/utils/index.d.ts +1 -20
  52. package/lib/utils/index.js +0 -19
  53. package/package.json +1 -1
  54. package/lib/ttt/index.d.ts +0 -153
  55. package/lib/ttt/index.js +0 -458
package/lib/api/p2pApi.js CHANGED
@@ -1,9 +1,10 @@
1
+ /* eslint-disable consistent-return */
2
+ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
3
+ /* eslint-disable prefer-promise-reject-errors */
1
4
  import { p2p } from '@ray-js/ray';
2
5
  import dayjs from 'dayjs';
6
+ import { logger } from '../utils';
3
7
  import { trace } from '../trace';
4
- import { apis } from '../ttt';
5
- import { createLogger } from '../utils';
6
-
7
8
  /**
8
9
  * P2P 工具类
9
10
  */
@@ -15,14 +16,6 @@ export default class P2pApi {
15
16
  this.isConnecting = false;
16
17
  }
17
18
 
18
- /**
19
- * 便捷的日志记录方法
20
- * 使用 getter 确保每次访问时都使用最新的 onLogger
21
- */
22
- get log() {
23
- return createLogger(this.onLogger);
24
- }
25
-
26
19
  /**
27
20
  * 设备断开之后的重连
28
21
  */
@@ -34,23 +27,23 @@ export default class P2pApi {
34
27
  */
35
28
  // this.isConnected = false;
36
29
  if (this.isConnected) {
37
- return this.log.info({
30
+ return logger('info', {
38
31
  msg: 'p2p isConnected or isConnecting'
39
- });
32
+ }, this.onLogger);
40
33
  }
41
34
  if (this.isConnecting) {
42
- return this.log.info({
35
+ return logger('info', {
43
36
  msg: 'p2p isConnecting'
44
- });
37
+ }, this.onLogger);
45
38
  }
46
39
  // if (!this.isConnected) {
47
- this.log.info({
40
+ logger('info', {
48
41
  msg: `${source} start p2p reconnect ==> ${dayjs().format('YYYY-MM-DD HH:mm:ss')}`
49
- });
42
+ }, this.onLogger);
50
43
  this.connectDevice(() => {
51
- this.log.info({
44
+ logger('info', {
52
45
  msg: `${source} p2p reconnect success ==> ${dayjs().format('YYYY-MM-DD HH:mm:ss')}`
53
- });
46
+ }, this.onLogger);
54
47
  this.isConnected = true;
55
48
  if (this.isConnected) {
56
49
  typeof successCb === 'function' && successCb();
@@ -58,13 +51,13 @@ export default class P2pApi {
58
51
  }, () => {
59
52
  //
60
53
  }, () => {
61
- this.log.info({
54
+ logger('info', {
62
55
  msg: `${source} reconnect complete ==> ${String(this.isConnected)}`
63
- });
56
+ }, this.onLogger);
64
57
  if (!this.isConnected) {
65
- this.log.warn({
58
+ logger('warn', {
66
59
  msg: `${source} p2p reconnect failed ==> ${dayjs().format('YYYY-MM-DD HH:mm:ss')}`
67
- });
60
+ }, this.onLogger);
68
61
  setTimeout(() => {
69
62
  this.reconnectP2p(successCb, '0000');
70
63
  }, 6000);
@@ -79,82 +72,111 @@ export default class P2pApi {
79
72
  * @returns
80
73
  */
81
74
  initP2pSdk = async devId => {
82
- try {
83
- this.devId = devId;
84
- const result = await apis.initP2pSdk(this.onLogger);
85
- return result;
86
- } catch (e) {
87
- this.log.error({
88
- msg: 'P2PSDKInit occur an error',
89
- e
90
- });
91
- return {
92
- success: false,
93
- error: e
94
- };
95
- }
75
+ return new Promise((resolve, reject) => {
76
+ try {
77
+ this.devId = devId;
78
+ p2p.P2PSDKInit({
79
+ success: () => {
80
+ logger('info', {
81
+ msg: 'P2PSDKInit success'
82
+ }, this.onLogger);
83
+ resolve(true);
84
+ },
85
+ fail: params => {
86
+ logger('warn', {
87
+ msg: 'P2PSDKInit success',
88
+ params
89
+ }, this.onLogger);
90
+ resolve(false);
91
+ }
92
+ });
93
+ } catch (e) {
94
+ reject(false);
95
+ }
96
+ });
96
97
  };
97
98
 
98
99
  /**
99
100
  * 连接设备
100
101
  * @returns
101
102
  */
102
- connectDevice = async (successCb, failCb, completeCb) => {
103
- try {
104
- this.isConnecting = true;
105
- this.isConnected = false;
106
- const result = await apis.connectDevice(this.devId, this.onLogger);
107
- if (result.success) {
108
- this.isConnected = true;
109
- this.isConnecting = false;
110
- typeof successCb === 'function' && successCb();
111
- typeof completeCb === 'function' && completeCb();
112
- return true;
113
- } else {
114
- result.params || result.error;
103
+ connectDevice = (successCb, failCb, completeCb) => {
104
+ return new Promise((resolve, reject) => {
105
+ try {
106
+ this.isConnecting = true;
107
+ this.isConnected = false;
108
+ p2p.connectDevice({
109
+ deviceId: this.devId,
110
+ timeout: 5000,
111
+ mode: 0,
112
+ success: () => {
113
+ logger('info', {
114
+ msg: 'p2p connectDevice success'
115
+ }, this.onLogger);
116
+ this.isConnected = true;
117
+ this.isConnecting = false;
118
+ typeof successCb === 'function' && successCb();
119
+ resolve(true);
120
+ },
121
+ fail: params => {
122
+ logger('warn', {
123
+ msg: `p2p connectDevice failed ==> ${JSON.stringify(params.innerError)}`
124
+ }, this.onLogger);
125
+ this.isConnecting = false;
126
+ typeof failCb === 'function' && failCb();
127
+ resolve(false);
128
+ },
129
+ complete: () => {
130
+ this.isConnecting = false;
131
+ typeof completeCb === 'function' && completeCb();
132
+ }
133
+ });
134
+ } catch (e) {
115
135
  this.isConnecting = false;
116
- typeof failCb === 'function' && failCb();
117
- typeof completeCb === 'function' && completeCb();
118
- return false;
136
+ this.isConnected = false;
137
+ logger('error', {
138
+ msg: 'p2p connectDevice occur an error ==>',
139
+ e
140
+ }, this.onLogger);
141
+ reject(false);
119
142
  }
120
- } catch (e) {
121
- this.isConnecting = false;
122
- this.isConnected = false;
123
- this.log.error({
124
- msg: 'p2p connectDevice occur an error ==>',
125
- e
126
- });
127
- typeof failCb === 'function' && failCb();
128
- typeof completeCb === 'function' && completeCb();
129
- return false;
130
- }
143
+ });
131
144
  };
132
145
 
133
146
  /**
134
147
  * 断开P2P设备连接
135
148
  * @returns
136
149
  */
137
- disconnectDevice = async () => {
138
- try {
139
- const result = await apis.disconnectDevice(this.devId, this.onLogger);
140
- if (result.success) {
141
- this.isConnected = false;
142
- this.isConnecting = false;
143
- } else {
144
- this.isConnecting = false;
150
+ disconnectDevice = () => {
151
+ return new Promise((resolve, reject) => {
152
+ try {
153
+ p2p.disconnectDevice({
154
+ deviceId: this.devId,
155
+ success: () => {
156
+ this.isConnected = false;
157
+ logger('info', {
158
+ msg: 'p2p disconnectDevice success'
159
+ }, this.onLogger);
160
+ resolve(true);
161
+ },
162
+ fail: () => {
163
+ logger('warn', {
164
+ msg: 'p2p disconnectDevice failed'
165
+ }, this.onLogger);
166
+ resolve(false);
167
+ },
168
+ complete: () => {
169
+ this.isConnecting = false;
170
+ }
171
+ });
172
+ } catch (e) {
173
+ logger('warn', {
174
+ msg: 'p2p disconnectDevice occur an error ==>',
175
+ e
176
+ }, this.onLogger);
177
+ reject(false);
145
178
  }
146
- return result;
147
- } catch (e) {
148
- this.isConnecting = false;
149
- this.log.warn({
150
- msg: 'p2p disconnectDevice occur an error ==>',
151
- e
152
- });
153
- return {
154
- success: false,
155
- error: e
156
- };
157
- }
179
+ });
158
180
  };
159
181
 
160
182
  /**
@@ -166,33 +188,50 @@ export default class P2pApi {
166
188
  * @param failedCb
167
189
  * @returns
168
190
  */
169
- downloadStream = async (files, albumName, successCb, failedCb) => {
191
+ downloadStream = (files, albumName, successCb, failedCb) => {
170
192
  try {
171
193
  if (this.isConnected) {
172
- const result = await apis.downloadStream(this.devId, albumName, files.files, this.onLogger);
173
- if (result.success) {
174
- trace.pointFn({
175
- devId: this.devId,
176
- eventName: 'downloadStream'
194
+ return new Promise(resolve => {
195
+ p2p.downloadStream({
196
+ deviceId: this.devId,
197
+ albumName: albumName,
198
+ jsonfiles: JSON.stringify(files),
199
+ success: () => {
200
+ logger('info', {
201
+ msg: 'p2p downloadStream success'
202
+ }, this.onLogger);
203
+ trace.pointFn({
204
+ devId: this.devId,
205
+ eventName: 'downloadStream'
206
+ });
207
+ typeof successCb === 'function' && successCb();
208
+ resolve(true);
209
+ },
210
+ fail: params => {
211
+ logger('warn', {
212
+ msg: 'p2p downloadStream failed===>',
213
+ params
214
+ }, this.onLogger);
215
+ trace.pointFn({
216
+ devId: this.devId,
217
+ eventName: 'downloadStreamFailed'
218
+ });
219
+ setTimeout(() => {
220
+ typeof failedCb === 'function' && failedCb();
221
+ }, 500);
222
+ resolve(false);
223
+ },
224
+ complete: () => {
225
+ //
226
+ }
177
227
  });
178
- typeof successCb === 'function' && successCb();
179
- } else {
180
- trace.pointFn({
181
- devId: this.devId,
182
- eventName: 'downloadStreamFailed'
183
- });
184
- setTimeout(() => {
185
- typeof failedCb === 'function' && failedCb();
186
- }, 500);
187
- }
188
- return result.success;
228
+ });
189
229
  }
190
230
  } catch (e) {
191
- this.log.warn({
231
+ logger('warn', {
192
232
  msg: 'p2p downloadStream occur an error ==>',
193
233
  e
194
- });
195
- return false;
234
+ }, this.onLogger);
196
235
  }
197
236
  };
198
237
 
@@ -204,27 +243,42 @@ export default class P2pApi {
204
243
  * @param failedCb
205
244
  * @returns
206
245
  */
207
- appendDownloadStream = async (files, albumName, successCb, failedCb) => {
246
+ appendDownloadStream = (files, albumName, successCb, failedCb) => {
208
247
  try {
209
248
  if (this.isConnected) {
210
- const {
211
- success
212
- } = await apis.appendDownloadStream(this.devId, albumName, files.files, this.onLogger);
213
- if (success) {
214
- typeof successCb === 'function' && successCb();
215
- } else {
216
- setTimeout(() => {
217
- typeof failedCb === 'function' && failedCb();
218
- }, 500);
219
- }
220
- return success;
249
+ return new Promise(resolve => {
250
+ p2p.appendDownloadStream({
251
+ deviceId: this.devId,
252
+ albumName: albumName,
253
+ jsonfiles: JSON.stringify(files),
254
+ success: () => {
255
+ logger('info', {
256
+ msg: 'p2p appendDownloadStream success'
257
+ }, this.onLogger);
258
+ typeof successCb === 'function' && successCb();
259
+ resolve(true);
260
+ },
261
+ fail: params => {
262
+ logger('warn', {
263
+ msg: 'p2p appendDownloadStream failed===>',
264
+ params
265
+ }, this.onLogger);
266
+ setTimeout(() => {
267
+ typeof failedCb === 'function' && failedCb();
268
+ }, 500);
269
+ resolve(false);
270
+ },
271
+ complete: () => {
272
+ //
273
+ }
274
+ });
275
+ });
221
276
  }
222
277
  } catch (e) {
223
- this.log.warn({
278
+ logger('warn', {
224
279
  msg: 'p2p appendDownloadStream failed===>',
225
280
  e
226
- });
227
- return false;
281
+ }, this.onLogger);
228
282
  }
229
283
  };
230
284
 
@@ -245,25 +299,43 @@ export default class P2pApi {
245
299
  * 开始下载文件
246
300
  * files : {"files":["filesname1", "filesname2", "filesname3" ]}
247
301
  */
248
- downloadFile = async (files, albumName, filePath, successCb, failedCb) => {
302
+ downloadFile = (files, albumName, filePath, successCb, failedCb) => {
249
303
  try {
250
304
  if (this.isConnected) {
251
- const result = await apis.downloadFile(this.devId, albumName, filePath, files.files, this.onLogger);
252
- if (result.success) {
253
- typeof successCb === 'function' && successCb();
254
- return true;
255
- } else {
256
- setTimeout(() => {
257
- typeof failedCb === 'function' && failedCb();
258
- }, 500);
259
- return false;
260
- }
305
+ return new Promise(resolve => {
306
+ p2p.downloadFile({
307
+ deviceId: this.devId,
308
+ albumName: albumName,
309
+ filePath: filePath,
310
+ jsonfiles: JSON.stringify(files),
311
+ success: () => {
312
+ logger('info', {
313
+ msg: 'p2p downloadFile success'
314
+ }, this.onLogger);
315
+ typeof successCb === 'function' && successCb();
316
+ resolve(true);
317
+ },
318
+ fail: params => {
319
+ logger('warn', {
320
+ msg: 'p2p downloadFile success',
321
+ params
322
+ }, this.onLogger);
323
+ setTimeout(() => {
324
+ typeof failedCb === 'function' && failedCb();
325
+ }, 500);
326
+ resolve(false);
327
+ },
328
+ complete: () => {
329
+ //
330
+ }
331
+ });
332
+ });
261
333
  }
262
334
  } catch (e) {
263
- this.log.error({
335
+ logger('error', {
264
336
  msg: 'p2p downloadFile occur an error ==>',
265
337
  e
266
- });
338
+ }, this.onLogger);
267
339
  }
268
340
  return null;
269
341
  };
@@ -324,20 +396,26 @@ export default class P2pApi {
324
396
  * 取消进行下载
325
397
  * @returns
326
398
  */
327
- cancelDownloadTask = async () => {
328
- try {
329
- const result = await apis.cancelDownloadTask(this.devId, this.onLogger);
330
- return result;
331
- } catch (e) {
332
- this.log.error({
333
- msg: 'cancelDownloadTask occur an error',
334
- e
335
- });
336
- return {
337
- success: false,
338
- error: e
339
- };
340
- }
399
+ cancelDownloadTask = () => {
400
+ return new Promise((resolve, reject) => {
401
+ try {
402
+ p2p.cancelDownloadTask({
403
+ deviceId: this.devId,
404
+ success: () => {
405
+ resolve(true);
406
+ },
407
+ fail: () => {
408
+ reject(false);
409
+ }
410
+ });
411
+ } catch (e) {
412
+ logger('info', {
413
+ msg: 'cancelDownloadTask occur an error',
414
+ e
415
+ }, this.onLogger);
416
+ reject(false);
417
+ }
418
+ });
341
419
  };
342
420
 
343
421
  /**
@@ -345,17 +423,27 @@ export default class P2pApi {
345
423
  * @param albumName
346
424
  * @returns
347
425
  */
348
- queryAlbumFileIndexs = async albumName => {
349
- try {
350
- const result = await apis.queryAlbumFileIndexs(this.devId, albumName, this.onLogger);
351
- return result;
352
- } catch (e) {
353
- this.log.error({
354
- msg: 'queryAlbumFileIndexs occur an error',
355
- e
426
+ queryAlbumFileIndexs = albumName => {
427
+ return new Promise(resolve => {
428
+ p2p.queryAlbumFileIndexs({
429
+ deviceId: this.devId,
430
+ albumName,
431
+ success: params => {
432
+ logger('info', {
433
+ msg: 'queryAlbumFileIndexs ==>',
434
+ params
435
+ }, this.onLogger);
436
+ resolve(params);
437
+ },
438
+ fail: params => {
439
+ logger('warn', {
440
+ msg: 'queryAlbumFileIndexs failed ==>',
441
+ params
442
+ }, this.onLogger);
443
+ resolve(null);
444
+ }
356
445
  });
357
- return null;
358
- }
446
+ });
359
447
  };
360
448
 
361
449
  /**
@@ -363,18 +451,32 @@ export default class P2pApi {
363
451
  * @returns
364
452
  */
365
453
  deInitP2PSDK = async () => {
366
- try {
367
- const result = await apis.deInitP2pSdk(this.onLogger);
368
- return result;
369
- } catch (e) {
370
- this.log.error({
371
- msg: 'deInitP2pSDK occur an error ==>',
372
- e
373
- });
374
- return {
375
- success: false,
376
- error: e
377
- };
378
- }
454
+ return new Promise((resolve, reject) => {
455
+ try {
456
+ p2p.deInitSDK({
457
+ success: () => {
458
+ logger('info', {
459
+ msg: 'deInitP2pSDK success'
460
+ }, this.onLogger);
461
+ resolve(true);
462
+ },
463
+ fail: () => {
464
+ logger('info', {
465
+ msg: 'deInitP2pSDK failed'
466
+ }, this.onLogger);
467
+ resolve(false);
468
+ },
469
+ complete: () => {
470
+ resolve(true);
471
+ }
472
+ });
473
+ } catch (e) {
474
+ logger('error', {
475
+ msg: 'deInitP2pSDK occur an error ==>',
476
+ e
477
+ }, this.onLogger);
478
+ reject(false);
479
+ }
480
+ });
379
481
  };
380
482
  }
@@ -1,4 +1,3 @@
1
- import { FileNameEnum } from '../constant';
2
1
  import P2pApi from './p2pApi';
3
2
  /**
4
3
  * 基于P2p工具类的扫地机扩展实现
@@ -12,6 +11,44 @@ interface FileInfo {
12
11
  idx: number;
13
12
  type: number;
14
13
  }
14
+ declare const FILE_NAME_MAP: {
15
+ readonly 'map.bin': {
16
+ readonly type: 0;
17
+ };
18
+ readonly 'map_structured.bin': {
19
+ readonly type: 6;
20
+ };
21
+ readonly 'cleanPath.bin': {
22
+ readonly type: 1;
23
+ };
24
+ readonly 'map.bin.stream': {
25
+ readonly type: 0;
26
+ };
27
+ readonly 'map_structured.bin.stream': {
28
+ readonly type: 6;
29
+ };
30
+ readonly 'cleanPath.bin.stream': {
31
+ readonly type: 1;
32
+ };
33
+ readonly 'ai.bin': {
34
+ readonly type: 4;
35
+ };
36
+ readonly 'ai.bin.stream': {
37
+ readonly type: 4;
38
+ };
39
+ readonly 'aiHD_XXXX_YYYY.bin': {
40
+ readonly type: 5;
41
+ };
42
+ readonly 'aiHD_XXXX_YYYY.bin.stream': {
43
+ readonly type: 5;
44
+ };
45
+ readonly 'wifi_map.bin': {
46
+ readonly type: 7;
47
+ };
48
+ readonly 'wifi_map.bin.stream': {
49
+ readonly type: 7;
50
+ };
51
+ };
15
52
  export declare class SweeperP2p extends P2pApi {
16
53
  file: {
17
54
  items: Array<FileInfo>;
@@ -29,10 +66,10 @@ export declare class SweeperP2p extends P2pApi {
29
66
  fileIndex: number;
30
67
  cacheData: any;
31
68
  exitFiles: Array<string>;
32
- packetDataCacheMap: Map<FileNameEnum, Map<number, string>>;
33
- packetSerialNumberCacheMap: Map<FileNameEnum, number>;
34
- fileLengthCacheMap: Map<FileNameEnum, number>;
35
- packetTotalMap: Map<FileNameEnum, number>;
69
+ packetDataCacheMap: Map<keyof typeof FILE_NAME_MAP, Map<number, string>>;
70
+ packetSerialNumberCacheMap: Map<keyof typeof FILE_NAME_MAP, number>;
71
+ fileLengthCacheMap: Map<keyof typeof FILE_NAME_MAP, number>;
72
+ packetTotalMap: Map<keyof typeof FILE_NAME_MAP, number>;
36
73
  firstPackageTime: number;
37
74
  onReceiveMapData: (data: string) => void;
38
75
  onReceivePathData: (data: string) => void;
@@ -59,6 +96,18 @@ export declare class SweeperP2p extends P2pApi {
59
96
  * @returns
60
97
  */
61
98
  private getDataFilePath;
99
+ /**
100
+ * 创建文件路径文件夹
101
+ * @param filePath
102
+ * @returns
103
+ */
104
+ private createFilePath;
105
+ /**
106
+ * 检查当前文件目录是否存在
107
+ * @param filePath
108
+ * @returns
109
+ */
110
+ private checkIfDirIsExist;
62
111
  /**
63
112
  * 初始化文件目录
64
113
  * @param filePath
@@ -70,10 +119,6 @@ export declare class SweeperP2p extends P2pApi {
70
119
  * @param filename
71
120
  */
72
121
  private getFileType;
73
- /**
74
- * 根据文件类型处理数据并调用相应的回调函数
75
- */
76
- private handleDataByType;
77
122
  /**
78
123
  * 设备连接状态发生改变
79
124
  * @param data
@@ -82,14 +127,6 @@ export declare class SweeperP2p extends P2pApi {
82
127
  deviceId: string;
83
128
  status: number;
84
129
  }) => void;
85
- /**
86
- * 创建下载失败时的重连回调函数
87
- */
88
- private createReconnectCallback;
89
- /**
90
- * 执行文件下载逻辑
91
- */
92
- private executeDownload;
93
130
  /**
94
131
  * 开始进行文件下载
95
132
  * @param downloadType
@@ -129,10 +166,6 @@ export declare class SweeperP2p extends P2pApi {
129
166
  * @param filePath
130
167
  */
131
168
  private readFileFromPath;
132
- /**
133
- * 根据文件名获取对应的 reading 状态标志
134
- */
135
- private getReadingFlag;
136
169
  private setReading;
137
170
  private resetReading;
138
171
  /**