Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for location event sent from GPS tracker board GT02_MT6261D_V2.3 #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions gt06.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ Gt06.prototype.parse = function (data) {
case 0x12: // location message
Object.assign(parsed, parseLocation(msg));
break;
case 34: // location message
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same same
merge with case for 0x12

Object.assign(parsed, parseLocation(msg));
break;
case 0x13: // status message
Object.assign(parsed, parseStatus(msg));
parsed.expectsResponse = true;
Expand Down Expand Up @@ -86,6 +89,9 @@ function selectEvent(data) {
case 0x12:
eventStr = 'location';
break;
case 34:
Copy link
Owner

@vondraussen vondraussen Feb 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to have a hex case :)
and It could be added below the case 0x12 since it is the same code.

case 0x12:
case 0x22:
   Object.assign.....

eventStr = 'location';
break;
case 0x13:
eventStr = 'status';
break;
Expand Down