Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.

...

Info
View file
nameLGT-92_LoRa_GPS_Tracker_UserManual_v1.4.1.pdf
height250


Codeblock
languagejs
titleTTN_Payload
collapsetrue
 //The function is :
 function Decoder(bytes, port) {
 // Decode an uplink message from a buffer
 // (array) of bytes to an object of fields.
 var value=bytes[0]<<16 | bytes[1]<<8 | bytes[2];
 if(bytes[0] & 0x80)
 {
   value |=0xFFFFFF000000;
 }
 var latitude=value/10000;//gps latitude,units: °
 
  value=bytes[3]<<16 | bytes[4]<<8 | bytes[5];
 if(bytes[3] & 0x80)
 {
   value |=0xFFFFFF000000;
 }
 var longitude=value/10000;//gps longitude,units: °
 
 var alarm=(bytes[6] & 0x40)?"TRUE":"FALSE";//Alarm status
 
 value=((bytes[6] & 0x3f) <<8) | bytes[7];
 var batV=value/1000;//Battery,units:
 
  value=bytes[8]<<8 | bytes[9];
 if(bytes[8] & 0x80)
 
 {
   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: °
 
  return {
 Latitude: latitude,
 Longitud: longitude,
 Roll: roll,
 Pitch:pitch,
 BatV:batV,
 ALARM_status:alarm,
 };
 }


Verwandte Artikel

Inhalt nach Stichwort
showLabelsfalse
max5
spacesLOR
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel in ("dragino","lgt-92","gps","tacker") and type = "page" and space = "LOR"
labelsGPS Tacker Dragino LGT-92

...