From 780e13735ad0e64e824d956ed8483ceb99880341 Mon Sep 17 00:00:00 2001 From: Christoph Wiechert Date: Tue, 8 Dec 2020 11:42:08 +0100 Subject: [PATCH] Fix: Don't parse HM-IP Flags due to lack of knowledge --- app/src/SnifferParser.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/src/SnifferParser.ts b/app/src/SnifferParser.ts index 8fca6f2..69fac77 100644 --- a/app/src/SnifferParser.ts +++ b/app/src/SnifferParser.ts @@ -88,13 +88,20 @@ export default class SnifferParser extends Transform { return callback(); } + const type = getType(parseInt(line.substr(9, 2), 16)); + let flags = []; + // Only parse HM-Flags. We've not enough knowlege to understand HM-IP Flags Byte + if(type !== 'HMIP_TYPE') { + flags = getFlags(parseInt(line.substr(7, 2), 16)); + } + const telegram: Telegram = { tstamp: Date.now(), rssi: -1 * parseInt(line.substr(1, 2), 16), len: parseInt(line.substr(3, 2), 16), cnt: parseInt(line.substr(5, 2), 16), - flags: getFlags(parseInt(line.substr(7, 2), 16)), - type: getType(parseInt(line.substr(9, 2), 16)), + flags, + type, fromAddr, toAddr, fromName: fromDev && fromDev.name || '',