more content into middle file

This commit is contained in:
rusefillc 2023-09-22 14:05:43 -04:00
parent 758f825655
commit 17d1495ac2
2 changed files with 15 additions and 1 deletions

View File

@ -75,6 +75,18 @@ public class CANPacket {
return Byte.toUnsignedInt(data[index]);
}
public Object getBytesAsString() {
StringBuilder result = new StringBuilder();
for (int index = 0; index < data.length; index++) {
if (index > 0)
result.append(" ");
result.append(String.format("0x%02x", data[index]));
}
return result;
}
public interface PackerAssertion {
boolean test(CANPacket packet);
}

View File

@ -50,7 +50,9 @@ public class PerSidDump {
String middleOutputFileName = filteredDestinationFolder + File.separator + simpleFileName + "_filtered_" + dualSid(sid, "_") + "_middle.txt";
PrintWriter middle = new PrintWriter(new FileOutputStream(middleOutputFileName));
middle.println(middlePacket.asLua("payload" + middlePacket.getId()));
middle.println(middlePacket.asLua("payload" + middlePacket.getId())
+ "\n"
+ middlePacket.getBytesAsString());
middle.close();
}
}