queclink-parser 1.9.25 → 1.9.26

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,17 @@
1
+ #### 1.9.26 (2026-03-13)
2
+
3
+ ##### New Features
4
+
5
+ * **gl533cg:** se agrega soporte a instrucciones para GL533CG. ([fd859239](https://github.com/jaayesta/queclink-parser/commit/fd859239b0266f83a926cbbeca8aed94df07f42c))
6
+ * **gv350ceu:** se agrega soporte para GV350CEU. ([40a1d8e5](https://github.com/jaayesta/queclink-parser/commit/40a1d8e542cf3d3b81e919bd45a310d11511c63d))
7
+
8
+ ##### Bug Fixes
9
+
10
+ * **gtalm:**
11
+ * se corrige indexado para comandos de lectura ([2163bcd8](https://github.com/jaayesta/queclink-parser/commit/2163bcd824c3dd41d53fd52a73638709c4bd503a))
12
+ * se cambia status por siglas de config leída. ([c391f088](https://github.com/jaayesta/queclink-parser/commit/c391f0882cd5f6fdc21d8536c86ac9508b99c300))
13
+ * **bid:** se corrige lógica en evento GTBID ([1e5d0098](https://github.com/jaayesta/queclink-parser/commit/1e5d0098f16ce65488dda8d3d80f3261cd4af278))
14
+
1
15
  #### 1.9.25 (2026-03-12)
2
16
 
3
17
  ##### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "queclink-parser",
3
- "version": "1.9.25",
3
+ "version": "1.9.26",
4
4
  "description": "Parse raw data from Queclink devices",
5
5
  "main": "src",
6
6
  "scripts": {
package/src/gv310lau.js CHANGED
@@ -2319,113 +2319,23 @@ const parse = raw => {
2319
2319
  })
2320
2320
  } else if (command[1] === 'GTBID') {
2321
2321
  // Bluetooth beacon detection
2322
- let number = parsedData[4] !== '' ? parseInt(parsedData[4]) : 1
2322
+ // Bluetooth beacon detection
2323
2323
  let index = 4
2324
- let binAppendMask = utils.nHexDigit(utils.hex2bin(parsedData[index + 2]), 8)
2325
- let appendMask = {
2326
- accessoryMac: binAppendMask[6] === '1',
2327
- batteryLevel: binAppendMask[4] === '1',
2328
- signalStrength: binAppendMask[1] === '1',
2329
- beaconType: binAppendMask[0] === '1'
2330
- }
2331
-
2332
- let appMk, extra
2333
- for (let i = 1; i <= number; i++) {
2334
- appMk = utils.sumOnes(parsedData[index + 2])
2335
- extra = appendMask.beaconType
2336
- ? parsedData[index + 5] === '0'
2337
- ? 1
2338
- : parsedData[index + 5] === '1'
2339
- ? 3
2340
- : parsedData[index + 5] === '2' ? 2 : 0
2341
- : 0
2342
- index += 2 + appMk + extra
2343
- }
2344
-
2345
- let satelliteInfo = false
2346
- let satIndex = index + 12
2347
-
2348
- // If get satellites is configured
2349
- if (utils.includeSatellites(parsedData[satIndex])) {
2350
- satIndex += 1
2351
- satelliteInfo = true
2352
- }
2353
-
2354
- data = Object.assign(data, {
2355
- alarm: utils.getAlarm(command[1], null, 'gv310lau'),
2356
- loc: {
2357
- type: 'Point',
2358
- coordinates: [
2359
- parseFloat(parsedData[index + 5]),
2360
- parseFloat(parsedData[index + 6])
2361
- ]
2362
- },
2363
- speed:
2364
- parsedData[index + 2] !== '' ? parseFloat(parsedData[index + 2]) : null,
2365
- gpsStatus: utils.checkGps(
2366
- parseFloat(parsedData[index + 5]),
2367
- parseFloat(parsedData[index + 6])
2368
- ),
2369
- hdop:
2370
- parsedData[index + 1] !== '' ? parseFloat(parsedData[index + 1]) : null,
2371
- status: null,
2372
- azimuth:
2373
- parsedData[index + 3] !== '' ? parseFloat(parsedData[index + 3]) : null,
2374
- altitude:
2375
- parsedData[index + 4] !== '' ? parseFloat(parsedData[index + 4]) : null,
2376
- datetime:
2377
- parsedData[index + 7] !== ''
2378
- ? utils.parseDate(parsedData[index + 7])
2379
- : null,
2380
- voltage: {
2381
- battery: null,
2382
- inputCharge: null,
2383
- ada: null,
2384
- adb: null,
2385
- adc: null
2386
- },
2387
- mcc:
2388
- parsedData[index + 8] !== ''
2389
- ? parseInt(parsedData[index + 8], 10)
2390
- : null,
2391
- mnc:
2392
- parsedData[index + 9] !== ''
2393
- ? parseInt(parsedData[index + 9], 10)
2394
- : null,
2395
- lac:
2396
- parsedData[index + 10] !== ''
2397
- ? parseInt(parsedData[index + 10], 16)
2398
- : null,
2399
- cid:
2400
- parsedData[index + 11] !== ''
2401
- ? parseInt(parsedData[index + 11], 16)
2402
- : null,
2403
- satellites:
2404
- satelliteInfo && parsedData[satIndex] !== ''
2405
- ? parseInt(parsedData[satIndex])
2406
- : null,
2407
- odometer: null,
2408
- hourmeter: null
2409
- })
2324
+ let number = parsedData[index] !== '' ? parseInt(parsedData[index]) : 1
2410
2325
 
2411
2326
  let btDevices = []
2412
- let btIndex = 5
2413
2327
  for (let i = 1; i <= number; i++) {
2414
- let appendMask = utils.nHexDigit(
2415
- utils.hex2bin(parsedData[btIndex + 1]),
2416
- 8
2417
- )
2418
- let macIx = btIndex + 1 + parseInt(appendMask[6])
2328
+ let appendMask = utils.nHexDigit(utils.hex2bin(parsedData[index + 2]), 8)
2329
+ let macIx = index + 2 + parseInt(appendMask[6])
2419
2330
  let batIx = macIx + parseInt(appendMask[4])
2420
2331
  let sigIx = batIx + parseInt(appendMask[1])
2421
2332
  let typeIx = sigIx + parseInt(appendMask[0])
2422
2333
  btDevices.push({
2423
2334
  model:
2424
- parsedData[btIndex] !== ''
2425
- ? utils.beaconModels[parsedData[btIndex]]
2335
+ parsedData[index + 1] !== ''
2336
+ ? utils.beaconModels[parsedData[index + 1]]
2426
2337
  : null,
2427
- appendMask:
2428
- parsedData[btIndex + 1] !== '' ? parsedData[btIndex + 1] : null,
2338
+ appendMask: parsedData[index + 2] !== '' ? parsedData[index + 2] : null,
2429
2339
  mac:
2430
2340
  appendMask[6] === '1' && parsedData[macIx] !== ''
2431
2341
  ? parsedData[macIx]
@@ -2476,9 +2386,72 @@ const parse = raw => {
2476
2386
  parsedData[typeIx] === '0'
2477
2387
  ? 1
2478
2388
  : parsedData[typeIx] === '1' ? 3 : parsedData[typeIx] === '2' ? 2 : 0
2479
- btIndex = typeIx + 1 + extra
2389
+ index = typeIx + 1 + extra
2480
2390
  }
2481
2391
 
2392
+ index = index - 1
2393
+ let satelliteInfo = utils.includeSatellites(parsedData[index + 12])
2394
+ let jammingSate = utils.includeJammingSate(parsedData[index + 12])
2395
+ let satIndex = index + 12 + satelliteInfo + jammingSate
2396
+
2397
+ data = Object.assign(data, {
2398
+ alarm: utils.getAlarm(command[1], null, 'gv310lau'),
2399
+ loc: {
2400
+ type: 'Point',
2401
+ coordinates: [
2402
+ parseFloat(parsedData[index + 5]),
2403
+ parseFloat(parsedData[index + 6])
2404
+ ]
2405
+ },
2406
+ speed:
2407
+ parsedData[index + 2] !== '' ? parseFloat(parsedData[index + 2]) : null,
2408
+ gpsStatus: utils.checkGps(
2409
+ parseFloat(parsedData[index + 5]),
2410
+ parseFloat(parsedData[index + 6])
2411
+ ),
2412
+ hdop:
2413
+ parsedData[index + 1] !== '' ? parseFloat(parsedData[index + 1]) : null,
2414
+ status: null,
2415
+ azimuth:
2416
+ parsedData[index + 3] !== '' ? parseFloat(parsedData[index + 3]) : null,
2417
+ altitude:
2418
+ parsedData[index + 4] !== '' ? parseFloat(parsedData[index + 4]) : null,
2419
+ datetime:
2420
+ parsedData[index + 7] !== ''
2421
+ ? utils.parseDate(parsedData[index + 7])
2422
+ : null,
2423
+ voltage: {
2424
+ battery: null,
2425
+ inputCharge: null,
2426
+ ada: null,
2427
+ adb: null,
2428
+ adc: null
2429
+ },
2430
+ mcc:
2431
+ parsedData[index + 8] !== ''
2432
+ ? parseInt(parsedData[index + 8], 10)
2433
+ : null,
2434
+ mnc:
2435
+ parsedData[index + 9] !== ''
2436
+ ? parseInt(parsedData[index + 9], 10)
2437
+ : null,
2438
+ lac:
2439
+ parsedData[index + 10] !== ''
2440
+ ? parseInt(parsedData[index + 10], 16)
2441
+ : null,
2442
+ cid:
2443
+ parsedData[index + 11] !== ''
2444
+ ? parseInt(parsedData[index + 11], 16)
2445
+ : null,
2446
+ satellites:
2447
+ satelliteInfo &&
2448
+ parsedData[satIndex - (satelliteInfo + jammingSate) + 1] !== ''
2449
+ ? parseInt(parsedData[satIndex - (satelliteInfo + jammingSate) + 1])
2450
+ : null,
2451
+ odometer: null,
2452
+ hourmeter: null
2453
+ })
2454
+
2482
2455
  let bluetoothData = {
2483
2456
  connectedDevices: number,
2484
2457
  btDevices: btDevices