ECU Measurement and Calibration Toolkit C API Reference

Content Type
Programming Language
Current manual

mcGetNamesLength

mcGetNamesLength

Purpose

Retrieves the amount of memory required to store the names returned by mcGetNames.

Format

mcTypeStatus mcGetNamesLength(
mcTypeTaskRef RefNum,
u32 Type,
cstr ECUName,
u32 *SizeOfNamesList);

Input

RefNum

RefNum is any ECU M&C task reference which consists of a valid link to the opened A2L database (DBRefNum), a selected ECU (ECURefNum) or a Measurement task (DAQRefNum). RefNum has to be valid for the related Type.

Type

Specifies the Type of names to return.

0mcTypeECUNames

Returns a list of ECU names.

1mcTypeMeasurementNames

Returns a list of Measurement names.

2mcTypeCharacteristicNames

Returns a list of Characteristic names.

3mcTypeEventChannelNames

Returns a list of Event Channel names.

4mcTypeDefinedPagesNames

Returns a list of Calibration page names.

5mcTypeGroupNames

Returns a list of Group names.

6mcTypeGroup_SubGroupNames

Returns a list of Subgroup names of the specified Group name.

7mcTypeGroup_MeasurementNames

Returns a list of Measurement names within the specified Group.

8mcTypeGroup_CharacteristicNames

Returns a list of Characteristic names within the specified Group.

9mcTypeFuncNames

Returns a list of Function names within the specified ECU.

10mcTypeFunc_DefCharacNames

Returns a list of Characteristic names referred by the DEF_CHARACTERISTIC keyword within the related Function.

11mcTypeFunc_RefCharacNames

Returns a list of Characteristic names referred by the REF_CHARACTERISTIC keyword within the related Function.

12mcTypeFunc_InMeasNames

Returns a list of Measurement names referred by the IN_MEASUREMENT keyword within the related Function.

13mcTypeFunc_OutMeasNames

Returns a list of Measurement names referred by the OUT_MEASUREMENT keyword within the related Function.

14mcTypeFunc_LocMeasNames

Returns a list of Measurement names referred by the LOC_MEASUREMENT keyword within the related Function.

15mcTypeFunc_SubFuncNames

Returns a list of Function names referred by the SUB_FUNCTION keyword within the related Function.

16mcTypeGroup_FunctionListNames

Returns a list of Function names referred by the FUNCTION_LIST keyword within the related Group.

17mcTypeTLI_XcpOnCanNames

Returns a list of Transport Layer Instance names of the XCP_ON_CAN blocks within the IF_DATA XCPplus block. No entries are returned for XCP_ON_CAN blocks without the TRANSPORT_LAYER_INSTANCE keyword or an XCP_ON_CAN block within an IF_DATA XCP block.

18cTypeTLI_XcpOnTcpNames

Returns a list of Transport Layer Instance names of the XCP_ON_TCP_IP blocks within the IF_DATA XCPplus block. No entries are returned for XCP_ON_TCP_IP blocks without the TRANSPORT_LAYER_INSTANCE keyword or an XCP_ON_TCP_IP block within an IF_DATA XCP block.

19mcTypeTLI_XcpOnUdpNames

Returns a list of Transport Layer Instance names of the XCP_ON_UDP_IP blocks within the IF_DATA XCPplus block. No entries are returned for XCP_ON_UDP_IP blocks without the TRANSPORT_LAYER_INSTANCE keyword or an XCP_ON_UDP_IP block within an IF_DATA XCP block.

ECUName

If the Type = mcTypeMeasurementNames or Type = mcTypeCharacteristicNames and RefNum contains a DBRefNum, the corresponding ECU name has to be referenced in order to access ECU specific properties. If RefNum contains an ECURefNum or DAQRefNum the parameter ECUName is ignored and can be set to NULL.

Output

SizeOfNamesList

Number of bytes required for mcGetNames to return all names for the specified ECUName and Type. After calling mcGetNamesLength, you can allocate an array of size SizeofNamesList, then pass that array to mcGetNames using the same input parameters. This ensures that mcGetNames will return all names without error.

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

After calling mcGetNamesLength, you can allocate an array of size SizeofNamesList, then pass that array to mcGetNames using the same input parameters. This ensures that mcGetNames will return all names without error.

If using mcGetNamesLength to query the length of the list of supported event channels on an ECU, the event channels might be stored inside the ECU instead of the A2L file. To query these event channel names from the ECU directly, connect to the ECU using mcECUConnect before calling mcGetNamesLength.

Was this information helpful?