queclink-parser 1.4.0 → 1.4.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/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ #### 1.4.2 (2023-01-16)
2
+
3
+ ##### Bug Fixes
4
+
5
+ * **messages:** fixes empty messages in events not supported directly. Adds raw message as message ([fa8eaf92](https://github.com/jaayesta/queclink-parser/commit/fa8eaf92b66623ea6ff53d6febc52e570d16b487))
6
+
7
+ #### 1.4.1 (2022-02-28)
8
+
9
+ ##### New Features
10
+
11
+ * **gv500map:** suport for gv500Map added ([6155dcbb](https://github.com/jaayesta/queclink-parser/commit/6155dcbb2a4feb8383e357beeca06c7d4feed4eb))
12
+
1
13
  ### 1.4.0 (2022-02-02)
2
14
 
3
15
  ##### New Features
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  [![dependency Status](https://img.shields.io/david/jaayesta/queclink-parser.svg?style=flat-square)](https://david-dm.org/jaayesta/queclink-parser#info=dependencies)
6
6
  [![devDependency Status](https://img.shields.io/david/dev/jaayesta/queclink-parser.svg?style=flat-square)](https://david-dm.org/jaayesta/queclink-parser#info=devDependencies)
7
7
 
8
- > Parses raw data from Queclink devices (TCP). Devices supported: GV55, GV55W, GV200, GV300, GV75W, GV300W, GV500, GV600W, GV800W, GMT100, GL50, GL50B, GL300, GL300W, GV50P
8
+ > Parses raw data from Queclink devices (TCP). Devices supported: GV55, GV55W, GV200, GV300, GV75W, GV300W, GV500, GV500MAP, GV600W, GV800W, GMT100, GL50, GL50B, GL300, GL300W, GV50P
9
9
 
10
10
  ## Installation
11
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "queclink-parser",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "description": "Parse raw data from Queclink devices",
5
5
  "main": "src",
6
6
  "scripts": {
package/src/gl300.js CHANGED
@@ -356,7 +356,7 @@ const parse = raw => {
356
356
  })
357
357
  } else {
358
358
  data = Object.assign(data, {
359
- alarm: utils.getAlarm(command[1], null)
359
+ alarm: utils.getAlarm(command[1], raw.toString())
360
360
  })
361
361
  }
362
362
  // Check gps data
package/src/gl50.js CHANGED
@@ -202,7 +202,7 @@ const parse = raw => {
202
202
  })
203
203
  } else {
204
204
  data = Object.assign(data, {
205
- alarm: utils.getAlarm(command[1], null)
205
+ alarm: utils.getAlarm(command[1], raw.toString())
206
206
  })
207
207
  }
208
208
  // Check gps data
package/src/gmt100.js CHANGED
@@ -464,7 +464,7 @@ const parse = raw => {
464
464
  })
465
465
  } else {
466
466
  data = Object.assign(data, {
467
- alarm: utils.getAlarm(command[1], null)
467
+ alarm: utils.getAlarm(command[1], raw.toString())
468
468
  })
469
469
  }
470
470
  // Check gps data
package/src/gv200.js CHANGED
@@ -1094,7 +1094,7 @@ const parse = raw => {
1094
1094
  })
1095
1095
  } else {
1096
1096
  data = Object.assign(data, {
1097
- alarm: utils.getAlarm(command[1], null)
1097
+ alarm: utils.getAlarm(command[1], raw.toString())
1098
1098
  })
1099
1099
  }
1100
1100
  // Check gps data
package/src/gv300.js CHANGED
@@ -912,7 +912,7 @@ const parse = raw => {
912
912
  })
913
913
  } else {
914
914
  data = Object.assign(data, {
915
- alarm: utils.getAlarm(command[1], null)
915
+ alarm: utils.getAlarm(command[1], raw.toString())
916
916
  })
917
917
  }
918
918
  // Check gps data
package/src/gv300w.js CHANGED
@@ -1291,7 +1291,7 @@ const parse = raw => {
1291
1291
  })
1292
1292
  } else {
1293
1293
  data = Object.assign(data, {
1294
- alarm: utils.getAlarm(command[1], null)
1294
+ alarm: utils.getAlarm(command[1], raw.toString())
1295
1295
  })
1296
1296
  }
1297
1297
  // Check gps data
package/src/gv500.js CHANGED
@@ -564,7 +564,7 @@ const parse = raw => {
564
564
  })
565
565
  } else {
566
566
  data = Object.assign(data, {
567
- alarm: utils.getAlarm(command[1], null)
567
+ alarm: utils.getAlarm(command[1], raw.toString())
568
568
  })
569
569
  }
570
570
  // Check gps data
package/src/gv50p.js CHANGED
@@ -491,7 +491,7 @@ const parse = raw => {
491
491
  })
492
492
  } else {
493
493
  data = Object.assign(data, {
494
- alarm: utils.getAlarm(command[1], null)
494
+ alarm: utils.getAlarm(command[1], raw.toString())
495
495
  })
496
496
  }
497
497
  // Check gps data
package/src/gv55.js CHANGED
@@ -490,7 +490,7 @@ const parse = (raw, d) => {
490
490
  })
491
491
  } else {
492
492
  data = Object.assign(data, {
493
- alarm: utils.getAlarm(command[1], null)
493
+ alarm: utils.getAlarm(command[1], raw.toString())
494
494
  })
495
495
  }
496
496
  // Check gps data
package/src/gv600w.js CHANGED
@@ -975,7 +975,7 @@ const parse = raw => {
975
975
  })
976
976
  } else {
977
977
  data = Object.assign(data, {
978
- alarm: utils.getAlarm(command[1], null)
978
+ alarm: utils.getAlarm(command[1], raw.toString())
979
979
  })
980
980
  }
981
981
  // Check gps data
package/src/gv75w.js CHANGED
@@ -1272,7 +1272,7 @@ const parse = raw => {
1272
1272
  })
1273
1273
  } else {
1274
1274
  data = Object.assign(data, {
1275
- alarm: utils.getAlarm(command[1], null)
1275
+ alarm: utils.getAlarm(command[1], raw.toString())
1276
1276
  })
1277
1277
  }
1278
1278
  // Check gps data
package/src/gv800w.js CHANGED
@@ -1013,7 +1013,7 @@ const parse = raw => {
1013
1013
  })
1014
1014
  } else {
1015
1015
  data = Object.assign(data, {
1016
- alarm: utils.getAlarm(command[1], null)
1016
+ alarm: utils.getAlarm(command[1], raw.toString())
1017
1017
  })
1018
1018
  }
1019
1019
  // Check gps data
package/src/index.js CHANGED
@@ -104,7 +104,7 @@ const parse = (raw, options) => {
104
104
  result = gv300.parse(raw.toString())
105
105
  } else if (device === 'GV200') {
106
106
  result = gv200.parse(raw.toString())
107
- } else if (device === 'GV500') {
107
+ } else if (device === 'GV500' || device === 'GV500MAP') {
108
108
  result = gv500.parse(raw.toString())
109
109
  } else if (device === 'GV55' || device === 'GV55W') {
110
110
  result = gv55.parse(raw.toString(), device)
package/src/utils.js CHANGED
@@ -31,6 +31,7 @@ const devices = {
31
31
  '11': 'GL500',
32
32
  '1A': 'GL300',
33
33
  '1F': 'GV500',
34
+ '5E': 'GV500MAP',
34
35
  '25': 'GV300', // New Version
35
36
  '35': 'GV200', // New Version
36
37
  '27': 'GV300W',
@@ -469,10 +470,16 @@ const getAlarm = (command, report, extra = false) => {
469
470
  return {
470
471
  type: 'Device_Geofence'
471
472
  }
473
+ } else if (command === 'GTALC' || command === 'GTALM') {
474
+ return {
475
+ type: command,
476
+ status: 'CONFIG',
477
+ message: report
478
+ }
472
479
  } else {
473
480
  return {
474
481
  type: command,
475
- message: messages[command] ? messages[command] : ''
482
+ message: messages[command] ? messages[command] : report || ''
476
483
  }
477
484
  }
478
485
  }