public void log(Byte[] readBuffer) { if (readBuffer[0] == 0x03) { /* successful packet read */ CanPacket packet = new CanPacket(readBuffer); if (learnedPackets != null) { /* filter out learned packets */ if (!learnedPackets.Contains(packet)) { String packetString = packet.ToString(); updateRow(packetString); /* do the log file append on the UI thread to save cpu ticks */ appendToLogFile(packetString); } } else { /* no learned packets so log everything */ String packetString = packet.ToString(); updateRow(packetString); /* do the log file append on the UI thread to save cpu ticks */ appendToLogFile(packetString); } } else { updateStatusLabel("no"); } }