index.js
function(message) {
    if (debug) console.log('Decoding HEP3 Packet...');
    try {
	var HEP = hepHeader.parse(message);
	if(HEP.payload && HEP.payload.length>0){
	  var data = HEP.payload;
	  var tot = 0;
	  var decoded = {};
	  var PAYLOAD;
	  while(true){
	    PAYLOAD = hepParse.parse( data.slice(tot) );
	    var tmp = hepDecode(PAYLOAD);
	    decoded = mixinDeep(decoded, tmp);
	    tot += PAYLOAD.length;
	    if(tot>=HEP.payload.length) { break; }
	  }
	  if(debug) console.log(decoded);
	  return decoded;
	}
    } catch(e) {
	return false;
    }

  }
function(message) {
    if (debug) console.log('Decoding HEP3 Packet...');
    try {
	var HEP = hepHeader.parse(message);
	if(HEP.payload && HEP.payload.length>0){
	  var data = HEP.payload;
	  var tot = 0;
	  var decoded = {};
	  var PAYLOAD;
	  while(true){
	    PAYLOAD = hepParse.parse( data.slice(tot) );
	    var tmp = hepDecode(PAYLOAD);
	    decoded = mixinDeep(decoded, tmp);
	    tot += PAYLOAD.length;
	    if(tot>=HEP.payload.length) { break; }
	  }
	  if(debug) console.log(decoded);
	  return decoded;
	}
    } catch(e) {
	return false;
    }

  }
function ( message ) { if ( debug ) console . log ( 'Decoding HEP3 Packet...' ) ; try { var HEP = hepHeader . parse ( message ) ; if ( HEP . payload && HEP . payload . length > 0 ) { var data = HEP . payload ; var tot = 0 ; var decoded = { } ; var PAYLOAD ; while ( true ) { PAYLOAD = hepParse . parse ( data . slice ( tot ) ) ; var tmp = hepDecode ( PAYLOAD ) ; decoded = mixinDeep ( decoded , tmp ) ; tot += PAYLOAD . length ; if ( tot >= HEP . payload . length ) { break ; } } if ( debug ) console . log ( decoded ) ; return decoded ; } } catch ( e ) { return false ; } }
Decode HEP3 Packet to JSON Object.

@param  {Buffer} hep message
@return {Object}
Decode HEP3 Packet to JSON Object .