RVS_BTDriver_OBD_DTC

public struct RVS_BTDriver_OBD_DTC

This enum defines the base for the OBD diagnostic trouble codes (DTCs). Each instance of this struct is a single DTC.

  • These are the letter substitutions for the DTC headers.

    Declaration

    Swift

    private static let _codeDesignations: [String]
  • he code, itself, is stored as a two-byte integer

    Declaration

    Swift

    private let _code: UInt16
  • This function will read the integer code, and return a “[P|U|C|B]****” string

    Declaration

    Swift

    private static func _convertCodeToString(_ inCode: UInt16) -> String!

    Parameters

    inCode

    The code (an unsigned, 16-bit integer).

    Return Value

    A String, in the DTC format (Alphabetic chracater -U, P, C or B, followed by four hex digits). Can be nil, if the code cannot be translated.

  • This function reads the hex string returned by the device, and renders it into the UInt16 necessary for use as the code.

    Declaration

    Swift

    private static func _convertStringToCode(_ inStringData: String) -> UInt16!

    Parameters

    inStringData

    The String data, raw from the command.

    Return Value

    The rendered code, as a UInt16.

  • This returns the code, in its “native” form.

    Declaration

    Swift

    var intValue: UInt16 { get }
  • This returns the code, in its alphanumeric (familiar) form.

    Declaration

    Swift

    var stringValue: String { get }
  • Initialize with a UInt16 code.

    Declaration

    Swift

    init(code inCode: UInt16)
  • Intiatlize with raw string data.

    Declaration

    Swift

    init(stringData inStringData: String)