Skip to main content

DiagAPI

group DiagAPI

This includes APIs for application to support UDS diagnostic functionalities.

Members

enum RetType

ValuesDescriptions
OKSuccess case.
NOKFailure case.

Common return type for function.

enum OperationStatus

ValuesDescriptions
SUCCESSSuccess case.
NO_CONNECTED_CLIENTNo client is connected, App can ignore this.
RESPONSE_SIZE_TOO_LONGSize of the response is longer than configured.
APP_DID_READ_ERRORError while reading DID value.
APP_DID_WRITE_ERRORError while writing DID value.
APP_IO_CTRL_ERRORError while doing IO Control operation.
APP_NO_HANDLERNo Handler is registered for performing the operation.
APP_NRC_REQUEST_OUT_OF_RANGENRC 31.
APP_NRC_GENERAL_PROGRAMMING_FAILURENRC 72.

Specifies the final status of the operation requested.

enum RoutineControlType

ValuesDescriptions
ROUTINE_START
ROUTINE_STOP
ROUTINE_RESULT

Apps developers can ignore this type.

enum EventStatusType

ValuesDescriptions
EVENT_STATUS_NA
EVENT_STATUS_PASSED
EVENT_STATUS_FAILED
EVENT_STATUS_PREPASSED
EVENT_STATUS_PREFAILED
EVENT_STATUS_FDC_THRESHOLD_REACHED

Value of the Event status to set. The values are as per spec.

public void start()

Start the APP and DM communication interface.

This must be called before performing any other operations.

public void registerApp(int16_t appId)

Register this application using this appId.

APP Ids are used by the DM server for routing Service requests.

  • Parameters
    • appId Id of the application as defined in the configuration

public void setReadDIDHandler(ReadDIDHandler handler)

Set the Read DID Handler.

  • Parameters
    • handler call back function

public void setWriteDIDHandler(WriteDIDHandler handler)

Set the Write DID Handler object.

  • Parameters
    • handler call back function

public void setStartRoutineHandler(RoutineHandler handler)

Set the Start Routine Handler object.

  • Parameters
    • handler call back function

public void setStopRoutineHandler(RoutineHandler handler)

Set the Stop Routine Handler object.

  • Parameters
    • handler call back function

public void setfetchRoutineResultHandler(RoutineHandler handler)

Set the Get Routine Result handler.

  • Parameters
    • handler call back function

public void setEventStatus(EventIdType eid, EventStatusType status)

Set the DTC Event Status.

  • Parameters
    • eid Event Id
    • status Event Status

public void setIOControlByIdHandler(IOControlByIdHandler handler)

Set the IOControlBy DID handler.

  • Parameters
    • handler call back function

struct OperationResponse

This struct defines the response that Apps need to send back to the server.

Summary

MembersDescriptions
public OperationStatus operationStatusStatus of this operation.
public int32_t dataLengthLength of the response data.
public uint8_t * dataPointer to the response data.

Members

public OperationStatus operationStatus

Status of this operation.

public int32_t dataLength

Length of the response data.

public uint8_t * data

Pointer to the response data.

struct DataContainer

Generic container for all sorts of data transfer operations.

Summary

MembersDescriptions
public int32_t dataLengthLength of the data provided.
public uint8_t * dataPointer to the actual data provided.

Members

public int32_t dataLength

Length of the data provided.

public uint8_t * data

Pointer to the actual data provided.