ECU Measurement and Calibration Toolkit C API Reference

Content Type
Programming Language
Current manual

mcECUConnect

mcECUConnect

Purpose

Establishes communication to the selected ECU through XCP or CCP. After a successful ECU Connect you can create a Measurement task or read/write a Characteristic.

Format

mcTypeStatus mcECUConnect(
mcTypeTaskRef ECURefNum);

Input

ECURefNum

ECURefNum is the task reference which links to the selected ECU. This reference is originally returned from mcECUSelectEx.

Output

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

mcECUConnect implements the XCP or CCP CONNECT command. It establishes a logical connection to an ECU, using the provided ECU Reference handle ECURefNum. Unless a slave device (ECU) is unconnected, it must not execute or respond to any command sent by the application. The only exception to this rule is the Test command, to which the XCP or CCP slave with the specific address may return an acknowledgement. Only a single XCP or CCP slave can be connected to the application at a time.

Was this information helpful?