@libs-scripts-mep/grav-fw-pvi 2.3.0 → 2.3.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.
Files changed (2) hide show
  1. package/grav-fw-pvi.js +10 -4
  2. package/package.json +1 -1
package/grav-fw-pvi.js CHANGED
@@ -10,6 +10,12 @@ class GravaFW {
10
10
 
11
11
  return new Promise(async (resolve) => {
12
12
 
13
+ let validationMsg = ``
14
+
15
+ if (dirFirm != null && dirOpt != null) { validationMsg = `Verify OPTION BYTE succeeds` }
16
+ else if (dirFirm != null) { validationMsg = `Verifying PROGRAM MEMORY succeeds` }
17
+ else if (dirOpt != null) { validationMsg = `Verify OPTION BYTE succeeds` }
18
+
13
19
  let ObjWriteSTM8 = await defineWriteSTM8(dirFirm, dirOpt, objArguments)
14
20
 
15
21
  let logGravacao = ""
@@ -23,7 +29,7 @@ class GravaFW {
23
29
 
24
30
  if (param[0] != undefined) {
25
31
 
26
- if (param[0].includes(`Verify OPTION BYTE succeeds`)) {
32
+ if (param[0].includes(validationMsg)) {
27
33
 
28
34
  PVI.FWLink.globalDaqMessagesObservers.remove(id)
29
35
  clearTimeout(timeOutGravacao)
@@ -42,7 +48,7 @@ class GravaFW {
42
48
  PVI.FWLink.globalDaqMessagesObservers.remove(id)
43
49
  clearTimeout(timeOutGravacao)
44
50
 
45
- resolve({ sucess: null, msg: `Não foi possível realizara a gravação` })
51
+ resolve({ sucess: null, msg: `Não foi possível realizar a gravação` })
46
52
 
47
53
  }
48
54
 
@@ -99,7 +105,7 @@ class GravaFW {
99
105
  const Device = objArguments.Device != undefined ? `-Device=${objArguments.Device}` : ""
100
106
  const NbTools = objArguments.NbTools != undefined ? `-NbTools=${objArguments.NbTools} ` : "-NbTools=1 "
101
107
  const Tool_ID = objArguments.Tool_ID != undefined ? `-Tool_ID=${objArguments.Tool_ID} ` : "-Tool_ID=0 "
102
- const BoardName = objArguments.BoardName != undefined ? `-BoardName=${objArguments.BoardName} ` : "-BoardName=ST-LINK ";
108
+ const BoardName = objArguments.BoardName != undefined ? `-BoardName=${objArguments.BoardName} ` : "-BoardName=ST-LINK "
103
109
 
104
110
  const FileData = objArguments.FileData != undefined ? `-FileOption=${objArguments.FileData} ` : ""
105
111
  const FileProg = dirFirm != null ? `-FileProg=${dirFirm.replace(/[\\]/g, `\/`).replace(/\.stp|\.STP/, `.HEX`)} ` : ""
@@ -270,7 +276,7 @@ class GravaFW {
270
276
  tryingPorts.push(splittedInfo[2])
271
277
  UI.setMsg(`Tentando gravar na porta ${splittedInfo[2]}`)
272
278
 
273
- } else if (info.includes("failed to connect")) {
279
+ } else if (info.includes("failed to connect") || info.includes("Timed out waiting for packet header")) {
274
280
  if (tryingPorts.length >= portsFound) {
275
281
  PVI.FWLink.globalDaqMessagesObservers.remove(id)
276
282
  resolve({ sucess: false, msg: "Gravador não conseguiu se conectar com o ESP32" }); return
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libs-scripts-mep/grav-fw-pvi",
3
- "version": "2.3.0",
3
+ "version": "2.3.2",
4
4
  "description": "Auxilia na gravação de microcontroladores por linha de comando através do PVI",
5
5
  "main": "grav-fw-pvi.js",
6
6
  "scripts": {