Update and rename testing.js to testing.ttnv2.js

master
cheetah 4 years ago
parent 750837b2c7
commit 5f8de31fa4

@ -4,7 +4,7 @@ function Decoder(bytes, port) {
return a.map(function(x){ return String.fromCharCode(x) }).join('') // because very OLD js parser return a.map(function(x){ return String.fromCharCode(x) }).join('') // because very OLD js parser
} }
switch (port) { switch (port) {
case 1: // Technical Received Acknowledgment '|5||C|'' case 1: // Technical Received Acknowledgment '|5||C|'
// 31 32 33 34 35 20 // 31 32 33 34 35 20
data.type = 'ack' data.type = 'ack'
data.ack = 'recv' data.ack = 'recv'
@ -22,7 +22,13 @@ function Decoder(bytes, port) {
data.operationalData = bytesToString(bytes) data.operationalData = bytesToString(bytes)
} }
break; break;
case 5: // GPS Tracking Port case 3: // Status & Canned Messages
break;
case '4': // Battery and Power Notifications + SOS Trigger
break;
case 5: // GPS Tracking Port '|G|'
data.type = 'gps' data.type = 'gps'
data.latitude = ((bytes[0]<<24)>>>0) + ((bytes[1]<<16)>>>0) + ((bytes[2]<<8)>>>0) + bytes[3] data.latitude = ((bytes[0]<<24)>>>0) + ((bytes[1]<<16)>>>0) + ((bytes[2]<<8)>>>0) + bytes[3]
data.latitude /= 10e4 data.latitude /= 10e4
Loading…
Cancel
Save