@ray-js/robot-data-stream 0.0.5 → 0.0.6
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/sweeperP2p.js +4 -0
- package/lib/index.js +4 -4
- package/package.json +1 -1
package/lib/api/sweeperP2p.js
CHANGED
|
@@ -358,6 +358,10 @@ export class SweeperP2p extends P2pApi {
|
|
|
358
358
|
fileName = 'aiHD_XXXX_YYYY.bin.stream';
|
|
359
359
|
}
|
|
360
360
|
const cachePacketMap = this.packetDataCacheMap.get(fileName);
|
|
361
|
+
if (!cachePacketMap) {
|
|
362
|
+
log4js.warn(`p2pStreamPacketReceiveCallback: fileName : ${fileName} is not support`);
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
361
365
|
const cacheSerialNumber = this.packetSerialNumberCacheMap.get(fileName);
|
|
362
366
|
|
|
363
367
|
// 说明收到了过时包的数据
|
package/lib/index.js
CHANGED
|
@@ -20,6 +20,10 @@ const useP2PDataStream = (devId, onReceiveMapData, onReceivePathData, opt) => {
|
|
|
20
20
|
if (logTag) {
|
|
21
21
|
log4js.setTag(logTag);
|
|
22
22
|
}
|
|
23
|
+
if (devId.startsWith('vdevo')) {
|
|
24
|
+
log4js.warn('virtual device cannot use p2p');
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
23
27
|
if (isIDE) {
|
|
24
28
|
log4js.warn(`You are using the IDE environment. To perform P2P and map debugging, please ensure the 'Robot Vacuum Debugger' plugin is installed.`);
|
|
25
29
|
SweeperP2pInstance.onReceiveMapData = onReceiveMapData;
|
|
@@ -29,10 +33,6 @@ const useP2PDataStream = (devId, onReceiveMapData, onReceivePathData, opt) => {
|
|
|
29
33
|
SweeperP2pInstance.removeP2pDownloadEvent();
|
|
30
34
|
};
|
|
31
35
|
}
|
|
32
|
-
if (devId.startsWith('vdevo')) {
|
|
33
|
-
log4js.warn('virtual device cannot use p2p');
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
36
|
isInitP2p();
|
|
37
37
|
onEnterBackground();
|
|
38
38
|
onEnterForeground();
|