filter.rejectPacket

This commit is contained in:
rusefillc 2024-07-25 21:37:38 -04:00
parent 10700106f7
commit 609733c64a
1 changed files with 10 additions and 1 deletions

View File

@ -12,6 +12,8 @@ import java.io.*;
import java.util.*;
public class ByteRateOfChangeReports {
public static Filter filter = packet -> false;
/**
* sweet baby O(n^2)
*/
@ -51,10 +53,13 @@ public class ByteRateOfChangeReports {
if (packet != null) {
prefix = packet.getName() + " ";
DbcField field = packet.getFieldAtByte(id.byteIndex);
if (field != null)
if (field != null) {
if (filter.rejectPacket(field))
continue;
prefix += field.getName() + " ";
}
}
}
if (id.getByteIndex() == 7 && context.withChecksum.contains(id.sid)) {
// skipping known checksum byte
@ -161,4 +166,8 @@ public class ByteRateOfChangeReports {
this.msg = msg;
}
}
public interface Filter {
boolean rejectPacket(DbcField dbcField);
}
}