diff --git a/lib/Af.js b/lib/Af.js index 416587e..d15a05a 100644 --- a/lib/Af.js +++ b/lib/Af.js @@ -126,6 +126,9 @@ class Af extends EventEmitter { if(zclDebug.enabled){ zclDebug(`0x${msg.srcaddr.toString(16)}:${msg.srcendpoint}->0x00:${msg.dstendpoint} (${zclData.seqNum}) ${msg.clusterid} ${frameType === 0 ? 'foundation' : 'functional'}(${zclData.cmdId}) ${JSON.stringify(zclData.payload)}`); } + + if (frameType === 0 && zclData.cmdId === 'report') + this.emit('ind:reported', { ep: remoteEp, cId: msg.clusterid, attrs: zclData.payload }); let zApp = targetEp.zive if(zApp){ @@ -139,9 +142,6 @@ class Af extends EventEmitter { if (zclData.cmdId === 'statusChangeNotification' && frameType === 1 && zclData.payload) { this.emit('ind:statusChange', { ep: remoteEp, cId: msg.clusterid, zclData: zclData, msg }); } - - if (frameType === 0 && zclData.cmdId === 'report') - this.emit('ind:reported', { ep: remoteEp, cId: msg.clusterid, attrs: zclData.payload }); const evt = {zclData, msg} this.emit('ZCL:incomingMsg', evt);