Added isRetry field

f_influx-checks
Ruakij 3 years ago
parent 3c3ab18410
commit c2210dfb59

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

@ -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" // 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.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.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; packet.frequency = Number(data.match(/(^| )([0-9]{4}) MHz($| )/i)?.[2]) || null;

Loading…
Cancel
Save