www.dragino.com
LGT-92 LoRa GPS Tracker User Manual
15 / 36
value
|=
0xFFFF0000
;
}
var roll
=
value
/
100
;
//roll,units: °
value
=
bytes
[
10
]<<
8
|
bytes
[
11
];
if
(
bytes
[
10
]
&
0x80
)
{
value
|=
0xFFFF0000
;
}
var pitch
=
value
/
100
;
//pitch,units: °
var json
={
roll
:
roll
,
pitch
:
pitch
,
batV
:
batV
,
alarm
:
alarm
};
var value
=
bytes
[
0
]<<
16
|
bytes
[
1
]<<
8
|
bytes
[
2
];
if
(
bytes
[
0
]
&
0x80
)
{
value
|=
0xFFFFFF000000
;
}
var value2
=
bytes
[
3
]<<
16
|
bytes
[
4
]<<
8
|
bytes
[
5
];
if
(
bytes
[
3
]
&
0x80
)
{
value2
|=
0xFFFFFF000000
;
}
if
(
value
==
0x0FFFFF
&&
value2
==
0x0FFFFF
)
{
//gps disabled (low battery)
}
else
if
(
value
===
0
&&
value2
===
0
)
{
//gps no position yet
}
else
{
json
.
latitude
=
value
/
10000
;
//gps latitude,units: °
json
.
longitude
=
value2
/
10000
;
//gps longitude,units: °
}
return
json
;
}
Save the change the uplink message will be parsed. As below: