mcGetNames
- Updated2023-02-21
- 3 minute(s) read
mcGetNames
Purpose
Retrieves a comma-separated list of ECU names, Measurement names, Characteristic names, Event names, Characteristic pages, or Group names from a specified A2L database.
Format
mcTypeStatus | mcGetNames(
|
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.
0—mcTypeECUNames
Returns a list of ECU names. You can pass one of the returned names to mcECUSelectEx.
1—mcTypeMeasurementNames
Returns a list of Measurement names. You can pass the returned NamesList to mcDAQInitialize.
2—mcTypeCharacteristicNames
Returns a list of Characteristic names. You can pass a single name out of the NamesList to mcCharacteristicWrite or mcCharacteristicRead.
3—mcTypeEventChannelNames
Returns a list of Event Channel names.
4—mcTypeDefinedPagesNames
Returns a list of Calibration page names.
5—mcTypeGroupNames
Returns a list of Group names.
6—mcTypeGroup_SubGroupNames
Returns a list of Subgroup names of the specified Group name.
7—mcTypeGroup_MeasurementNames
Returns a list of Measurement names within the specified Group.
8—mcTypeGroup_CharacteristicNames
Returns a list of Characteristic names within the specified Group.
9—mcTypeFuncNames
Returns a list of Function names within the specified ECU.
10—mcTypeFunc_DefCharacNames
Returns a list of Characteristic names referred by the DEF_CHARACTERISTIC keyword within the related Function.
11—mcTypeFunc_RefCharacNames
Returns a list of Characteristic names referred by the REF_CHARACTERISTIC keyword within the related Function.
12—mcTypeFunc_InMeasNames
Returns a list of Measurement names referred by the IN_MEASUREMENT keyword within the related Function.
13—mcTypeFunc_OutMeasNames
Returns a list of Measurement names referred by the OUT_MEASUREMENT keyword within the related Function.
14—mcTypeFunc_LocMeasNames
Returns a list of Measurement names referred by the LOC_MEASUREMENT keyword within the related Function.
15—mcTypeFunc_SubFuncNames
Returns a list of Function names referred by the SUB_FUNCTION keyword within the related Function.
16—mcTypeGroup_FunctionListNames
Returns a list of Function names referred by the FUNCTION_LIST keyword within the related Group.
17—mcTypeTLI_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.
18—cTypeTLI_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.
19—mcTypeTLI_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.
SizeOfNamesList
Size of the buffer provided to take the names list. After calling mcGetNamesLength, you can allocate an array of size SizeofNamesList, and then pass that array to mcGetNames using the same input parameters. This ensures that mcGetNames will return all names without error.
Output
NameList
Returns the comma-separated list of names specified by Type.
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
Get a comma-separated list of ECU, Measurement, Characteristic, or Event Channel names from a specified A2L database file.
If using mcGetNames to query 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 mcGetNames.