Equipment-and-Tool-Institute / j1939-84

J1939-84 implementation for etools.org
MIT License
7 stars 6 forks source link

Freeze Frame Length Incorrect in 6.2.3 #1255

Closed ericthomasswenson closed 1 month ago

ericthomasswenson commented 1 year ago

The displayed length of 8 is the length of the DM24 response. The length of the freeze frame is 0

07:19:43.6798 Destination Specific DM24 Request to Exhaust Emission Controller (61) 07:19:43.6837 18EA3DF9 [3] B6 FD 00 (TX) 07:19:43.6948 18FDB63D [8] 20 11 1B 00 EB 10 1B 00 DM24 from Exhaust Emission Controller (61): [ D F T D F a r e M F t F s 5 l a r t 8 n SPN — SP Name

  T   0  SPN 4331 - AFT 1 DEF Actual Dosing Quantity
  T   0  SPN 4384 - AFT 2 DEF Actual Dosing Quantity

] Freeze Frame data length = 8 bytes

End Test 2.3 - DM24: SPN support

battjt commented 11 months ago

Current implementation is DM24 packet size:

        sb.append("Freeze Frame data length = " + getPacket().getLength()+" bytes").append(NL);

Should be Freeze frame size:

        var da = J1939DaRepository.getInstance();
        var ffDataLenth = getSupportedSpns().stream()
                                            .filter(s -> s.supportsExpandedFreezeFrame())
                                            .mapToInt(s -> {
                                                SpnDefinition spnDef = da.findSpnDefinition(s.getSpn());
                                                Slot slotDef = da.findSLOT(spnDef.getSlotNumber());
                                                return slotDef.getLength();
                                            })
                                            .sum();
        sb.append("Freeze Frame data length = " + ffDataLenth + " bytes").append(NL);