Ecu Access

group Ecu_access

Functions

ECU_LIST_HANDLE XcpDetectEcus(API_HANDLE)

Sends device discovery multicast via UDP and returns a list of discovered devices.

Returns:

ECU_LIST_HANDLE

STRING_LIST_HANDLE XcpGetAllCharacteristics(API_HANDLE, const char *ecu_name, const char *channel_name)

Returns a list of all characteristics defined in the A2L file for the given ecu.

Returns:

STRING_LIST_HANDLE

STRING_LIST_HANDLE XcpGetAllMeasurements(API_HANDLE, const char *ecu_name, const char *channel_name)

Returns a list of all measurements defined in the A2L file for the given ecu.

Returns:

STRING_LIST_HANDLE

STRING_LIST_HANDLE XcpGetAllEcuNames(API_HANDLE)

Returns a list of all ECUs defined in the A2L file.

Returns:

STRING_LIST_HANDLE

BOOL XcpInit(API_HANDLE, const char *ecu_name, const char *channel_name, const char *a2l_file_path)

Initialize XCP for a given ECU by creating an instance and parsing the A2L file.

Parameters:
  • ecu_name – : name of the ECU, must match a module name in the A2L file

  • channel_name – : channel name like defined in the config file (*.yaml)

  • a2l_file_path – : path to the A2L file for this ECU

Returns:

BOOL

BOOL XcpDeinit(API_HANDLE, const char *ecu_name, const char *channel_name)

Removes an XCP instantance.

Parameters:
  • ecu_name – : name of the ECU, must match a module name in the A2L file

  • channel_name – : channel name like defined in the config file (*.yaml)

Returns:

BOOL

BOOL XcpSetConnectionStateCallback(API_HANDLE, const char *ecu_name, const char *channel_name, XcpConnectionStateCallback callback)

Allows to set a callback that is called when the ECU is connected/disconnected.

Parameters:
  • ecu_name – : name of the ECU, must match a module name in the A2L file

  • channel_name – : channel name like defined in the config file (*.yaml)

  • callback – : the function to call on a connect/disconnect

Returns:

BOOL

BOOL XcpConnect(API_HANDLE, const char *ecu_name, const char *channel_name, const XcpConnectionInfo *connection_info)

Establish connection with ECU and send initial XCP commands.

Parameters:
  • ecu_name – : name of the ECU, must match a module name in the A2L file

  • channel_name – : channel name like defined in the config file (*.yaml)

  • connection_info – : struct containing connection details (host address, port, etc.)

Returns:

BOOL

BOOL XcpDisconnect(API_HANDLE, const char *ecu_name, const char *channel_name)

Disconnect from the given ECU.

Parameters:
  • ecu_name – : name of the ECU, must match a module name in the A2L file

  • channel_name – : channel name like defined in the config file (*.yaml)

Returns:

BOOL

XcpReadResult XcpRead(API_HANDLE, const char *ecu_name, const char *channel_name, const char *a2l_object)

Reads the value of an object in the ECU (characteristic, measurement, etc.)

Parameters:
  • ecu_name – : name of the ECU, must match a module name in the A2L file

  • channel_name – : channel name like defined in the config file (*.yaml)

  • a2l_object – : name of the object to read

Returns:

XcpReadResult

XcpReadVResult XcpReadV(API_HANDLE, const char *ecu_name, const char *channel_name, const char *a2l_object, BOOL raw_value)

Reads the value of a (potentially complex) object in the ECU (characteristic, measurement, etc.)

Parameters:
  • ecu_name – : name of the ECU, must match a module name in the A2L file

  • channel_name – : channel name like defined in the config file (*.yaml)

  • a2l_object – : name of the object to read

  • raw_value – : if true, no conversion methods are applied and the raw memory value is returned

Returns:

XcpReadVResult

BOOL XcpWrite(API_HANDLE, const char *ecu_name, const char *channel_name, const char *a2l_object, double value)

Writes to an object in the ECU (characteristic, measurement, etc.)

Parameters:
  • ecu_name – : name of the ECU, must match a module name in the A2L file

  • channel_name – : channel name like defined in the config file (*.yaml)

  • a2l_object – : name of the object to write

  • value – : the value to write as double

Returns:

BOOL

BOOL XcpWriteV(API_HANDLE, const char *ecu_name, const char *channel_name, const char *a2l_object, XcpValue value, BOOL raw_value)

Writes a (potentially complex) value to an object in the ECU (characteristic, measurement, etc.)

Parameters:
  • ecu_name – : name of the ECU, must match a module name in the A2L file

  • channel_name – : channel name like defined in the config file (*.yaml)

  • a2l_object – : name of the object to write

  • value – : the value to write as XcpValue

  • raw_value – : if true, no conversion methods are applied and the value is written to memory as-is

Returns:

BOOL

BOOL XcpConfigure(API_HANDLE, const char *ecu_name, const char *channel_name, XcpConfigOption option, int32_t value)

Generic configuration function.

Parameters:
  • ecu_name – : name of the ECU, must match a module name in the A2L file

  • channel_name – : channel name like defined in the config file (*.yaml)

  • option – : the option to configure XCP_CFG_SEND_RECEIVE_RETRIES: number of retries if a command times out XCP_CFG_MESSAGE_TIMEOUT: the command timeout in ms (overwrites the value from the A2L file)

  • value – : the value to set for the configuration option

Returns:

BOOL