queclink-parser 1.9.1 → 1.9.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/CHANGELOG.md CHANGED
@@ -1,3 +1,25 @@
1
+ #### 1.9.6 (2024-05-02)
2
+
3
+ #### 1.9.5 (2024-05-02)
4
+
5
+ ##### Bug Fixes
6
+
7
+ * **gv58lau:** device battery and bt relay status fixed ([2d54419d](https://github.com/jaayesta/queclink-parser/commit/2d54419d7569854bcf2acb691377e188799bc701))
8
+
9
+ #### 1.9.4 (2024-04-26)
10
+
11
+ #### 1.9.3 (2024-04-26)
12
+
13
+ #### 1.9.2 (2024-04-26)
14
+
15
+ ##### Bug Fixes
16
+
17
+ * **replace:** fix some event parse ([35b00fb2](https://github.com/jaayesta/queclink-parser/commit/35b00fb29f461e88f0337584067732962e24e252))
18
+ * **gv310lau:**
19
+ * change elements in BT relay info for ERI report ([1ee49db7](https://github.com/jaayesta/queclink-parser/commit/1ee49db79e9d4bb97dda8feb388d886432d3f91b))
20
+ * fix message for bt relay in BAA report ([09f9c33e](https://github.com/jaayesta/queclink-parser/commit/09f9c33e8b2817fbc5ee3868a8d441c1f5865a37))
21
+ * change in index offset when raw includes satellites count. ([cbae5db9](https://github.com/jaayesta/queclink-parser/commit/cbae5db981859654210b713ffdcf27a8496ce68a))
22
+
1
23
  #### 1.9.1 (2024-03-13)
2
24
 
3
25
  #### 1.8.6 (2024-03-13)
package/example.js CHANGED
@@ -62,7 +62,7 @@ var dat1 = '+RESP:GTDAT,8020040100,866775051514578,,wretr,20220907193747,02EA$'
62
62
  var dat2 = '+RESP:GTDAT,8020040100,866775051514578,,1,,,wretr,1,0.0,0,129.2,117.129230,31.839215,20220907113723,0460,0001,DE11,05FE6667,01,12,,,,,20220907193724,02E7$'
63
63
 
64
64
  var fri_ = '+RESP:GTFRI,6E0504,868589060064048,,12173,10,3,1,0.0,198,17.6,-71.542960,-32.972193,20240123232112,0730,0001,13EE,0032A502,01,12,1,23.0,198,17.6,-71.542960,-32.972193,20240123232112,0730,0001,13EE,0032A502,01,15,1,0.0,198,17.6,-71.542960,-32.972193,20240123232122,0730,0001,13EE,0032A502,01,12,0.0,0000006:05:06,,,,57,210100,,,,20240123232124,2A27$'
65
- var eri_ = '+RESP:GTERI,6E0100,866775050906668,,00000002,,10,3,1,0.0,0,88.7,117.129265,31.839253,20220620104346,0460,0001,DE10,027A4F1F,00,1,0.0,0,88.7,117.129265,31.839253,20220620104346,0460,0001,DE10,027A4F1F,00,1,0.0,0,88.7,117.129265,31.839253,20220620104346,0460,0001,DE10,027A4F1F,00,0.0,,,,,100,220100,2,3,2836369E0A0000C7,1,01C7,283E1E41030000B5,1,01B3,28C54DC5080000F2,1,01AF,20220620104347,02BE$'
65
+ var eri_ = '+RESP:GTERI,8020040402,866314060333158,,00000100,,10,1,1,3.6,75,13.7,-71.542822,-32.972695,20240430211113,0730,0001,13EE,0032A502,01,9,0.0,,,,,95,420000,,1,00,13,0,,4007,,D612073816F6,0,,20240430211114,0083$'
66
66
  var fri__ = '+RESP:GTFRI,8020040100,866775051514636,,,30,3,1,43.3,0,43.8,117.128727,31.838200,20220907084517,0460,0000,550B,3D93,02,3,1,43.3,0,43.8,117.128727,31.838200,20220907084517,0460,0000,550B,3D93,02,3,1,43.3,0,43.8,117.128727,31.838200,20220907084517,0460,0000,550B,3D93,02,3,2654.6,00012:09:13,,,,100,220000,,,,20220907164518,030E$'
67
67
  var eri__ = '+RESP:GTERI,8020040100,866775050904879,GV58LAU,00000104,12639,12,3,1,0.0,184,97.5,,,20220907102510,,,,,01,10,1,0.0,184,97.5,,,20220907102510,,,,,01,10,1,0.0,184,97.5,,,20220907102510,,,,,01,10,0.0,00081:51:10,,,,100,410000,,0,203FFFFF,,,,,,,,,,,,,,,,,,,,,,,00FFFFFF,,,,,,,,,,,,,,,,,,,,,,,,,9,0,1,3,,001F,DU_100361,F022A2143F36,0,,,1,6,2,1A2E2AF0,003F,WTH300,AC233FA3545E,1,3252,26,42,2,1,0,,001F,TD_100109,FD6D3DE6D704,0,,,3,2,0,,001F,WTS300,78054101E641,0,,,4,1,0,0000008C,001F,TD_100114,D971858039B3,1,3500,24,5,2,0,0B8A1999,001F,WTS300,78054101E646,1,2954,25,7,10,1,,0017,DegreeT,EC6EC128DA26,0,,8,11,0,00000064,1007,MAG,D325C2B2A2F8,1,0,50,0,9,6,2,,003F,WTH300,AC233FA35461,0,,,,20220907193511,3449$'
68
68
  var fri___ = '+RESP:GTFRI,271002,863457051607917,,13098,50,2,1,0.0,268,2269.3,-68.926107,-22.455379,20231204113757,0730,0003,2249,97D48,00,1,0.0,268,2269.3,-68.926107,-22.455379,20231204113806,0730,0003,2249,97D48,00,7602.5,00373:19:50,,,97,210300,,,,20231204113816,53FF$'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "queclink-parser",
3
- "version": "1.9.1",
3
+ "version": "1.9.6",
4
4
  "description": "Parse raw data from Queclink devices",
5
5
  "main": "src",
6
6
  "scripts": {
package/src/gv310lau.js CHANGED
@@ -231,7 +231,7 @@ const parse = raw => {
231
231
 
232
232
  // If get satellites is configured
233
233
  if (utils.includeSatellites(parsedData[19])) {
234
- index = 6 + 13 * number
234
+ index = 7 + 13 * number
235
235
  satelliteInfo = true
236
236
  }
237
237
 
@@ -626,13 +626,9 @@ const parse = raw => {
626
626
  : null
627
627
  },
628
628
  relay: {
629
- configResult:
629
+ state:
630
630
  parsedData[relIx] !== '' && appendMask[1] === '1'
631
631
  ? parseInt(parsedData[relIx])
632
- : null,
633
- state:
634
- parsedData[relIx + 1] !== '' && appendMask[1] === '1'
635
- ? parseInt(parsedData[relIx + 1])
636
632
  : null
637
633
  }
638
634
  }
package/src/gv58lau.js CHANGED
@@ -249,8 +249,8 @@ const parse = raw => {
249
249
  datetime: parsedData[14] !== '' ? utils.parseDate(parsedData[14]) : null,
250
250
  voltage: {
251
251
  battery:
252
- parsedData[index + 6] !== ''
253
- ? parseFloat(parsedData[index + 6])
252
+ parsedData[index + 5] !== ''
253
+ ? parseFloat(parsedData[index + 5])
254
254
  : null, // percentage
255
255
  inputCharge:
256
256
  parsedData[5] !== '' ? parseFloat(parsedData[5]) / 1000 : null
@@ -451,13 +451,9 @@ const parse = raw => {
451
451
  : null
452
452
  },
453
453
  relay: {
454
- configResult:
454
+ state:
455
455
  parsedData[relIx] !== '' && appendMask[1] === '1'
456
456
  ? parseInt(parsedData[relIx])
457
- : null,
458
- state:
459
- parsedData[relIx + 1] !== '' && appendMask[1] === '1'
460
- ? parseInt(parsedData[relIx + 1])
461
457
  : null
462
458
  }
463
459
  }
package/src/gv75w.js CHANGED
@@ -967,32 +967,33 @@ const parse = raw => {
967
967
  parsedData[26] !== ''
968
968
  ? utils.nHexDigit(utils.hex2bin(parsedData[26]), 8)
969
969
  : null
970
+
970
971
  data = Object.assign(data, {
971
972
  alarm: utils.getAlarm(command[1], parsedData[4]),
972
973
  loc: {
973
974
  type: 'Point',
974
- coordinates: [parseFloat(parsedData[59]), parseFloat(parsedData[60])]
975
+ coordinates: [parseFloat(parsedData[35]), parseFloat(parsedData[36])]
975
976
  },
976
- speed: parsedData[56] !== '' ? parseFloat(parsedData[56]) : null,
977
+ speed: parsedData[32] !== '' ? parseFloat(parsedData[32]) : null,
977
978
  gpsStatus: utils.checkGps(
978
- parseFloat(parsedData[59]),
979
- parseFloat(parsedData[60])
979
+ parseFloat(parsedData[35]),
980
+ parseFloat(parsedData[36])
980
981
  ),
981
- hdop: parsedData[55] !== '' ? parseFloat(parsedData[55]) : null,
982
+ hdop: parsedData[31] !== '' ? parseFloat(parsedData[31]) : null,
982
983
  status: null,
983
- azimuth: parsedData[57] !== '' ? parseFloat(parsedData[57]) : null,
984
- altitude: parsedData[58] !== '' ? parseFloat(parsedData[58]) : null,
985
- datetime: parsedData[61] !== '' ? utils.parseDate(parsedData[61]) : null,
984
+ azimuth: parsedData[33] !== '' ? parseFloat(parsedData[33]) : null,
985
+ altitude: parsedData[34] !== '' ? parseFloat(parsedData[34]) : null,
986
+ datetime: parsedData[37] !== '' ? utils.parseDate(parsedData[37]) : null,
986
987
  voltage: {
987
988
  battery: null,
988
989
  inputCharge: null,
989
990
  ada: null,
990
991
  adb: null
991
992
  },
992
- mcc: parsedData[62] !== '' ? parseInt(parsedData[62], 10) : null,
993
- mnc: parsedData[63] !== '' ? parseInt(parsedData[63], 10) : null,
994
- lac: parsedData[64] !== '' ? parseInt(parsedData[64], 16) : null,
995
- cid: parsedData[65] !== '' ? parseInt(parsedData[65], 16) : null,
993
+ mcc: parsedData[38] !== '' ? parseInt(parsedData[38], 10) : null,
994
+ mnc: parsedData[39] !== '' ? parseInt(parsedData[39], 10) : null,
995
+ lac: parsedData[40] !== '' ? parseInt(parsedData[40], 16) : null,
996
+ cid: parsedData[41] !== '' ? parseInt(parsedData[41], 16) : null,
996
997
  odometer: null,
997
998
  hourmeter: null,
998
999
  can: {
@@ -243,7 +243,7 @@
243
243
  "12": "Se ha detectado un accesorio bluetooth",
244
244
  "13": "Puerta abierta",
245
245
  "14": "Puerta cerrada",
246
- "15": "Evento de relé"
246
+ "15": "Cambio de estado en Relé BT"
247
247
  },
248
248
  "GTBID": "Se ha detectado baliza bluetooth",
249
249
  "GTLBA": {
@@ -322,7 +322,8 @@
322
322
  "ATI": "Solicitud: información básica de AVL",
323
323
  "CAN100 Operation": "Solicitud: vehículo vía CANbus",
324
324
  "SCS": "Solicitud: estado de calibración 3-ejes",
325
- "DELBUF": "Se han eliminado los reportes almacenados"
325
+ "DELBUF": "Se han eliminado los reportes almacenados",
326
+ "RLY": "Acción sobre Relé BT"
326
327
  }
327
328
  }
328
329
  }
package/src/utils.js CHANGED
@@ -1114,6 +1114,7 @@ const sumOnes = num => {
1114
1114
  Parses date
1115
1115
  */
1116
1116
  const parseDate = date => {
1117
+ if (!date) return null
1117
1118
  return new Date(
1118
1119
  `${date.replace(
1119
1120
  /(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/,