From ec7fa0c36157007742ca56bb7b01528e32845a83 Mon Sep 17 00:00:00 2001 From: Paolo Reyes Date: Thu, 21 Sep 2017 15:42:27 +0800 Subject: [PATCH] Updated Readme --- README.md | 26 ++++++++++++++++++++++++++ package.json | 2 +- test.js | 2 ++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b7c633b..a2ae2d3 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,11 @@ A parser for TK-103A and TK-103B GPS Tracker Protocol. import tk103 from 'tk-103-parser'; const test = new Buffer('lat:14.632742\nlong:121.001790\nspeed:0.00\nT:17/06/05 16:21\nhttp://maps.google.com/maps?f=q&q=6.226433,125.075470&z=16\nPwr: ON Door: OFF ACC: OFF') +const smsrawSOSAlert = new Buffer('help me!\nlat:6.319640\nlong:124.975628\nspeed:0.00\nT:17/06/05 16:42\nhttp://maps.google.com/maps?f=q&q=6.319640,124.975628&z=16'); + console.log(tk103.parseTK103(test)); +console.log(tk103.parseTK103(smsrawSOSAlert)); ``` @@ -40,6 +43,29 @@ console.log(tk103.parseTK103(test)); vehicleBattery: null, status: 'Success' } + +{ alert: 'SOSAlert', + + latitude: '6.319640', + longitude: '124.975628', + speed: '0.00', + date: '17/06/05', + parsedDate: '2017-06-05', + dateTime: [Function: Date], + time: '16:42', + power: null, + door: null, + acc: null, + lastlatitude: null, + lastlongitude: null, + mnc: null, + mcc: null, + timestampsent: null, + direction: null, + GPSPosition: null, + GPSSIgnal: null, + vehicleBattery: null, + status: 'Success' } ``` ## SMS Protocol Format diff --git a/package.json b/package.json index 0599f66..b9cb927 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tk-103-parser", - "version": "1.0.24", + "version": "1.0.25", "description": "Parser for TK-103 GPS Devices", "main": "tk-103/", "scripts": { diff --git a/test.js b/test.js index 3b57594..349cabe 100644 --- a/test.js +++ b/test.js @@ -19,6 +19,8 @@ const smsrawTest = new Buffer('lat:14.836857\nlong:120.852707\nspeed:0.00 \nT:17 const test = new Buffer('lat:14.632742\nlong:121.001790\nspeed:0.00\nT:17/06/05 16:21\nhttp://maps.google.com/maps?f=q&q=6.226433,125.075470&z=16\nPwr: ON Door: OFF ACC: OFF') console.log(tk103.parseTK103(test)); +console.log(tk103.parseTK103(smsrawSOSAlert)); + // // // console.log(tk103.parseTK103(smsrawOilAlert)); // console.log(tk103.parseTK103(smsrawSpeedingAlert));