processTelegramData(telegram, options = {}) {

    if (!super.processTelegramData(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')) {
      let 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
processTelegramData(telegram, options = {}) {
    if (!super.processTelegramData(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')) {
      let 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;
  }
processTelegramData ( telegram , options = { } ) { if ( ! super . processTelegramData ( 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' ) ) { let 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('-**-');