Added isRetry field

This commit is contained in:
Ruakij 2021-11-24 21:11:19 +01:00
parent 3c3ab18410
commit c2210dfb59
2 changed files with 3 additions and 0 deletions

View File

@ -14,6 +14,7 @@ const PacketType = {
class Packet{
timestampMicros;
isRetry;
srcMac;
dstMac;

View File

@ -48,6 +48,8 @@ class PacketStreamFactory extends Transform{
// Convert time to epoch-micros Unfortunately luxon doesnt use micros, but millis as smallest time-unit requiring some "hacks"
packet.timestampMicros = DateTime.fromISO(data.slice(0, 12)).toSeconds() + data.slice(12, 15)/1000000;
packet.isRetry = data.match(/(^| )Retry($| )/i)? true: false;
packet.dataRate = Number(data.match(/(^| )([0-9]+(\.[0-9]+)?) Mb\/s($| )/i)?.[2]) || null;
packet.frequency = Number(data.match(/(^| )([0-9]{4}) MHz($| )/i)?.[2]) || null;