Skip to content

Commit

Permalink
Fix: Don't parse HM-IP Flags due to lack of knowledge
Browse files Browse the repository at this point in the history
  • Loading branch information
psi-4ward authored Dec 8, 2020
1 parent 31f0211 commit 780e137
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/src/SnifferParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 || '',
Expand Down

0 comments on commit 780e137

Please # to comment.