@libs-scripts-mep/grav-fw-pvi 3.0.0 → 3.0.1
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/grav-fw-pvi.js +11 -11
- package/package.json +1 -1
package/grav-fw-pvi.js
CHANGED
|
@@ -52,21 +52,21 @@ export default class GravaFW {
|
|
|
52
52
|
FWLink.PVIEventObserver.remove(id)
|
|
53
53
|
clearTimeout(timeOutGravacao)
|
|
54
54
|
|
|
55
|
-
resolve({ success: true, msg:
|
|
55
|
+
resolve({ success: true, msg: "Gravação bem sucedida", dirFirm: dirFirm })
|
|
56
56
|
|
|
57
57
|
} else if (param[0].includes(`ERROR : Cannot communicate with the tool`)) {
|
|
58
58
|
|
|
59
59
|
FWLink.PVIEventObserver.remove(id)
|
|
60
60
|
clearTimeout(timeOutGravacao)
|
|
61
61
|
|
|
62
|
-
resolve({ success: null, msg: `Gravador não respondeu
|
|
62
|
+
resolve({ success: null, msg: `Gravador não respondeu`, dirFirm: dirFirm })
|
|
63
63
|
|
|
64
64
|
} else if (param[0].includes(`(API) ERROR`)) {
|
|
65
65
|
|
|
66
66
|
FWLink.PVIEventObserver.remove(id)
|
|
67
67
|
clearTimeout(timeOutGravacao)
|
|
68
68
|
|
|
69
|
-
resolve({ success: null, msg: `Não foi possível realizar a gravação
|
|
69
|
+
resolve({ success: null, msg: `Não foi possível realizar a gravação`, dirFirm: dirFirm })
|
|
70
70
|
|
|
71
71
|
}
|
|
72
72
|
|
|
@@ -180,21 +180,21 @@ export default class GravaFW {
|
|
|
180
180
|
FWLink.PVIEventObserver.remove(id)
|
|
181
181
|
clearTimeout(timeOutGravacao)
|
|
182
182
|
|
|
183
|
-
resolve({ success: true, msg:
|
|
183
|
+
resolve({ success: true, msg: "Gravação bem sucedida", dirProject: dirProject })
|
|
184
184
|
|
|
185
185
|
} else if (param[0].includes(`Cannot find the specified tool.`)) {
|
|
186
186
|
|
|
187
187
|
FWLink.PVIEventObserver.remove(id)
|
|
188
188
|
clearTimeout(timeOutGravacao)
|
|
189
189
|
|
|
190
|
-
resolve({ success: null, msg: `Gravador não respondeu
|
|
190
|
+
resolve({ success: null, msg: `Gravador não respondeu`, dirProject: dirProject })
|
|
191
191
|
|
|
192
192
|
} else if (param[0].includes(`Error: No project file specifed.`)) {
|
|
193
193
|
|
|
194
194
|
FWLink.PVIEventObserver.remove(id)
|
|
195
195
|
clearTimeout(timeOutGravacao)
|
|
196
196
|
|
|
197
|
-
resolve({ success: false, msg: `Projeto informado é inválido
|
|
197
|
+
resolve({ success: false, msg: `Projeto informado é inválido`, dirProject: dirProject })
|
|
198
198
|
|
|
199
199
|
}
|
|
200
200
|
|
|
@@ -241,7 +241,7 @@ export default class GravaFW {
|
|
|
241
241
|
if (logGravacao.includes(`O.K.`)) {
|
|
242
242
|
|
|
243
243
|
clearTimeout(timeOutGravacao)
|
|
244
|
-
resolve({ success: true, msg:
|
|
244
|
+
resolve({ success: true, msg: dirProject })
|
|
245
245
|
|
|
246
246
|
} else if (logGravacao.includes(`Cannot connect to target.`)) {
|
|
247
247
|
|
|
@@ -288,7 +288,7 @@ export default class GravaFW {
|
|
|
288
288
|
return new Promise((resolve) => {
|
|
289
289
|
|
|
290
290
|
if (!AddressFilePath) {
|
|
291
|
-
resolve({ success: false, msg: "Caminho de arquivo para gravação não especificado" }); return
|
|
291
|
+
resolve({ success: false, msg: "Caminho de arquivo para gravação não especificado", AddressFilePath: AddressFilePath }); return
|
|
292
292
|
}
|
|
293
293
|
|
|
294
294
|
let portsFound = null, tryingPorts = [], lastTimeMsg = new Date().getTime()
|
|
@@ -298,7 +298,7 @@ export default class GravaFW {
|
|
|
298
298
|
if (new Date().getTime() - lastTimeMsg > betweenMsgTimeout) {
|
|
299
299
|
clearInterval(betweenMsgMonitor)
|
|
300
300
|
FWLink.PVIEventObserver.remove(id)
|
|
301
|
-
resolve({ success: false, msg: "esptool.py encontrou um problema e teve que ser finalizado." }); return
|
|
301
|
+
resolve({ success: false, msg: "esptool.py encontrou um problema e teve que ser finalizado.", AddressFilePath: AddressFilePath }); return
|
|
302
302
|
}
|
|
303
303
|
|
|
304
304
|
}, 1000)
|
|
@@ -321,7 +321,7 @@ export default class GravaFW {
|
|
|
321
321
|
} else if (info.includes("failed to connect")) {
|
|
322
322
|
if (tryingPorts.length >= portsFound) {
|
|
323
323
|
FWLink.PVIEventObserver.remove(id)
|
|
324
|
-
resolve({ success: false, msg: "Gravador não conseguiu se conectar com o ESP32" }); return
|
|
324
|
+
resolve({ success: false, msg: "Gravador não conseguiu se conectar com o ESP32", AddressFilePath: AddressFilePath }); return
|
|
325
325
|
}
|
|
326
326
|
|
|
327
327
|
} else if (info.includes("%")) {
|
|
@@ -330,7 +330,7 @@ export default class GravaFW {
|
|
|
330
330
|
} else if (info.includes("Hard resetting via RTS pin...")) {
|
|
331
331
|
sessionStorage.getItem(sessionStorageTag) == null ? sessionStorage.setItem(sessionStorageTag, tryingPorts.pop()) : null
|
|
332
332
|
FWLink.PVIEventObserver.remove(id)
|
|
333
|
-
resolve({ success: true, msg: "Gravação bem sucedida" })
|
|
333
|
+
resolve({ success: true, msg: "Gravação bem sucedida", AddressFilePath: AddressFilePath })
|
|
334
334
|
console.timeEnd("WriteFirmware")
|
|
335
335
|
}
|
|
336
336
|
|