Skip to content

Commit

Permalink
fix(parser): Remove gpsSignal and add gpsStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
lgaticaq committed Oct 20, 2016
1 parent 24934b8 commit e419dd6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const data = meitrack.parse(raw);
alarm: { type: 'Gps' },
loc: { type: 'Point', coordinates: [ 79.960473, 7.092076 ] },
datetime: Sat Apr 12 2014 11:28:08 GMT-0200 (CLST),
gpsSignal: 'A',
gpsStatus: true,
satellites: 10,
gsmSignal: 9,
speed: 57,
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const getMvt380 = raw => {
coordinates: [parseFloat(match[7]), parseFloat(match[6])]
},
datetime: moment(`${match[8]}+00:00`, 'YYMMDDHHmmssZ').toDate(),
gpsSignal: match[9],
gpsStatus: match[9] === 'A',
satellites: parseInt(match[10], 10),
gsmSignal: parseInt(match[11], 10),
speed: parseFloat(match[12]),
Expand Down
2 changes: 1 addition & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('meitrack-parser', () => {
expect(data.loc.type).to.eql('Point');
expect(data.loc.coordinates).to.eql([-70.514245, -33.361133]);
expect(data.datetime).to.eql(new Date('2016-04-12T15:50:05.000Z'));
expect(data.gpsSignal).to.eql('A');
expect(data.gpsStatus).to.be.true;
expect(data.satellites).to.eql(8);
expect(data.gsmSignal).to.eql(27);
expect(data.speed).to.eql(0);
Expand Down

0 comments on commit e419dd6

Please sign in to comment.