lib/raddec.js
function constructFromObject(instance, source) {
  instance.transmitterId = identifiers.format(source.transmitterId);
  instance.transmitterIdType = source.transmitterIdType;
  instance.rssiSignature = source.rssiSignature || [];

  instance.rssiSignature.forEach(function(entry) {
    entry.receiverIdType = entry.receiverIdType || identifiers.TYPE_UNKNOWN;
    entry.rssi = entry.rssi || -Number.MAX_SAFE_INTEGER;
    entry.numberOfDecodings = entry.numberOfDecodings || 1;
    entry.rssiSum = entry.rssiSum || entry.rssi;
  });

  if(source.hasOwnProperty('packets')) {
    instance.packets = source.packets;
  }
  if(source.hasOwnProperty('timestamp')) {
    instance.timestamp = source.timestamp;
  }
  if(source.hasOwnProperty('events')) {
    instance.events = source.events;
  }
  if(source.hasOwnProperty('earliestDecodingTime')) {
    instance.earliestDecodingTime = source.earliestDecodingTime;
  }
  instance.creationTime = new Date().getTime();
}
function constructFromObject(instance, source) {
  instance.transmitterId = identifiers.format(source.transmitterId);
  instance.transmitterIdType = source.transmitterIdType;
  instance.rssiSignature = source.rssiSignature || [];

  instance.rssiSignature.forEach(function(entry) {
    entry.receiverIdType = entry.receiverIdType || identifiers.TYPE_UNKNOWN;
    entry.rssi = entry.rssi || -Number.MAX_SAFE_INTEGER;
    entry.numberOfDecodings = entry.numberOfDecodings || 1;
    entry.rssiSum = entry.rssiSum || entry.rssi;
  });

  if(source.hasOwnProperty('packets')) {
    instance.packets = source.packets;
  }
  if(source.hasOwnProperty('timestamp')) {
    instance.timestamp = source.timestamp;
  }
  if(source.hasOwnProperty('events')) {
    instance.events = source.events;
  }
  if(source.hasOwnProperty('earliestDecodingTime')) {
    instance.earliestDecodingTime = source.earliestDecodingTime;
  }
  instance.creationTime = new Date().getTime();
}
function constructFromObject ( instance , source ) { instance . transmitterId = identifiers . format ( source . transmitterId ) ; instance . transmitterIdType = source . transmitterIdType ; instance . rssiSignature = source . rssiSignature || [ ] ; instance . rssiSignature . forEach ( function ( entry ) { entry . receiverIdType = entry . receiverIdType || identifiers . TYPE_UNKNOWN ; entry . rssi = entry . rssi || - Number . MAX_SAFE_INTEGER ; entry . numberOfDecodings = entry . numberOfDecodings || 1 ; entry . rssiSum = entry . rssiSum || entry . rssi ; } ) ; if ( source . hasOwnProperty ( 'packets' ) ) { instance . packets = source . packets ; } if ( source . hasOwnProperty ( 'timestamp' ) ) { instance . timestamp = source . timestamp ; } if ( source . hasOwnProperty ( 'events' ) ) { instance . events = source . events ; } if ( source . hasOwnProperty ( 'earliestDecodingTime' ) ) { instance . earliestDecodingTime = source . earliestDecodingTime ; } instance . creationTime = new Date ( ) . getTime ( ) ; }
Construct the Raddec from an Object.
@param {Raddec} instance The given Raddec instance.
@param {Object} source The source as an Object.
Construct the Raddec from an Object .