ex post clean solution for issue #510
This commit is contained in:
		
							parent
							
								
									f00397929b
								
							
						
					
					
						commit
						d180a56fd1
					
				@ -4,8 +4,6 @@
 | 
			
		||||
function Decoder(bytes, port) {
 | 
			
		||||
 | 
			
		||||
    var decoded = {};
 | 
			
		||||
    decoded.wifi = 0;
 | 
			
		||||
    decoded.ble = 0;
 | 
			
		||||
 | 
			
		||||
    if (bytes.length === 0) {
 | 
			
		||||
        return {};
 | 
			
		||||
 | 
			
		||||
@ -4,14 +4,24 @@
 | 
			
		||||
function Converter(decoded, port) {
 | 
			
		||||
 | 
			
		||||
  var converted = decoded;
 | 
			
		||||
  var pax = 0;
 | 
			
		||||
 | 
			
		||||
  if (port === 1) {
 | 
			
		||||
    converted.pax = converted.ble + converted.wifi;
 | 
			
		||||
 | 
			
		||||
    if ('wifi' in converted) {
 | 
			
		||||
      pax += converted.wifi
 | 
			
		||||
    }
 | 
			
		||||
    if ('ble' in converted) {
 | 
			
		||||
      pax += converted.ble
 | 
			
		||||
    }
 | 
			
		||||
    converted.pax = pax;
 | 
			
		||||
 | 
			
		||||
    if (converted.hdop) {
 | 
			
		||||
      converted.hdop /= 100;
 | 
			
		||||
      converted.latitude /= 1000000;
 | 
			
		||||
      converted.longitude /= 1000000;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return converted;
 | 
			
		||||
 | 
			
		||||
@ -3,8 +3,6 @@
 | 
			
		||||
 | 
			
		||||
function Decoder(bytes, port) {
 | 
			
		||||
  var decoded = {};
 | 
			
		||||
  decoded.wifi = 0;
 | 
			
		||||
  decoded.ble = 0;
 | 
			
		||||
 | 
			
		||||
  if (port === 1) {
 | 
			
		||||
    var i = 0;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user