mcCCPDiagService
- Updated2023-02-21
- 2 minute(s) read
mcCCPDiagService
Purpose
Calls an implementation-specific diagnostic service on the ECU (CCP only).
Format
mcTypeStatus | mcCCPDiagService(
|
Input
ECURefNum
ECURefNum is the task reference which links to the selected ECU. This reference is originally returned from mcECUSelectEx.
ServiceNo
ServiceNo determines the diagnostic service that is executed inside the ECU. For more information about the services that are implemented in the ECU refer to the documentation for the ECU.
Params
Params passes an array of bytes to the ECU that might be needed by the ECU to run the diagnostic service. Since the definition of the parameters is specific to the implementation of the ECU, the parameters can only be passed as an array of bytes. It is your responsibility to pass the correct number of parameters in the correct byte ordering to this function.
Output
ResultLength
ResultLength returns the number of bytes that can be uploaded from the ECU as a result of the execution of the service. The result of this service can be accessed by calling the function mcCCPGetResult right after mcCCPDiagService.
DataType
DataType is a data type qualifier which provides information about the data type of the result of the diagnostic service.
Return Value
The return value indicates the status of the function call as a signed 32-bit integer. Zero means the function executed successfully. A negative value specifies an error, which means the function did not perform the expected behavior. A positive value specifies a warning, which means the function performed as expected, but a condition arose that may require attention.
Use the mcStatusToString function of the ECU M&C API to obtain a descriptive string for the return value.
Description
mcCCPDiagService implements the CCP command DIAG_SERVICE which calls a diagnostic service on the ECU and waits until it is finished. The selected ServiceNo specifies the diagnostic service that has to be executed inside the ECU. For more information about the available services that are implemented in the ECU refer to the documentation for the ECU.
The result of this service can be accessed by calling the function mcCCPGetResult right after mcCCPDiagService.