@ray-js/robot-data-stream 0.0.11 → 0.0.12-beta-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/p2pApi.js +1 -2
- package/lib/api/sweeperP2p.js +9 -2
- package/package.json +1 -1
package/lib/api/p2pApi.js
CHANGED
|
@@ -108,8 +108,7 @@ export default class P2pApi {
|
|
|
108
108
|
},
|
|
109
109
|
fail: params => {
|
|
110
110
|
logger('warn', {
|
|
111
|
-
msg:
|
|
112
|
-
params
|
|
111
|
+
msg: `p2p connectDevice failed ==> ${JSON.stringify(params.innerError)}`
|
|
113
112
|
}, this.onLogger);
|
|
114
113
|
typeof failCb === 'function' && failCb();
|
|
115
114
|
resolve(false);
|
package/lib/api/sweeperP2p.js
CHANGED
|
@@ -358,9 +358,8 @@ export class SweeperP2p extends P2pApi {
|
|
|
358
358
|
[...this.packetDataCacheMap.keys()].forEach(key => {
|
|
359
359
|
this.packetDataCacheMap.set(key, new Map());
|
|
360
360
|
});
|
|
361
|
-
} else {
|
|
362
|
-
this.cacheData = {};
|
|
363
361
|
}
|
|
362
|
+
this.cacheData = {};
|
|
364
363
|
this.offFileDownloadComplete && this.offFileDownloadComplete();
|
|
365
364
|
this.offP2pStreamPacketReceive && this.offP2pStreamPacketReceive();
|
|
366
365
|
|
|
@@ -425,6 +424,11 @@ export class SweeperP2p extends P2pApi {
|
|
|
425
424
|
return;
|
|
426
425
|
}
|
|
427
426
|
const cacheSerialNumber = this.packetSerialNumberCacheMap.get(fileName);
|
|
427
|
+
if (fileName.includes('cleanPath')) {
|
|
428
|
+
logger('info', {
|
|
429
|
+
msg: `receive a path package, ${fileSerialNumber}, ${packetIndex}, ${packetType}, ${cacheSerialNumber}}`
|
|
430
|
+
}, this.onLogger);
|
|
431
|
+
}
|
|
428
432
|
|
|
429
433
|
// 说明收到了过时包的数据
|
|
430
434
|
if (fileSerialNumber < cacheSerialNumber) return;
|
|
@@ -471,6 +475,9 @@ export class SweeperP2p extends P2pApi {
|
|
|
471
475
|
this.onReceiveMapData(hexValue);
|
|
472
476
|
}
|
|
473
477
|
if (type === 1) {
|
|
478
|
+
logger('info', {
|
|
479
|
+
msg: `push new path data`
|
|
480
|
+
}, this.onLogger);
|
|
474
481
|
this.onReceivePathData(hexValue);
|
|
475
482
|
}
|
|
476
483
|
if (type === 4) {
|