function processTelegramData(telegram) {
      var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

      if (!_get(_getPrototypeOf(KamstrupMultical21Meter.prototype), "processTelegramData", this).call(this, telegram, options)) {
        return false;
      }

      telegram.setValue('BLOCKX_FN', Buffer.alloc(2, '0000', "hex"));
      telegram.setValue('BLOCKX_BC', Buffer.alloc(1, '00', "hex")); // If AES key is not provided directly, try to load it from meter data

      if (!options.hasOwnProperty('aes')) {
        var meterData = this.getMeterData(telegram);
        if (meterData && meterData.hasOwnProperty('aes')) options['aes'] = meterData['aes'];
      }

      if (options.hasOwnProperty('aes')) {
        telegram.setValue('BLOCK2_DECRYPTED_ELL_DATA', this.decryptTelegram(telegram, options)); // Fetch meter information

        telegram.setValues(this.processTelegramValues(telegram, options)); //console.log('---');
        //console.log(telegram.getPacket().getBuffer().toString('hex'));
        //console.log(this.getDecryptedELLData(telegram).toString('hex'));
        //console.log('-**-');
      }

      return true;
    }
/**
    * Process telegram by fetching meter values from raw data packet.
    *
    * @param telegram
    *   Telegram to be processed.
    * @param options
    *   aes - AES key if needed
    *
    * @return boolean succeed
    */
Process telegram by fetching meter values from raw data packet.
@param telegram
Telegram to be processed.
@param options
aes - AES key if needed

@return boolean succeed
Process telegram by fetching meter values from raw data packet . @param telegram Telegram to be processed . @param options aes - AES key if needed @return boolean succeed
function processTelegramData(telegram) {
      var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
      if (!_get(_getPrototypeOf(KamstrupMultical21Meter.prototype), "processTelegramData", this).call(this, telegram, options)) {
        return false;
      }
      telegram.setValue('BLOCKX_FN', Buffer.alloc(2, '0000', "hex"));
      telegram.setValue('BLOCKX_BC', Buffer.alloc(1, '00', "hex")); 
      if (!options.hasOwnProperty('aes')) {
        var meterData = this.getMeterData(telegram);
        if (meterData && meterData.hasOwnProperty('aes')) options['aes'] = meterData['aes'];
      }
      if (options.hasOwnProperty('aes')) {
        telegram.setValue('BLOCK2_DECRYPTED_ELL_DATA', this.decryptTelegram(telegram, options)); 
        telegram.setValues(this.processTelegramValues(telegram, options)); 
      }
      return true;
    }
function processTelegramData ( telegram ) { var options = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : { } ; if ( ! _get ( _getPrototypeOf ( KamstrupMultical21Meter . prototype ) , "processTelegramData" , this ) . call ( this , telegram , options ) ) { return false ; } telegram . setValue ( 'BLOCKX_FN' , Buffer . alloc ( 2 , '0000' , "hex" ) ) ; telegram . setValue ( 'BLOCKX_BC' , Buffer . alloc ( 1 , '00' , "hex" ) ) ; if ( ! options . hasOwnProperty ( 'aes' ) ) { var meterData = this . getMeterData ( telegram ) ; if ( meterData && meterData . hasOwnProperty ( 'aes' ) ) options [ 'aes' ] = meterData [ 'aes' ] ; } if ( options . hasOwnProperty ( 'aes' ) ) { telegram . setValue ( 'BLOCK2_DECRYPTED_ELL_DATA' , this . decryptTelegram ( telegram , options ) ) ; telegram . setValues ( this . processTelegramValues ( telegram , options ) ) ; } return true ; }
Process telegram by fetching meter values from raw data packet.
Process telegram by fetching meter values from raw data packet .
// If AES key is not provided directly, try to load it from meter data // Fetch meter information //console.log('---'); //console.log(telegram.getPacket().getBuffer().toString('hex')); //console.log(this.getDecryptedELLData(telegram).toString('hex')); //console.log('-**-');