queclink-parser 1.3.20 → 1.4.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/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ #### 1.4.1 (2022-02-28)
2
+
3
+ ##### New Features
4
+
5
+ * **gv500map:** suport for gv500Map added ([6155dcbb](https://github.com/jaayesta/queclink-parser/commit/6155dcbb2a4feb8383e357beeca06c7d4feed4eb))
6
+
7
+ ### 1.4.0 (2022-02-02)
8
+
9
+ ##### New Features
10
+
11
+ * **gv55w:** support for gv55w added ([6e6cde95](https://github.com/jaayesta/queclink-parser/commit/6e6cde95be791134f993059883db1184a52bac9a))
12
+
13
+ #### 1.3.21 (2021-11-03)
14
+
15
+ ##### Bug Fixes
16
+
17
+ * **buff:** buff pattern fixed ([882ebc02](https://github.com/jaayesta/queclink-parser/commit/882ebc02c1a7a483937086cc8f0415cd3a346121))
18
+
1
19
  #### 1.3.20 (2021-09-23)
2
20
 
3
21
  ##### Bug Fixes
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, GV200, GV300, GV75W, GV300W, GV500, GV600W, GV800W, GMT100, GL50, GL50B, GL300, GL300W
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.3.20",
3
+ "version": "1.4.1",
4
4
  "description": "Parse raw data from Queclink devices",
5
5
  "main": "src",
6
6
  "scripts": {
package/src/gv55.js CHANGED
@@ -4,7 +4,7 @@ const utils = require('./utils.js')
4
4
  /*
5
5
  Parses messages data from GV55 devices
6
6
  */
7
- const parse = raw => {
7
+ const parse = (raw, d) => {
8
8
  raw = raw.substr(0, raw.length - 1)
9
9
 
10
10
  const parsedData = raw.split(',')
@@ -18,7 +18,7 @@ const parse = raw => {
18
18
  let data = {
19
19
  raw: `${raw.toString()}$`,
20
20
  manufacturer: 'queclink',
21
- device: 'Queclink-GV55',
21
+ device: d === 'GV55W' ? 'Queclink-GV55W' : 'Queclink-GV55',
22
22
  type: 'data',
23
23
  imei: parsedData[2],
24
24
  protocolVersion: utils.getProtocolVersion(parsedData[1]),
package/src/index.js CHANGED
@@ -104,10 +104,10 @@ 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
- } else if (device === 'GV55') {
110
- result = gv55.parse(raw.toString())
109
+ } else if (device === 'GV55' || device === 'GV55W') {
110
+ result = gv55.parse(raw.toString(), device)
111
111
  } else if (device === 'GMT100') {
112
112
  result = gmt100.parse(raw.toString())
113
113
  } else if (device === 'GL300' || device === 'GL300W') {
package/src/utils.js CHANGED
@@ -10,7 +10,7 @@ const langs = { es: langEs, en: langEn }
10
10
  const patterns = {
11
11
  message: /^\+RESP.+\$$/,
12
12
  ack: /^\+ACK.+\$$/,
13
- buffer: /^\+BUFF.+\$$/,
13
+ buffer: /^\+BUFF/,
14
14
  heartbeat: /^\+ACK:GTHBD.+\$$/
15
15
  }
16
16
 
@@ -26,10 +26,12 @@ const devices = {
26
26
  '08': 'GMT100',
27
27
  '09': 'GV50P', // GV50 Plus
28
28
  '0F': 'GV55',
29
+ '50': 'GV55W',
29
30
  '10': 'GV55 LITE',
30
31
  '11': 'GL500',
31
32
  '1A': 'GL300',
32
33
  '1F': 'GV500',
34
+ '5E': 'GV500MAP',
33
35
  '25': 'GV300', // New Version
34
36
  '35': 'GV200', // New Version
35
37
  '27': 'GV300W',