Crash on incoming message
AndrewLinden opened this issue · 2 comments
AndrewLinden commented
A message received from a device causes a crash:
cc-znp:AREQ <-- AF:incomingMsg, { groupid: 0, clusterid: 0, srcaddr: 61485, srcendpoint: 1, dstendpoint: 1, wasbroadcast: 0, linkquality: 73, securityuse: 0, timestamp: 6995389, transseqnumber: 0, len: 29, data: <Buffer 1c 34 12 07 0a 02 ff 4c 06 00 10 01 21 d8 0b 21 a8 13 24 16 00 00 00 00 21 27 02 20 5b> } +3m
/opt/xiaomi-zb2mqtt/node_modules/zcl-packet/lib/foundation.js:645
ru[dataType](name)(this);
^
TypeError: ru[dataType] is not a function
at Dissolve.<anonymous> (/opt/xiaomi-zb2mqtt/node_modules/zcl-packet/lib/foundation.js:645:21)
at Dissolve._transform (/opt/xiaomi-zb2mqtt/node_modules/dissolve/index.js:80:16)
at Dissolve.Transform._read (/opt/xiaomi-zb2mqtt/node_modules/dissolve/node_modules/readable-stream/lib/_stream_transform.js:184:10)
at Dissolve.Transform._write (/opt/xiaomi-zb2mqtt/node_modules/dissolve/node_modules/readable-stream/lib/_stream_transform.js:172:12)
at doWrite (/opt/xiaomi-zb2mqtt/node_modules/dissolve/node_modules/readable-stream/lib/_stream_writable.js:279:12)
at writeOrBuffer (/opt/xiaomi-zb2mqtt/node_modules/dissolve/node_modules/readable-stream/lib/_stream_writable.js:266:5)
at Dissolve.Writable.write (/opt/xiaomi-zb2mqtt/node_modules/dissolve/node_modules/readable-stream/lib/_stream_writable.js:211:11)
at Dissolve.Writable.end (/opt/xiaomi-zb2mqtt/node_modules/dissolve/node_modules/readable-stream/lib/_stream_writable.js:426:10)
at FoundPayload._getObj (/opt/xiaomi-zb2mqtt/node_modules/zcl-packet/lib/foundation.js:242:12)
at FoundPayload.parse (/opt/xiaomi-zb2mqtt/node_modules/zcl-packet/lib/foundation.js:79:18)
AndrewLinden commented
zcl-packet can't parse struct data types.
Fix is here: zigbeer/zcl-packet#7
jackchased commented
Thanks. I merged the zcl-packet PR.