Skip to content

Case "1D Oxygen sensors present" in Descriptor01 (calculateStringForData()) #2

Description

@hellensoloviy

Method calculateStringForData(data:) in Descriptor01 class have some problems. Case 1D is returning an empty string.

    func calculateStringForData(data : Data) -> String? {
        switch pid {
        case 0x03:
            return calculateFuelSystemStatus(data)
        case 0x12:
            return calculateSecondaryAirStatus(data)
        case 0x13:
            return calculateOxygenSensorsPresent(data)
        case 0x1C:
            return calculateDesignRequirements(data)
        case 0x1D:
            return "" 
        case 0x1E:
            return calculateAuxiliaryInputStatus(data)
        default:
            return nil
        }
    }

As this article says

1D Oxygen sensors present (in 4 banks)

And it is almost like case 0x13, but there 4 banks instead of 2.
And I can see a not used method calculateOxygenSensorsPresentB() in Descriptor01. This method is very similar to calculateOxygenSensorsPresent() which used for case 0x13.

I recommend to use of to delete calculateOxygenSensorsPresentB() method, and fix case 0x1D.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions