Internal APIs

API entry point

Entry point for the ecu.test Internal API. The Internal API can be used in many expression controls inside test steps and utilities by using api.

For using it inside function variables and other user code, the Internal API can be instantiated the following way:

from tts.core.api.internalApi.Api import Api
api = Api()

API

class Api

Entry point for the Internal API.

AnalysisEnvironment

Object for the AnalysisEnvironment

Credentials

Access to Credentials for handling Credentials such as certificates and private keys.

CurrentTestConfiguration

Object for the TestConfiguration

CurrentTestbenchConfiguration

Object for the TestbenchConfiguration

DataBrowser

Object for the DataBrowser

Ethernet

Access to various Ethernet related packet types

GlobalConstants

Object for the GlobalConstants

KeywordCatalog

Offers key word catalog access methods

Math

Object for Math

Multimedia

Object for MultimediaApi

ObjectApi

Use this to access the Object API internally

Scm

Object for Scm

Service

Object for Service

TestBench

Provides access to the TestBench

TestEnvironment

Object for the TestEnvironment

TestGuideApiClient

Object for TestGuideApiClient

TestManagement

Object for the TestManagementApi

ToolAccess

Access to ToolAccess for handling job execution.

UnitInfo

Object for the UnitInfo

GeneratePackageDocumentation(pkgPath, docPath, doasync=True)

Creates documentation file(s) for a package or all packages in a folder depending on the given path

Parameters:
pkgPath : str

Path of either a package or a folder containing packages

docPath : str

Path where the documentation files will be created

doasync : bool

Mode of execution: asynchronous if True otherwise synchronous

Returns:

Path of the generated (index) document if synchronous mode, otherwise None

Return type:

str or None

GetAppName()

Returns the application name. :rtype: str

GetSetting(value)

Returns a value from the settings file. Possible values are:

  • configPath

  • errorLogFile

  • generatorPath

  • imagePath

  • language

  • logFile

  • offlineFiuPath

  • offlineModelPath

  • offlineSgbdPath

  • packagePath

  • parameterPath

  • reportPath

  • settingsPath

  • templatePath

  • traceFileDir

  • traceStepPath

  • userPyModulesPath

  • utilityPath

  • workspacePath

Parameters:
value : str

The setting to return

Returns:

The current value

Return type:

str or None

GetVersion()

Returns the ecu.test version.

Return type:

str

IsRunner()

API classes

AnalysisEnvironment

class AnalysisEnvironment

Object of analysis job procedure engine.

ExecutionInfo

The current AnalysisExecutionInfo object.

Type:

list

ClearSignalCache()

Removes all signals from the signal cache.

Info

Calling this method can be useful in large projects analyzing many object signals (signals that are not of a primitive data type). Object signals are cached in memory. Thus, if the analyses of the project access different object signals, the memory consumption is continuously increasing. Calling this method frees all the memory consumed by the signal cache.

This method should be called at some point in the project, when it is known that most of the previously used signals are not required anymore for the following analyses or if the memory consumption has to be reduced. Calling this method too often, has a negative effect on the execution time.

In order to ensure that the signal cache is cleared completely, this method should be called in a separate episode or the test case part of a package.

AnalysisExecutionInfo

class AnalysisExecutionInfo

Provides information for current analysis job execution

JobResult

The result of the current analysis job

Info

During job execution only completed episodes (and child trace steps) are considered. This means, the results of assertions and other steps above an episode are not considered.

Type:

str

LogFolder

Folder where trace and logging files of the current analysis job are saved during execution

Info

This may be a temporary location, in case a network drive is used. TargetReportDbFolder may be used to deduce the final location from the final report location.

Type:

str

ReportDb

Path to report database of current (or most recent) analysis job execution

Type:

str

ReportDbFolder

Folder of the report database of the current analysis job during execution

Info

This may be a temporary location, in case a network drive is used. TargetReportDbFolder returns the final location instead.

Type:

str

StartTime

Time where the current analysis job execution began

Type:

str

TargetReportDbFolder

Folder of the report database of the current analysis job execution after job completion.

Info

Trace and logging files may be located in the respective subfolders. In case a network drive is used, a temporary location is used during execution that is returned by ReportDbFolder.

Type:

str

GetCurrentPackageFilename()

Returns the path to the package containing the episode that is currently running

Returns:

Path to the package

Return type:

str

GetMainPackageFilename()

Returns the path to the main package

Returns:

Path to the main package

Return type:

str

GetWatchTime(key='DefaultWatch')

Returns the difference between the current time and the start of a watch

Parameters:
key='DefaultWatch'

The identifier of the watch

Returns:

The time difference [ms]

Return type:

int

StartWatch(key='DefaultWatch')

Starts a watch or resets an existing watch

Parameters:
key : str

The identifier of the watch

BusSystem

class BusSystem

A Bus system

Channel

The channel

Type:

str

Database

The filename

Type:

str

Name

The name

Type:

str

BusSystems

class BusSystems

Container for BusSystems. Item Type: BusSystem

Count

The number of items in the collection

Type:

int

Item(idx)

Returns the item at the specified index

Parameters:
idx : int

The index

Returns:

The item at index idx

Return type:

object

Constant

class Constant

A global constant

Description

Returns the description of this constant

Type:

str

Name

Returns the name of this constant

Type:

str

Value

Returns the defined value of this constant

Type:

str

Constants

class Constants

Container for Constants. Item Type: Constant

Count

The number of items in the collection

Type:

int

Item(idx)

Returns the item at the specified index

Parameters:
idx : int

The index

Returns:

The item at index idx

Return type:

object

Ecu

class Ecu

An ECU

A2l

The filename of the A2L file

Type:

str

DebugHex

The filename of the debugger HEX file

Type:

str

Elf

The filename of the ELF file

Type:

str

Elfs

The filenames of the ELF files

Type:

str

Hex

The filename of the HEX file

Type:

str

Name

The name

Type:

str

Sgbd

The filename of the SGBD file

Type:

str

Ecus

class Ecus

Container for Ecus. Item Type: Ecu

Count

The number of items in the collection

Type:

int

Item(idx)

Returns the item at the specified index

Parameters:
idx : int

The index

Returns:

The item at index idx

Return type:

object

EnvironmentCommunication

class EnvironmentCommunication

An environment communication system

Name

The name

Type:

str

EnvironmentCommunications

class EnvironmentCommunications

Container for environment communication systems. Item Type: EnvironmentCommunication

Count

The number of items in the collection

Type:

int

Item(idx)

Returns the item at the specified index

Parameters:
idx : int

The index

Returns:

The item at index idx

Return type:

object

EnvironmentSimulation

class EnvironmentSimulation

An environment simulation system

Name

The name

Type:

str

OfflineFile

The offline file

Type:

str

EnvironmentSimulations

class EnvironmentSimulations

Container for environment simulation systems. Item Type: EnvironmentSimulation

Count

The number of items in the collection

Type:

int

Item(idx)

Returns the item at the specified index

Parameters:
idx : int

The index

Returns:

The item at index idx

Return type:

object

GlobalConstants

class GlobalConstants

This class represents a container for holding global constants. Use:

GlobalConstants.YourConstantName

to get the value of any self defined constant.

GetConstant(name, default=NOT_SET)

Returns the value of the given constant

Parameters:
default=NOT_SET

The default value to return if the constant does not exists. If this is not set, an exception is raised in this case.

name : str

The name of the constants to retrieve the value

Returns:

The value of the constant

Return type:

Any

GetConstants()

Returns a list of names containing all constants defined in this container

Returns:

A list of names

Return type:

list[str]

ORIGIN_DEFINED_AT_RUNTIME = 'defined at runtime'
ORIGIN_MANIPULATED_AT_RUNTIME = 'manipulated at runtime'

KeywordCatalog

class KeywordCatalogApi

Internal API for keyword catalog accesses

Connect()

Tries to establish a connection to the keyword catalog server defined in the workspace settings

Returns:

The connection state: True if the connection has been established, else False

Return type:

bool

GetAvailableCatalogs()

Returns the available catalogs of the current project

Returns:

List of available catalog names

Return type:

list<str>

GetAvailableProjects()

Returns the available projects

Returns:

List of available project names

Return type:

list<str>

GetAvailableVariants()

Returns the available variants

Returns:

List of available variant names

Return type:

list<str>

GetCurrentCatalogName()

Returns the name of the loaded keyword catalog or None, if no catalog has been loaded

Returns:

Name of current catalog or None

Return type:

str or None

GetCurrentProject()

Returns the name of the current project or None, if no project has been configured

Returns:

Current project name or None

Return type:

str or None

GetCurrentVariant()

Returns the name of the current variant or None, if no variant has been configured

Returns:

Current variant name or None

Return type:

str or None

IsConnected()

Returns the connection state to the keyword catalog server

Returns:

True, if the connection has already been established, else False

Return type:

bool

LoadCatalog(catalogName)

Loads the referenced catalog

Parameters:
catalogName : str

Name of the catalog

Raises:

exception – If an invalid catalog name has been referenced

SetProject(projectName)

Sets the referenced project

Parameters:
projectName : str

Project name

Raises:

exception – If an invalid project name has been referenced

SetVariant(variantName)

Sets the referenced variant

Parameters:
variantName : str

Variant name

Raises:

exception – If an invalid variant name has been referenced

Math

class Math

Functions for Math

static RandomValue(value, absTolerance, stepSize=0)

Evaluates a random value around a center

Parameters:
value : float

Center for the range of possible values

absTolerance : float

Tolerance for the used value range (must be >= 0)

stepSize : float

Step size which is used to partition the value range (0 for continous distribution (must be >= 0))

Returns:

Random value (value - absTolerance <= returnValue <= value + absTolerance)

Return type:

float

static RandomValueMinMax(minValue, maxValue, stepSize=0, includeMinValue=True, includeMaxValue=False)

Evaluates a random value in the from minValue to maxValue. It can be parameterized whether the interval includes minValue (default True) and maxValue (default False).

Parameters:
minValue : float

Center for the range of possible values

maxValue : float

Tolerance for the used value range (must be >= 0)

stepSize : float

Step size which is used to partition the value range (0 for continous distribution (must be >= 0))

includeMinValue : bool

True if the minValue should be part of the distribution values (closed interval), else False.

includeMaxValue : bool

True if the maxValue should be part of the distribution values (closed interval), else False.

Returns:

Random value (minValue <= returnValue <= maxValue)

Return type:

float

Model

class Model

A Model

Name

The name

Type:

str

Models

class Models

Container for Models. Item Type: Model

Count

The number of items in the collection

Type:

int

Item(idx)

Returns the item at the specified index

Parameters:
idx : int

The index

Returns:

The item at index idx

Return type:

object

Multimedia

Entry point in the internal api for multimedia content

class ImageFiltersApi

Provides access to image filters. Filters are grouped into the two namespaces default and user. The following filters are provided by ecu.test out of the box:

  • default.BlurFilter(image, Type='GAUSS', Kernelsize=15)

  • default.BWFilter(image, Threshold=-1)

  • default.ColorFilter(image, Colors=["#ff0000"], Tolerance=5)

  • default.ContrastFilter(image, Contrast=1, Brightness=0)

  • default.HSVFilter(image, Hue=0, Saturation=1, Value=1)

  • default.InvertFilter(image)

  • default.RotationFilter(image, Angle=90)

To call a filter you can pass an image object as first argument, followed by any parameter the filter expects. Note that the filter parameters must be passed as keyword arguments. They cannot be passed as positional arguments. If a parameter is omitted it will be filled with its default value. For example to increase the brightness of an image:

>>> filteredImage = api.Multimedia.ImageFilters.default.ContrastFilter(image, Brightness=100)

Any user-defined image filter will appear under the namespace user. Suppose you implemented a custom filter and placed it in the UserPyModules directory. The filter could then be accessed via api.Multimedia.ImageFilters.user.MyCustomFilter.

Note that all filters will show up in a flat list without accounting for any file system hierarchies. For example a filter located at “UserPyModules/My Image Filters/MyCustomFilter.py” will still show up as user.MyCustomFilter. Therefore please make sure that your filters use unique module names in order to avoid name clashes.

class MultimediaApi

Provides access to multimedia content at runtime

ImageFilters

Object for ImageFiltersApi

Type:

list

GetAvailableOCRServices()

Returns a list of available OCR services. These identifiers can be used with GetOCRService.

Returns:

A list of OCR service identifiers

Return type:

list<str>

GetAvailableSTTProfiles()

Returns the currently available profiles for speech-to-text.

Returns:

A list of profile dictionaries containing the configured serviceId, profileName, language for each profile.

Return type:

list<dict<str:str>>

GetAvailableTTSVoices()

Gets the currently available voices for text-to-speech output.

Returns:

Returns a list of voice dictionaries containing the configured serviceId, voiceName, voiceLanguage, voiceGender for each voice.

Return type:

list<dict<str:str>>

GetDefaultOCRService(sut=None)

Returns the OCR service that is configured in the active test configuration.

Parameters:
sut : str | None

The system under test whose OCR service should be created. Can be omitted if only one system for media access exists.

Returns:

A new OCR service instance configured according to the test configuration

Return type:

OCRService

GetOCRService(serviceId)

Creates a new OCR service instance from a given sevice ID.

Parameters:
serviceId : str

Identifier of the OCR service to be created

Returns:

A new OCR service instance

Return type:

OCRService

SpeechToText(audioBlock, profile=None)

Converts voice to text. Returns the recognized text as a string.

Parameters:
audioBlock : AudioBlock

The audio recording that should be converted to text.

profile : dict

The profile to be used for speech recognition, identified by a dictionary containing serviceId, profileName, language and description. See GetAvailableSTTProfiles() for a list of valid values. If no profile is provided, the default profile that is configured in the test configuration will be used.

Returns:

The recognized text

Return type:

str

TextToSpeech(text, voice=None, parameters=None)

Converts text to speech. Returns the spoken text as an AudioBlock.

Parameters:
text : str

The text that should be converted to speech

voice : dict

The voice to use for speech generation, identified by a dictionary containing serviceId, voiceName, voiceLanguage and voiceGender. See GetAvailableTTSVoices() for a list of valid values. If no voice is provided, the default voice from the current test configuration will be used.

parameters : dict

Optional dictionary with parameters for speech generation. For example the default parameters are {'pitch': 0, 'speed': 1}

Returns:

An AudioBlock containing the spoken text

Return type:

AudioBlock

Scm

class Scm

Functions for SCM

GetCheckoutRevision()

Returns the revision number of the actual workspace repository

Returns:

  • The revision of the actual workspace repository

  • An empty string if the workspace is not versioned

  • None if SCM is not available or not enabled in the user settings

Return type:

str or None

GetFileRevision(filename)

Returns the revision number of a given file

Parameters:
filename : str

Path to the file. Relative paths will be evaluated as relative to the workspace directory.

Returns:

  • The revision of the file, e.g. u”8524” or u”8524m” for a locally modified file

  • An empty string if the file does not exist or is not versioned

  • None if SCM is not available or not enabled in the user settings

Return type:

str or None

GetFileStatus(filename)

Returns the status of a given file

Parameters:
filename : str

Path to the file. Relative paths will be evaluated as relative to the workspace directory

Returns:

  • The SCM status of the file for a locally modified file

  • An empty string if the file does not exist or is not versioned

  • None if SCM is not available or not enabled in the user settings

Return type:

str or None

GetUrl()

Returns the SCM-URL of the workspace directory

Returns:

  • The URL of the workspace

  • None if SCM is not available or not enabled in the user settings

Return type:

str or None

Service

Entry point in the internal api for the Ethernet RBS

class Service

Provides access to simulated Ethernet Services at runtime

static GetUsedServices(systemIdentifier=None, excludeRecordingOnlyMappings=True)

Returns all SystemIdentifiers, EcuNames and ServiceNames used in the current test execution

Parameters:
systemIdentifier : str or None

Filter Mappings for given SystemIdentifier (default=None)

excludeRecordingOnlyMappings : boolean

Ignore Mappings which are exclusively used for recording (default=True)

Returns:

A set of tuples containing SystemIdentifier, EcuName and ServiceName

Return type:

set[tuple[str, str, str]]

GenerateService(systemIdentifier, ecuName, serviceName, projectName='')

Generates a service module for systemIdentifier, ecuName and serviceName

Parameters:
systemIdentifier : str

System identifier

ecuName : str

Ecu name

serviceName : str

Service name

projectName : str

Optional project name

GetPort(portName)

Returns a service port for the given port name

Parameters:
portName : str

Port identifier according to TBC

Returns:

Service Port

Return type:

ServicePort

class ServicePort

Functions for Ports in the context of simulated Ethernet Services

GetService(serviceName)

Returns a proxy to the service identified by serviceName

Parameters:
serviceName : str

Service identifier is a composition of optional projectName and ecuName and serviceName in the format [projectName.]<ecuName>_<serviceName>

Returns:

Service Proxy

Return type:

ServiceProxy

StartService(serviceName)

Starts the service identified by serviceName on this port

Parameters:
serviceName : str

Service identifier is a composition of optional projectName and ecuName and serviceName in the format [projectName.]<ecuName>_<serviceName>

StopService(serviceName)

Stops the service identified by serviceName on this port

Parameters:
serviceName : str

service identifier is a composition of optional projectName and ecuName and serviceName in the format [projectName.]<ecuName>_<serviceName>

class ServiceProxy

Service proxy for a running simulated Ethernet Service. Service methods can be called on this object, and will be executed on the service instance.

static GetFunctionsHelp(name, serviceName)

Provides the docstring of a function of the service simulation

Parameters:
name : str

Name of function

serviceName : str

Service identifier is a composition of optional projectName and ecuName and serviceName in the format [projectName.]<ecuName>_<serviceName>

Return type:

str

static GetServiceFunctions(serviceName)

Provides available functions of a service simulation

Parameters:
serviceName : str

Service identifier is a composition of optional projectName and ecuName and serviceName in the format [projectName.]<ecuName>_<serviceName>

Return type:

list[str]

TestBench

class TestBench

Entry point for starting/stopping tools

GetPortStatus(portName)

Retrieves the status of the port.

Parameters:
portName : str

Name of the port as shown in the “Host / Tool / Port” column in the test bench configuration editor (e.g. “MDL-DEFAULT01”)

Returns:

Status of the port

  • 0 (Stopped, shown gray in the tool status monitor)

  • 1 (Started, shown green in the tool status monitor)

  • 2 (Broken, shown red in the tool status monitor)

Return type:

int

GetToolStatus(toolId)

Retrieves the status of the tool.

Parameters:
toolId : str

ID of the tool as shown in the tooltip in the test bench configuration editor (e.g. “CONTROLDESKNG01”)

Returns:

Status of the tool

  • 0 (Stopped, shown gray in the tool status monitor)

  • 1 (Started, shown green in the tool status monitor)

  • 2 (Broken, shown red in the tool status monitor)

Return type:

int

StartTool(toolId)

Starts the specified tool

Info

This is not the recommended way of changing the status of connected tools. Instead, a configuration change step in a project should be used.

Warning

Updates variable descriptions. Because signals are registered during test case initialization, accessing signals provided by a tool started via this method is in most cases not possible within the same test case.

Parameters:
toolId : str

ID of the tool as shown in the ToolTip in the testbench configuration editor (e.g. CONTROLDESKNG01)

Returns:

True if the tool was started successfully or had been started already, else False

Return type:

bool

StopTool(toolId)

Stops the specified tool.

Info

This is not the recommended way of changing the status of connected tools. Instead, a configuration change step in a project should be used.

Warning

Unloads the model description assigned to the ports of the stopped tool. Can break mapping and timestamp streaming within the same test case.

Any subsequent access to the tool, both explicitly by a test step and implicitly by cleanup for previous test steps, can lead to completely unpredictable behavior after this call.

Parameters:
toolId : str

ID of the tool as shown in the ToolTip in the testbench configuration editor (e.g. CONTROLDESKNG01)

Returns:

True if the tool was stopped successfully, had been stopped already or had never been started in the first place, else False

Return type:

bool

TestbenchConfiguration

class TestbenchConfiguration

Object for accessing information about test bench configuration

Filename

The filename of the test bench configuration

Type:

str

ToolList

List containing objects of type TestbenchTool

Type:

list(TestbenchTool)

GetToolhostInfo()

Returns a list of lists containing url, version, revision and loaded patches of all connected toolhosts

Returns:

List of lists containing toolhost information

Return type:

list<list>

TestbenchTool

class TestbenchTool

Provides information about the respective tool in the test bench configuration

Jobs

List containing the names of the tool jobs

Type:

list<str>

Location

Location (host) of the tool

Type:

str

Name

Name of the tool

Type:

str

PortList

List containing objects of type ToolPort

Type:

list(ToolPort)

Ports

Ports of the tool

Type:

list<str>

ToolId

ID of the tool

Type:

str

Version

Version of an activated tool (if known)

Type:

str/None

TestConfiguration

class TestConfiguration

Object for accessing information about test configuration

Info

For most properties it is enough to have the test configuration selected and not loaded.

BusSystems

Collection for BusSystems

Type:

list

Ecus

Collection for Ecus

Type:

list

EnvironmentCommunications

Collection for EnvironmentCommunications

Type:

list

EnvironmentSimulations

Collection for EnvironmentSimulations

Type:

list

Filename

Absolute path of the test configuration

Type:

str

GlobalConstants

Collection for Constants

Info

Test configuration has to be loaded.

Type:

list

Models

Collection for Models

Type:

list

NameTester

Name of the tester

Type:

str

ReloadGlobalMapping()

Reloads the global mapping from the test configuration without reloading the whole configuration

Info

Closed files are loaded, changed files are reloaded, additional files are unloaded.

Info

Calling this method has no effect on the package from which it is called but only on subsequent packages.

Warning

Changes in unsaved loaded mapping files are discarded when calling this method!

TestEnvironment

class TestEnvironment

Object of test procedure engine

ExecutionInfo

The current TestExecutionInfo object

GenerateTestReportDocumentFromDB(dbFile, outDir, fmtName=None, waitUntilFinished=False, fmtConfig=None)

Generates a handler-based test report on the filesystem

Parameters:
dbFile : str

Path to the report database file (.trf or .prf)

outDir : str

The output directory. Absolute or relative to the program’s report directory

fmtName : str

Name of the report format or handler which should be used (optional) (default is HTML)

waitUntilFinished : boolean

Defines whether the API call should block until generation is finished

fmtConfig : dict<str, str>

Optional dictionary {name: value} of additional configuration parameters for the report format

GetPackageReferences(filePath, skipDisabled=True)

Gives a set of all referenced sub packages of this package or project depending on the actual configuration

Parameters:
filePath : str

Path of package or project (relative to the package directory or absolute)

skipDisabled : boolean

Flag to include disabled test steps or not

Returns:

List of package references with absolute file path

Return type:

list<str>

TimeElapsing()

Resumes a stepwise simulation time when entering the context manager. Pauses the simulation time on context manager exit. This requires that a test execution is running. Does have no effect in real time or continuous simulation time.

Returns:

The context manager.

Return type:

Iterator[None]

Wait(seconds)

Waits the given number of seconds in the currently selected time mode. This requires that a test execution is running.

Returns:

True if wait completed. False if test execution is not active or wait has been aborted.

Return type:

bool

TestExecutionInfo

class ExecutionExceptionInfo

Provides information about an exception that has happened during test execution

GetMessage()

Returns the message of the exception

Returns:

The message of the exception

Return type:

str

GetTestStepPortId()

Returns the ID (alias) of the port that was used by the test step that caused the exception

Returns:

  • The port alias

  • None, if the test step did not refer to any port

Return type:

str or None

GetTestStepToolId()

Returns the ID (alias) of the tool that was used by the test step that caused the exception

Returns:

  • The tool alias

  • None, if the test step did not refer to any tool

Return type:

str or None

GetTestStepType()

Returns the name of the test step type

Returns:

The name of the test step type

Return type:

str

GetType()

Returns the name of the exception type

Returns:

The name of the exception type

Return type:

str

class KeywordInfo

KeywordInfo provides an interface to query properties of the currently executed keyword teststep

GetArgumentUnit(argName)

Returns the unit of the given argument configured in the test step

Parameters:
argName : str

The name of the desired argument

Returns:

Unit of the return parameter

Return type:

str

GetArguments()

Returns a list of all arguments

Returns:

All arguments

Return type:

list<str>

GetComponentType()

Returns the component type

Returns:

The component type

Return type:

str

GetCurrentTimeOptionIteration()

Returns the repetition count of the execution implementation

Returns:

The repetition count

Return type:

int

GetId()

Returns the keyword ID

Returns:

The keyword ID or None

Return type:

int or None

GetReturnUnit(retName=None)

Returns the unit of the given return parameter configured in the test step

Parameters:
retName : str or None

The name of the desired return parameter or None if only one exists

Returns:

Unit of the return parameter or None

Return type:

str or None

GetReturns()

Returns a list all return parameters

Returns:

All return parameters

Return type:

list<str>

GetTimeOptionDuration(asUnit=None)

Returns the minimum duration of the configured time option or None if not set

Parameters:
asUnit : str ('ms', 's', 'min', 'h', 'd')

Return the value in the desired unit. Default is None, the value as it is.

Returns:

The minimum duration value

Return type:

int or float

GetTimeOptionMode()

Returns the mode of the configured time option or None if time option is not set

Returns:

Mode of the time option

  • Finally

  • TrueForWithin

  • Generally

  • SyncOnly

Return type:

str or None

GetTimeOptionPollingCycle(asUnit=None)

Returns the polling cycle of the configured time option or None if not set

Parameters:
asUnit : str ('ms', 's', 'min', 'h', 'd')

Return the value in the desired unit. Default is None, the value as it is.

Returns:

The polling cycle value

Return type:

int or float

GetTimeOptionTimeout(asUnit=None)

Returns the timeout of the configured time option or None if not set

Parameters:
asUnit : str ('ms', 's', 'min', 'h', 'd')

Return the value in the desired unit. Default is None, the value as it is.

Returns:

The timeout value

Return type:

int or float

IsControlTestStep()

Returns True, if the keyword test step is of type control

Returns:

True, if the test step is of type control else False

Return type:

bool

IsEstablishTestStep()

Returns True, if the keyword test step is of type establish

Returns:

True, if the test step is of type establish else False

Return type:

bool

IsStateTestStep()

Returns True, if the keyword test step is of type state

Returns:

True, if the test step is of type state else False

Return type:

bool

class TestExecutionInfo

Provides information for current test execution.

All API functions refer to the context of the currently synchronously called package. Information within asynchronous/parallel package executions cannot be provided.

AllProjectsStepCount

Total number of project execution steps, including separately executed sub-projects

Type:

int

AllProjectsStepsExecuted

Number of completed project execution steps, including separately executed sub-projects

Type:

int

CurrentLineNumber

Line number of the current teststep

Type:

int

CurrentTestStepHierarchy

Current test step’s hierarchy including all parents’ line numbers (e.g. ‘3/4/17’)

Type:

str

KeywordInfo

The information object of the current keyword call

Type:

KeywordInfo

LastTestStepResult

Test result of the last executed teststep in the same test step hierarchy in main package execution. Not intended for parallel package calls.

Type:

str

LogFolder

Folder where trace and logging files of the current main package are saved during execution

Info

This may be a temporary location, in case a network drive is used. TargetReportDbFolder may be used to deduce the final location from the final report location.

Type:

str

MainProjectStepCount

Total number of project execution steps, excluding separately executed sub-projects

Type:

int

MainProjectStepsExecuted

Number of completed project execution steps, excluding separately executed sub-projects

Type:

int

PackageResult

The result of the current package

Type:

str

ProjectResult

The result of the current project

Type:

str

ProjectStartTime

Time where the current project execution began

Type:

float

ReportDb

Path to report database of current (or most recent) test run

Type:

str

ReportDbFolder

Folder of the report database of the current test run during execution

Info

This may be a temporary location, in case a network drive is used. TargetReportDbFolder returns the final report location instead.

Type:

str

RunningTime

Difference between the current time and the start of the testexecution

Type:

int

StartTime

Time where the current testexecution began

Type:

float

TargetReportDbFolder

Folder of the report database of the current main package after completion of the package run

Info

Trace and logging files may be located in the respective subfolders. In case a network drive is used, a temporary location is used during execution that is returned by ReportDbFolder.

Type:

str

AddArtifact(fileName=None, filePath='', context=None)

Adds an artifact reference to the test report.

Parameters:
fileName : str or None

File name of the artifact

filePath : str

Path or URI to the artifact. If the file is accessible on the local file system, a md5 hashsum will be calculated. The prefix ‘report://’ denotes a relative path within the current report directory. To copy a file to this location use the TargetReportDbFolder property.

context : str or None

Additional context / comment for the artifact.

AddTestStepReportDetail(text)

Adds a text to the “custom data” section of the currently running teststep’s report details

Info

The entry will be added with a leading time stamp of the test execution. This feature is only available within a package execution. When used within a project step (e.g. a project generator) an error will be raised.

Parameters:
text : str

The text to be added in the report details

GetCurrentPackageFilename()

Returns the file name of the current subpackage

Info

Infos of Packages executed in parallel are not returned.

Returns:

File name of current subpackage file or an empty string if the Package is not saved

Return type:

str

GetCurrentPackagePath()

Returns the absolute file system path of the current subpackage

Info

Infos of Packages executed in parallel are not returned.

Returns:

  • Absolute path of current subpackage file

  • An empty string if the Package is not saved

Return type:

str

GetCurrentProjectFilename()

Returns the file name of the current project

Returns:

  • File name of current project

  • An empty string, if the project has not been saved yet

  • None, if no project is running

Return type:

str or None

GetCurrentProjectPath()

Returns the absolute file system path of the current project

Returns:

  • Absolute path of the current project

  • An empty string, if the project has not been saved yet

  • None, if no project is running

Return type:

str or None

GetExecutionExceptionInfo()

Returns a list of exceptions that have occured during the execution of this package. This information is also available in error recovery packages.

Returns:

A list of exception info objects

Return type:

list<ExecutionExceptionInfo>

GetExecutionMode()

Returns the bit field coding the execution mode of the package or project:

  • NO_JOB_EXECUTION = 0

  • SEQUENTIAL_JOB_EXECUTION = 1

  • PARALLEL_JOB_EXECUTION = 2 (project execution only)

  • DISABLE_JOBREPORT_MERGE = 4 (project execution only)

  • SKIP_TESTCASE = 8

  • DOWNSTREAM_JOB_EXECUTION = 16 (project execution only)

Returns:

bit field coding the execution mode of the package or project.

Return type:

int

Info

May return None if called within the trace analysis during PARALLEL_JOB_EXECUTION. SEQUENTIAL_JOB_EXECUTION, PARALLEL_JOB_EXECUTION and DOWNSTREAM_JOB_EXECUTION can not be set at the same time.

GetKeywordInfo()

Returns an information object of the current executed keyword call

Returns:

The information object of the current keyword call

Return type:

KeywordInfo

GetMainPackageFilename()

Returns the file name of the running main package

Returns:

  • File name of current main package file

  • An empty string if the package is not saved

Return type:

str

GetMainPackagePath()

Returns the absolute file system path of the running main package

Returns:

  • Absolute path of current main package file

  • An empty string if package is not saved

Return type:

str

GetMappingNames()

Returns a list of all available mappings in the current package.

Info

This function is not supported in parallel packages.

Returns:

Mapping names in the running package

Return type:

list[str]

GetMappingTargetPath(mappingName)

Returns the target path of the mapping with the given name

Info

This function is not supported in parallel packages.

Parameters:
mappingName : str

Name of the mapping

Returns:

  • The target path of the mapping

  • None, if it is a generic mapping

Return type:

str or None

GetWatchTime(key='DefaultWatch')

Returns the difference between the current time and the start of a watch

Returns:

The time difference [ms]

Return type:

int

IsAbortRequested()

Returns True if the user has requested an abort.

Info

This method should be used to check if an abort is requested in long-running implementations (e.g. in UserPyModules, generators, package inline code or utility implementations) in order to abort this routine. Returns False if the abort of an execution has already been completed.

Returns:

True if the user has requested an abort else False.

Return type:

bool

IsAborted()

Returns True if a package or project is aborted.

Returns:

True if abort is sent by a package or project.

Return type:

bool

IsInMain()

Checks if execution is currently neither in a pre- nor a postcondition block

Returns:

True, if the currently executed test step is not in a pre- or postcondition block else False

Return type:

bool

IsInPostcondition()

Checks if execution is currently in postcondition block

Returns:

True, if a postcondition block is currently executed else False

Return type:

bool

IsInPrecondition()

Checks if execution is currently in precondition block

Returns:

True, if a precondition block is currently executed else False

Return type:

bool

IsInteractiveExecution()

Checks if test is executed interactively

Returns:

  • True, if test is executed interactively

  • False, if test is not executed interactively

  • None, if no execution is running

Return type:

bool or None

StartWatch(key='DefaultWatch')

Start a watch or reset an existing watch

Parameters:
key : str

The indentifier of the watch

TestGuideApiClient

class TestGuideApiClient

API Client for test.guide Functions

ExecutionApi

Object for ExecutionApi

TestGuideExecutionApi

class ExecutionApi

API Client for test.guide Execution API Functions

UploadPlaybook(playbookJsonDict)

Upload a new playbook

Parameters:
playbookJsonDict : Dict

JSON dictionary representing the playbook

TestManagement

class TestManagementApi

API to interact with the configured test management system.

Info

Test management must be configured and already successfully authenticated.

GetTestScriptByID(testScriptId)

Queries a test script by its ID. The returned data object corresponds to the interface of almhooks.

Parameters:
testScriptId : str

String value of the identifer, e.g.: “42” or “TT-1234”

Returns:

Data object of the Almhook Interface representing a test script.

Raises:

exception – if a user adapter is currently active. Or the test management system is not configured. Or the user is not authenticated.

Return type:

TestScript

ToolAccess

class JobExecutor

Object for executing jobs on tools or ports.

Execute(**params)

Executes the job with the provided parameters.

Parameters:
**params

The parameters as keyword arguments.

class ToolAccess

Entry point for executing jobs on tools or ports.

GetPortJobExecutor(portId, jobName)

Get a JobExecutor for a specific port and job name.

Parameters:
portId : str

The ID of the port.

jobName : str

The name of the job to run.

Returns:

A JobExecutor instance for the specified port and job.

Return type:

JobExecutor

GetToolJobExecutor(toolId, jobName)

Get a JobExecutor for a specific tool and job name.

Parameters:
toolId : str

The ID of the tool.

jobName : str

The name of the job to run.

Returns:

A JobExecutor instance for the specified tool and job.

Return type:

JobExecutor

Credentials API

Introduction

The credentials API can be used to manage and access credentials such as certificates and private keys.

Keystores

Certificates and private keys are stored in keystores, e.g. PKCS12 files. These keystores are meant to prevent direct access to especially private keys. For example, PKCS12 files can be encrypted by a password to protect the private key from simple plaintext access via the file system.

Managing Keystores

Keystores can be created or loaded in the central vault of ecu.test to access them later within a test case, e.g. via path and the password of a PKCS12 file via CreatePkcs12KeyStore and LoadPkcs12KeyStore. The vault is encrypted and secured by a central password that must be provided by the user to decrypt and gain access to the saved keystores - similar to the concept of a password manager.

Accessing Keystores

Previously created or loaded keystores can be simply accessed as attribute or by GetVaultEntry:

>>> api.Credentials.OpenCryptFileVault(...)
>>> api.Credentials.CreatePkcs12KeyStore("myKeyStore", ...)
>>> ...
>>> api.Credentials.myKeyStore.GetPrivateKey()
>>> api.Credentials.GetVaultEntry("myKeyStore").GetCertificates()

Secrets

Simple secrets such as strings or byte streams can be stored directly in the vault. Analogously to keystores, they can be accessed as attribute or by GetVaultEntry:

>>> api.Credentials.OpenCryptFileVault(...)
>>> api.Credentials.CreateSecret("secret", "e25f790f00e553b82592626a2a948a64", "accessToken")
>>> ...
>>> api.Credentials.secret.Reveal()
'e25f790f00e553b82592626a2a948a64'
>>> api.Credentials.GetVaultEntry("secret").AssociatedData()
'accessToken'

Managing the Vault

Currently, the central vault is a password encrypted file containing the access data to the different keystores. One can simply create a vault by CreateCryptFileVault or load an existing one by OpenCryptFileVault.

Security

See security notes for the vault in the workspace settings documentation.

Warning

Providing the password directly via API can currently reveal the central password by reporting. To circumvent reporting, it is advised to use the credentials API within function variables or UserPyModules.

Examples

Creating a vault:

>>> api.Credentials.CreateCryptFileVault("C:/<path>/vault")
>>> api.Credentials.Close()

Creating a PKCS12 keystore:

>>> api.Credentials.OpenCryptFileVault("C:/<path>/vault")
>>> pkcs = "C:/<path>/service29.pkcs"
>>> privateKey = "C:/<path>/private.key"
>>> certs = ["C:/<path>/Service29.crt"]
>>> api.Credentials.CreatePkcs12KeyStore("service29", pkcs, privateKey, certs)
>>> api.Credentials.Save()
>>> api.Credentials.Close()

Accessing keystores:

>>> # Assuming the vault has been opened beforehand
>>> privateKey = api.Credentials.service29.GetPrivateKey()
>>> cert = api.Credentials.service29.GetCertificate("SERVICE-29")  # common name SERVICE-29
>>> signature = privateKey.Sign(ByteStream(b"message"))
>>> cert.Verify(signature, ByteStream(b"message"))
True
>>> cert.Verify(signature, ByteStream(b"nonsense"))
False

Credentials

class Credentials

Access to the Credentials API

Certificate

Returns Certificate API for utility methods.

Return type:

Certificate

ChangeLoginCredentials(old, new)

Changes the login credentials (vault password).

Parameters:
old : str

Old vault password.

new : str

New vault password.

Close()

Closes the vault. Unsaved modifications will be discarded!

CreateCryptFileVault(path, vaultPassword)

Creates a new crypt file vault. After that the new vault will be open.

Parameters:
path : str

The path of the vault. This path can be relative to the workspace or absolute.

vaultPassword : str

The password of the vault.

CreatePkcs12KeyStore(identifier, filePath, privateKey=None, certs=None, password='')

Creates the PKCS12 file with its given path, private key, certificates and password. The created PKC12 file is stored afterward.

Parameters:
identifier : str

This identifier will be used to reference the created keystore. The identifier has to be a valid python variable name without leading underscores.

filePath : str

The path of the PKCS12 file to be created.

privateKey : str | None

Path to the private key that will be stored in the PKCS12 file. If not given, the PKCS12 file will be created without a private key.

certs : list[str] | None

Certificates that will be stored in the PKCS12 file. The certificates can be given as files paths or standard base64 encoded strings. Additionally, they have to be ordered as certificate chain. If not given, the PKCS12 file will be created without certificates.

password : str

Password for accessing the PKCS12 file. If the PKCS12 file shall not be password protected, just choose an empty password.

Return type:

KeyStore

CreateSecret(identifier, secret, associatedData=None)

Creates and saves the secret with its associated data.

Parameters:
identifier : str

This identifier will be used to reference the created keystore. The identifier has to be a valid python variable name without leading underscores.

secret : str

The secret to be stored, e.g. passwords, tokens.

associatedData : Any

Additional data associated with the secret. Data has to be JSON serializable.

Return type:

Secret

DeleteVaultEntry(identifier)

Deletes the vault entry with the given identifier.

GetAvailableVaultEntries()

Returns all available vault entry identifiers.

Return type:

list[str]

GetTesterKey(vaultPassword)

Returns the tester key.

Parameters:
vaultPassword : str

The password of the vault.

GetVaultEntry(identifier)

Returns the vault entry with the given identifier.

Returns:

Returns vault entry if existent, otherwise None

Return type:

KeyStore | Secret | None

LoadPkcs12KeyStore(identifier, filePath, password='')

Loads and stores an existing PKCS12 file given by its path and password.

Parameters:
identifier : str

This identifier will be used to reference the created keystore. The identifier has to be a valid python variable name without leading underscores.

filePath : str

The path of the PKCS12 file.

password : str

Password for accessing the PKCS12 file. If the PKCS12 file is not password protected, just choose an empty password.

Return type:

KeyStore

OpenCryptFileVault(path, vaultPassword)

Opens the crypt file vault. The vault can only be modified if it has been opened.

Access via password allocates for a short time ca. 2 GB RAM.

Parameters:
path : str

The path of the vault. This path can be relative to the workspace or absolute.

vaultPassword : str

The password or tester key of the vault.

OpenVault(vaultPassword)

Opens the vault that is configured in credential settings. The vault can only be modified if it has been opened.

Access via password allocates for a short time ca. 2 GB RAM.

Parameters:
vaultPassword : str

The password or tester key of the vault.

PrivateKey

Returns PrivateKey API for utility methods.

Return type:

PrivateKey

PublicKey

Returns PublicKey API for utility methods.

Return type:

PublicKey

Save()

Saves all modifications.

SeedAndKey

Returns SeedAndKey API for generating keys from seeds.

Return type:

SeedAndKey

KeyStore

class KeyStore

Keystore for saving credentials.

Delete()

Deletes the vault entry.

GetCertificate(name)

Returns the certificate with the given name. For PKCS12 files the common name of the certificate is used as identifier.

Parameters:
name : str

The name of the certificate that will be used to identify it.

Return type:

Certificate

GetCertificateChain(name)

Returns the certificate chain for the certificate with the given name. For PKCS12 files the common name of the certificate is used as identifier.

Parameters:
name : str

The name of the certificate that will be used to identify it.

Return type:

list[Certificate]

GetCertificates()

Returns all stored certificates.

Return type:

list[Certificate]

GetPrivateKey()

Returns the private key.

Return type:

PrivateKey | None

Secret

class Secret
AssociatedData()

Additional data associated with the secret.

Delete()

Deletes the vault entry.

Reveal()

Returns the stored secret.

Return type:

str

Certificate

class Certificate
Base64()

Returns the certificate as base64 encoded string.

Return type:

str

CommonName()

Return the common name of this certificate.

Return type:

str

DER()

Return the certificate as bytes in DER format.

Return type:

ByteStream

classmethod FromBase64(data)

Create a Certificate instance from base64 encoded data.

Parameters:
data : str

Base64 encoded data

Return type:

Certificate

classmethod FromDER(data)

Create a Certificate instance from DER encoded data.

Parameters:
data : ByteStream

DER encoded data

Return type:

Certificate

classmethod FromFile(filePath)

Creates a Certificate instance from a PEM or DER formatted file.

Parameters:
filePath : str

Path of certificate file.

Return type:

Certificate

classmethod FromPEM(data)

Create a Certificate instance from PEM encoded data.

Parameters:
data : str

PEM encoded data

Return type:

Certificate

IsValid(hours=0)

Checks if the certificate is still valid for at least the given amount of time.

Parameters:
hours : int

The minimum number of hours for which the certificate must still be valid.

Return type:

bool

Issuer()

Return the issuer of this certificate.

Return type:

str

PEM()

Returns the certificate as PEM encoded string.

Return type:

str

PublicKey()

Return the certificate’s public key.

Return type:

PublicKey

Subject()

Return subject of this certificate.

Return type:

str

Verify(signature, message)

Verifies a signature of the given message.

Parameters:
signature : ByteStream

The supposed signature of the message created by the corresponding private key.

message : ByteStream

The message that has been signed.

Returns:

True, if the verification is successful, otherwise False.

Return type:

bool

PrivateKey

class PrivateKey
classmethod FromBase64(data)

Create a PrivateKey instance from base64 encoded data.

Parameters:
data : str

Base64 encoded data

Return type:

PrivateKey

classmethod FromDER(data)

Create a PrivateKey instance from DER encoded data.

Parameters:
data : ByteStream

DER encoded data

Return type:

PrivateKey

classmethod FromFile(filePath)

Creates a PrivateKey instance from a PEM or DER formatted file.

Parameters:
filePath : str

Path of private key file.

Return type:

PrivateKey

classmethod FromPEM(data)

Create a PrivateKey instance from PEM encoded data.

Parameters:
data : str

PEM encoded data

Return type:

PrivateKey

PublicKey()

Return the corresponding public key.

Return type:

PublicKey

Sign(message)

Signs the given message.

Return type:

ByteStream

PublicKey

class PublicKey
Base64()

Returns the public key as base64 encoded string.

Return type:

str

DER()

Return the public key as bytes in DER format.

Return type:

ByteStream

classmethod FromBase64(data)

Create a PublicKey instance from base64 encoded data.

Parameters:
data : str

Base64 encoded data

Return type:

PublicKey

classmethod FromDER(data)

Create a PublicKey instance from DER encoded data.

Parameters:
data : ByteStream

DER encoded data

Return type:

PublicKey

classmethod FromFile(filePath)

Creates a PublicKey instance from a PEM or DER formatted file.

Parameters:
filePath : str

Path of the public key file.

Return type:

PublicKey

classmethod FromPEM(data)

Create a PublicKey instance from PEM encoded data.

Parameters:
data : str

PEM encoded data

Return type:

PublicKey

PEM()

Returns the public key as PEM encoded string.

Return type:

str

Verify(signature, message)

Verifies a signature of the given message.

Parameters:
signature : ByteStream

The supposed signature of the message created by the corresponding private key.

message : ByteStream

The message that has been signed.

Returns:

True, if the verification is successful, otherwise False.

Return type:

bool

SeedAndKey

class SeedAndKey
Diag

Diagnostics related seed and key API

Return type:

DiagSeedAndKey

Xcp

XCP related seed and key API

Return type:

XcpSeedAndKey

DiagSeedAndKey

class DiagSeedAndKey
classmethod FromLib(libPath)

Returns DiagSeedAndKey instance for accessing libPath seed and key API.

Parameters:
libPath : str

The path of the dll. This path can be relative to the workspace or absolute.

Return type:

DiagSeedAndKey

GenerateKeyEx(seed, securityLevel, ecuVariant)

Generates the key from the seed by using the previously passed library. Internally the user defined functiuon GenerateKeyEx() is called.

Parameters:
seed : ByteStream

The seed queried by the ECU (as byte raw data)

securityLevel : int

The security level to be change to

ecuVariant : str

The ECU variant’s qualifier

Return type:

ByteStream

GenerateKeyExOpt(seed, securityLevel, ecuVariant, options)

Generates the key from the seed by using the previously passed library. Internally the user defined functiuon GenerateKeyExOpt() is called.

Parameters:
seed : ByteStream

The seed queried by the ECU (as byte raw data)

securityLevel : int

The security level to be change to

ecuVariant : str

The ECU variant’s qualifier

options : str

The option string (free text)

Return type:

ByteStream

XcpSeedAndKey

class XcpSeedAndKey
ComputeKeyFromSeed(seed, privilege)

Compute key from seed by using the previously passed library.

Parameters:
seed : ByteStream

Given seed that will be used to compute the key

privilege : int

Given privilege

Return type:

ByteStream

classmethod FromLib(libPath)

Returns XcpSeedAndKey instance for accessing libPath seed and key API.

Parameters:
libPath : str

The path of the dll. This path can be relative to the workspace or absolute.

Return type:

XcpSeedAndKey

GetAvailablePrivileges()

Get privileges given by the seed and key dll.

Return type:

int

DataBrowser

A2lBrowser

class A2lBrowser

The A2lBrowser type provides an interface to a A2L database. It is possible to retrieve information for a single entry or to use a full text search to get a list of filtered entries. Every entity is represented by an instance of the type A2lEntity.

CalcPhysToRaw(label, physValue)

Returns the raw value of the provided physical value computed using the computation method defined for the provided label

Parameters:
label : str

The A2L label to select the computation method from

physValue : float

The numeric value to be converted to its raw representation

Returns:

raw value

Return type:

float

CalcRawToPhys(label, rawValue)

Returns the physical converted value of the provided raw value computed using the computation method defined for the provided label

Parameters:
label : str

The A2L label to select the computation method from

rawValue : float

The numeric value to be converted to its physical representation

Returns:

physical converted value

Return type:

float

GetA2lEntity(label)

Returns an instance of A2lEntity representing the entity with the specified label

Parameters:
label : str

The A2L label to retrieve an A2lEntity instance

Returns:

An A2lEntity instance if the A2L database contains an entry with the given name, otherwise None

Return type:

A2lEntity or None

GetAcquisitionRateNames()

Returns a list containing all acquisition rate names defined in the A2L database.

Returns:

A list of all acquisition rate names

Return type:

list <str>

GetFunctionCharacteristics(name)

Returns the characteristics of the function with the given name

Parameters:
name : str

The name of the function to return the characteristics of

Returns:

The characteristics of the function

Return type:

list <str>

GetFunctionInMeasurements(name)

Returns the in measurements of the function with the given name

Parameters:
name : str

The name of the function to return the in measurementes of

Returns:

The in measurements of the function

Return type:

list <str>

GetFunctionLocMeasurements(name)

Returns the local measurements of the function with the given name

Parameters:
name : str

The name of the function to return the local measurementes of

Returns:

The local measurements of the function

Return type:

list <str>

GetFunctionNames()

Returns the names of all functions within the A2L

Returns:

The names of all functions

Return type:

list <str>

GetFunctionOutMeasurements(name)

Returns the out measurements of the function with the given name

Parameters:
name : str

The name of the function to return the out measurements of

Returns:

The out measurements of the function

Return type:

list <str>

GetFunctionVersion(name)

Returns the version of the function with the given name

Parameters:
name : str

The name of the function to return the version of

Returns:

The version of the function

Return type:

str

GetLabelNameList(filter='')

Returns a list which contains names of labels whose matches the specified label search string

Parameters:
filter : str

The search string which is part of an A2L label

Returns:

A list of names if the A2L database containsentries with the given search string, otherwise an empty list

Return type:

list<str>

GetSubFunctionNames(name)

Returns the names of all sub functions within the function with the given name

Parameters:
name : str

The name of the function to get the sub functions of

Returns:

The names of all sub functions

Return type:

list <str>

GetSystemConstantNameList()

Returns a list which contains names of system constants defined in the A2L

Returns:

A list of names

Return type:

list<str>

GetSystemConstantValue(constName)

Returns the value of the given system constant

Parameters:
constName : str

Name of system constant defined in A2L

Returns:

Value of system constant or None if name was not found

Return type:

str or None

HasFunction(name)

Checks if a function of the given name exists within the A2L file

Parameters:
name : str

The name to check if it is an existing function

Returns:

True if a function with the given name exist, otherwise False

Return type:

bool

HasSubFunctions(name)

Checks if a function of the given name within the A2L file has sub functions

Parameters:
name : str

The name of the function to check for sub functions

Returns:

True if the function of the given name has subfunctions, otherwise False

Return type:

bool

IsCharacteristic(label)

Checks if the given label name is a calibration variable

Parameters:
label : str

The A2L label to check for a calibration variable

Returns:

True if the given label is a calibration variable, otherwise False

Return type:

bool

IsMeasurement(label)

Checks if the given label name is a measurement variable

Parameters:
label : str

The A2L label to check for a measurement variable

Returns:

True if the given label is a measurement variable, otherwise False.

Return type:

bool

A2lEntity

class A2lEntity

The A2lEntity type represents one entry in an A2L database

GetAddress()

Returns the address of this A2L entity

Returns:

Address as hex number

Return type:

str

GetByteOrder()

Returns the signals byte order

Returns:

‘MSB_LAST’ or ‘MSB_FIRST’

Return type:

str

GetCoeffsDict()

Returns the coefficients of this A2L entity

Returns:

  • The coefficients stored in a dictionary where the key is the index and value is the value at this index

  • None if the coefficients are invalid

Return type:

dict<int: float> or None

GetCompuMethodName()

Returns the name of the compu method of this A2L entity like defined in the A2L database

Returns:

The compu methods name

Return type:

str

GetDataType()

Returns the dataype of this A2L entity

Returns:

The datatype

Return type:

str

GetDescription()

Returns the description of this A2L entity

Returns:

The description

Return type:

str

GetDisplayIdentifier()

Returns the display identifier of this A2L entity

Returns:

The display identifier

Return type:

str

GetLowerLimit()

Returns the lower limit of this A2L entity

Returns:

The lower limit

Return type:

str

GetMatrixDim()

Returns the matrix dimensions for calibration or measurement entities

Returns:

  • Dimensions tuple

  • None if no MATRIX_DIM is given in the A2L file

Return type:

tuple or None

GetName()

Returns the name of this A2L entity

Returns:

The name

Return type:

str

GetSize()

Returns the size of this A2L entity

Returns:

  • The size

  • None if it is a scalar

Return type:

int or None

GetUnit()

Returns the name of the unit of this A2L entity like defined in the A2L database

Returns:

The units name

Return type:

str

GetUpperLimit()

Returns the upper limit of this A2L entity

Returns:

The upper limit

Return type:

str

GetValueType()

Returns the internal data type representation of the current A2L entity

Returns:

  • Internal data type representation

  • None if the entity is of an unsupported type

Return type:

str or None

GetVtabDict()

Returns the V-TAB Dictionary

Returns:

V-TAB Dictionary

Return type:

dict

BusBrowser

class BusBrowser

The BusBrowser type provides an interface to a BUS database. It is possible to retrieve information for a single entry or to use a full text search to get a list of filtered entries. Every entity is represented by an instance of the type BusEntity.

Info

This part of the DataBrowser API was specifically created to support certain use cases. Don’t expect your use case to easily map onto this API!

GetFrameNamesByPDUName(pduName)

Returns a set of frame names the given PDU is bound to

Parameters:
pduName : str

The name of the PDU

Returns:

The frame names

Return type:

set<str>

GetLinScheduleTables()

Returns the LIN schedule tables as a dictionary, mapping the schedule table name to a sequence of triples (isFrameName, command, frameTime)

Returns:

LIN schedule tables

Return type:

dict<string, tuple<bool, string, float>>

ListFrames(filter='', useLongNames=False)

Returns a list of BusEntity instances corresponding to frames whose name matches the specified search string

Parameters:
filter : str

The search string which is part of a bus frame

useLongNames : bool

If True search in LongNames else (default) in ShortNames

Returns:

A list of BusEntity instances if the bus database contains entries with the given search string, otherwise an empty list

Return type:

list <BusEntities>

ListPDUs(frameName=None, filter='', useLongNames=False)

Returns a list of BusEntity instances corresponding to PDUs whose name matches the specified search string

Parameters:
frameName : str

The exact short name of the frame in which to search for PDUs (optional)

filter : str

The search string which is part of a bus frame

useLongNames : bool

If True search in LongNames else (default) in ShortNames

Returns:

A list of BusEntity instances if the bus database contains entries with the given search string, otherwise an empty list

Return type:

list <BusEntities>

ListSignals(frameName, filter='', useLongNames=False, includePseudoSignals=False)

Returns a list of BusEntity instances corresponding to signals whose name matches the specified search string

Parameters:
frameName : str

The exact name of the frame in which to search for signals

filter : str

The search string which is part of a bus signal

useLongNames : bool

If True search in LongNames else (default) in ShortNames

includePseudoSignals : bool

If True additionally list pseudo signals like _pduUpdateBit (default=False)

Returns:

A list of BusEntity instances if the bus database contains entries with the given search string, otherwise an empty list

Return type:

list <BusEntities>

ListSignalsByPDU(pduName, filter='', useLongNames=False, includePseudoSignals=False)

Returns a list of BusEntity instances corresponding to signals whose name matches the specified search string

Parameters:
pduName : str

The exact name of the PDU in which to search for signals

filter : str

The search string which is part of a bus signal

useLongNames : bool

If True search in LongNames else (default) in ShortNames

includePseudoSignals : bool

If True additionally list pseudo signals like _pduUpdateBit (default=False)

Returns:

A list of BusEntity instances if the bus database contains entries with the given search string, otherwise an empty list

Return type:

list <BusEntities>

BusEntity

class BusEntity

The BusEntity type represents one entry in a bus database

GetActivations()

Returns a list consisting of tuples with activation state, activation time and signal quality of the signal

Return type:

list <tuple <str, float, str>>

GetByteOrder()

Returns the signals byte order

Returns:

  • “Intel”

  • ”Motorola”

  • ”Default”

  • None

Return type:

str or None

GetCycleRepetition()

Returns the frames cycle repetition if this bus entity is a bus frame else None

Info

Only applies to FlexRay frames.

Returns:

Frame cycle repetition

Return type:

int or None

GetDebounceTime()

Returns the debounce time of a PDU or a frame else None

Returns:

Debounce time

Return type:

float or None

GetDescription()

Returns the description of this bus entity

Returns:

The description

Return type:

str

GetE2EProfile()

Returns the E2E profile of a PDU

Returns:

E2E profile

Return type:

dict

GetFrameLength()

Returns the length of the frame in bytes if this bus entity is a bus frame else None

Returns:

Length of frame in bytes

Return type:

int or None

GetId()

Returns the identifier of this bus entity

Info

This works only for BusEntities representing a bus frame.

Returns:

The identifier

Return type:

str

GetLinearCoeffs()

Returns the coefficients of the linear function y = slope * x + offset where the slope is also called physical resoution.

Returns:

(slope, offset)

Return type:

tuple(float / None, float / None) / None

GetLongName()

Returns the long name of this bus entity

Returns:

The long name

Return type:

str

GetMaxRawValue()

Returns the maximum raw value of the signal. Note that this value is not necessarily equal (but always greater or equal) to GetRawValue(GetMaxValue()) as the set of physical values usually not maps to all valid raw values.

Returns:

Maximum raw value

Return type:

float

GetMaxValue()

Returns the maximum physical value of the signal

Returns:

Maximum physical value

Return type:

float

GetMinRawValue()

Returns the minimum raw value of the signal. Note that this value is not necessarily equal (but always less or equal) to GetRawValue(GetMinValue()) as the set of physical values usually not maps to all valid raw values.

Returns:

Minimum raw value

Return type:

float

GetMinValue()

Returns the minimum physical value of the signal

Returns:

Minimum physical value

Return type:

float

GetMultiplexerSwitchCode()

Returns the switch code of this bus entity else None

Info

This works only for BusEntities representing a bus PDU or bus signal.

Returns:

The switch code if available

Return type:

str or None

GetName()

Returns the name (as used within ecu.test) of this bus entity

Returns:

The name

Return type:

str

GetOriginalName()

Returns the original name of this bus entity as specified in the bus database.

Info

This is different from GetName() in case ecu.test needs to add information to the name in order to make it unique.

Returns:

The original name

Return type:

str

GetPDULength()

Returns the byte length if this bus entity is a bus PDU

Returns:

The byte length

Return type:

int or None

GetPDUPosition()

Returns the absolute bit position if this bus entity is a bus PDU

Returns:

The absolute bit position

Return type:

int or None

GetPDUUpdateBit()

Returns the absolute bit position of the update bit if this bus entity is a bus PDU

Returns:

The absolute bit position

Return type:

int or None

GetPath()

Returns the variablepath of this bus entity

Returns:

The variablepath (e.g.: <busName>/<ecuName>/<frameName>/<pduName>/<signalName>)

Return type:

str

GetPhysValue(rawValue)

Returns the physical value of given raw value

Returns:

Physical value of given raw value

Return type:

float

GetRawValue(value)

Returns the raw value of given value

Info

Value can be text or physical value.

Returns:

The raw value

Return type:

int

GetRxEcuNames()

Returns the names of the ECUs which listen for this Frame/PDU

Returns:

The names of the ECUs

Return type:

list<str>

GetSignalDataPositionInFrame()

Returns the signals data bit position relative to the frame

Returns:

The signals data bit position

Return type:

int or None

Raise:

ValueError if the Signal has no fixed position in the frame (e.g. container PDUs)

GetSignalDataPositionInPDU()

Returns the signals data bit position relative to the PDU

Returns:

The signals data bit position

Return type:

int or None

GetSignalLength()

Returns the length of the signal in bits if this bus entity is a bus signal else None

Returns:

The length of the signal in bits

Return type:

int or None

GetStartCycle()

Returns the frames start cycle if this bus entity is a bus frame else None

Info

Only applies to FlexRay frames.

Returns:

The frames start cycle

Return type:

int or None

GetSystemSignalName()

Returns the name of the system signal of this bus entity

Returns:

The name

Return type:

str

GetTextTable(numbersAsStrings=False)

Returns the text table as a dictionary

Info

Set numbersAsStrings to True when using this method via ApiProxy.

Returns:

The text table

Return type:

dict

GetTimeOffset(transmissionMode=None)

Returns the time offset of a PDU or a frame

Parameters:
transmissionMode=None

If None maximal time offset is returned. True/False refers to TRANSMISSION-MODE-TRUE/FALSE-TIMING (optional)

Return type:

float or None

GetTimings(transmissionMode=None)

Returns dtMin and dtMax for this Frame/PDU

Parameters:
transmissionMode=None

If None global Timings are returned. True/False refers to TRANSMISSION-MODE-TRUE/FALSE-TIMING (optional)

Returns:

Minimum and maximum timings (in seconds)

Return type:

(float, float) or (None, None)

GetTxEcuNames()

Returns the names of the ECUs which are capable of transmitting this Frame/PDU/Signal corresponding to the Bus access tab

Returns:

The names of the ECUs

Return type:

list<str>

GetUnit()

Returns the unit of a bus signal

Returns:

The unit

Returns:

str

IsFrame()

Checks if this bus entity is a bus frame

Returns:

True if this entity is a bus frame else False

Return type:

bool

IsMultiplexer()

Checks if this bus entity is multiplexed

Info

This works only for BusEntities representing a bus PDU or frame.

Returns:

True if this Item is a multiplexed PDU (DynamicPart) or a Frame containing multiplexed PDUs else False

Return type:

bool

IsNode()

Checks if this bus entity is a bus node

Returns:

True if this entity is a bus node else False

Return type:

bool

IsPDU()

Checks if this bus entity is a bus PDU

Returns:

True if this entity is a bus PDU else False

Return type:

bool

IsSend()

Returns true if the current signal is sent from its associated ECU

Return type:

bool

IsSignal()

Checks if this bus entity is a bus signal

Returns:

True if this entity is a bus signal else False

Return type:

bool

DataBrowser

class DataBrowser

The DataBrowser provides functions to retrieve a specific object to a database of a configured device in the test configuration. Currently, there are interfaces to browse inside A2L, BUS , debugging (ELF), diagnostic, logging, multimedia, service and SGBD data of an electronic control unit (ECU). The interface to browse SGBD data is currently in a prototype state.

BrowseA2l(ecuKey)

BrowseA2l gives access to an A2L database. The database is specified by the same name of the ECU which is given in the test configuration.

E.g.: a2lBrowser = DataBrowser().BrowseA2l("DME1_DDE1")

Parameters:
ecuKey : str

The name of the ECU to which an A2L browser is requested

Returns:

A2lBrowser object

Return type:

A2lBrowser

BrowseBus(busKey)

BrowseBus gives access to a bus database. The database is specified by the same bus name which is given in the test configuration.

E.g.: busBrowser = DataBrowser().BrowseBus("PT_CAN")

Parameters:
busKey : str

The name of the BUS to which a BUS browser is requested.

Returns:

BusBrowser object

Return type:

BusBrowser

Info

This part of the DataBrowser API was specifically created to support certain use cases. Don’t expect your use case to easily map onto this API!

BrowseDebug(ecuKey)

BrowseDebug gives access to the debug database with information provided by ELF files. The database is specified by the name of the ECU (ecuKey) which is defined in the test configuration.

Parameters:
ecuKey : str

The name of the ECU to which a DebugBrowser is requested.

Returns:

DebugBrowser object

Return type:

DebugBrowser

BrowseDebugElf(elfFile)

BrowseDebugElf gives access to an ELF-database. Contrary to BrowseDebug the database is specified by an ELF-File on the filesystem. Please Note: To query a register a connection to a debugger as well as a API call via BrowseDebug (not BrowseDebugElf) is required.

Parameters:
elfFile : str

The full path to an ELF-File.

Returns:

DebugBrowser object

Return type:

DebugBrowser

BrowseDiag(ecuKey)

BrowseDiag gives access to entities from the diagnostic database which was assigned to the ECU in the test configuration.

E.g.: diagBrowser = DataBrowser().BrowseDiag('Engine')

Parameters:
ecuKey : str

The name of the ECU a DiagBrowser is requested for

Returns:

DiagBrowser object

Return type:

DiagBrowser

BrowseLogging(ecuKey)

BrowseLogging gives access to a logging database. The database is specified by the same name of the ECU which is given in the test configuration.

E.g.: loggingBrowser = DataBrowser().BrowseLogging("DME1_DDE1")

Parameters:
ecuKey : str

The name of the ECU to which a logging browser is requested.

Returns:

LoggingBrowser object

Return type:

LoggingBrowser

BrowseModel(modelKey)

BrowseModel gives access to the model database associated with the given modelKey in the test configuration.

Parameters:
modelKey : str

Key of the model as specified in the test configuration’s Platform tab.

Returns:

ModelBrowser object

Return type:

ModelBrowser

BrowseMultimedia(deviceKey)

BrowseMultimedia gives access to Image or Mask ojects. The target folder is specified by the same deviceKey which is given as a name in the test configuration.

E.g.: multimediaBrowser = DataBrowser().BrowseMultimedia("CAM")

Parameters:
deviceKey : str

The name of the multimedia device to which a browser is requested.

Returns:

MediaBrowser object

Return type:

MediaBrowser

BrowseService(serviceKey)

BrowseService gives access to a service database. The database is specified by the same name of the service name which is given in the test configuration.

E.g.: serviceBrowser = DataBrowser().BrowseService("ETHERNET")

Parameters:
serviceKey : str

The name of the BUS to which a BUS browser is requested.

Returns:

ServiceBrowser object

Return type:

ServiceBrowser

Info

prototype

BrowseSgbd(ecuKey)

BrowseSgbd gives access to a SGBD file. The SGBD is specified by the same name of the ECU which is given in the test configuration.

E.g.: sgbdBrowser = DataBrowser().BrowseSgbd("DME1_DDE1")

Parameters:
ecuKey : str

The name of the ECU to which a SGBD browser is requested.

Returns:

SgbdBrowser object

Return type:

SgbdBrowser

Info

prototype

DebugBrowser

class DebugBrowser

The DebugBrowser type prodvides an interface to a Debugger database. It is possible to query for debug variables or register entries.

GetCores()

Returns names of all cores

Info

Cores are not supported by all debugger tool adapters

Returns:

A list of strings containing the core names found in the database.

Return type:

list<str>

GetElfFiles()

Returns dictionary with mapping from elfFileKey to ELF file path

Returns:

Dictionary with elfFileKey and corresponding ELF file path

Return type:

dict<str:str>

GetModules(elfFileKey)

Returns all modules of the ELF file referenced by the given elfFileKey

Parameters:
elfFileKey : str

elfFileKey with or without wildcard for filtering

Returns:

List of modules

Return type:

list<str>

GetRegisters(registerName=None, coreName=None)

Returns all registers by default

Info

  • Use optional parameters to filter registers. You can use * as wildcard.

  • Delivered registerName returns the full name, consisting of register Group and register name separated by underscore.

  • Registers are not supported by all debugger tool adapters.

Parameters:
registerName : str

Full register name (group_name) with or without wildcard for filtering

coreName : str

Core name with or without wildcard for filtering

Returns:

A list of dictionaries, each filled the registers full name, its cores name and the mapping path is retured for every entry

Return type:

list<dict>

GetVariables(variableName=None, visibility=None, moduleName=None, functionName=None, elfFileKey=None, includeExterns=False)

Returns all variables except extern variables by default

Info

Use optional parameters to filter variables. You can use * as wildcard.

Parameters:
variableName : str

Variable name with or without wildcard for filtering

visibility : int

Type 0 for local, 1 for global or 2 for extern variables to be returned

moduleName : str

Module name with or without wildcard for filtering

functionName : str

Function name with or without wildcard for filtering

elfFileKey : str

elfFileKey with or without wildcard for filtering

includeExterns : bool

Use True to include extern variables in the search

Returns:

A list of dictionaries with the following keys: name, moduleName, visibility, type, elfFileKey, mappingPath, functionName and arraySize

Return type:

list<dict>

DiagBrowser

class DiagBrowser

The DiagBrowser type provides an interface to a diagnostics data base. DiagBrowser functions are available for ODX-based diagnostics only and are not supported when using CDD or GDX, for example.

GetDiagDtcs()

Returns a list of DTC entities representing all diagnostics DTCs defined in the database

Returns:

A list of DiagDtcEntity

Return type:

list<DiagDtcEntity>

GetDiagServices()

Returns a list of service entities representing all diagnostics services defined in the database

Returns:

A list of DiagServiceEntity

Return type:

list<DiagServiceEntity>

GetDiagStateCharts()

Returns a list of state chart entities representing all state charts defined in the database

Returns:

A list of DiagStateChartEntity

Return type:

list<DiagStateChartEntity>

DiagDtcEntity

class DiagDtcEntity

The DiagDtcEntity represents one diagnostics dtc in the database.

GetSdgs()

Returns the special data of the diagnostics DTC from the data base. The special data is a set of key/value pairs, and can be subdivided into groups (SDGs).

GetShortName()

Returns the name of this DTC

Returns:

The name of DTC

Return type:

str | None

GetTroubleCode()

Returns trouble code as integer

DiagServiceEntity

class DiagServiceEntity

The DiagServiceEntity represents one diagnostics service in the database.

GetLongName()

Returns the long name of this service

Returns:

The long name of service

Return type:

str | None

GetPreconditions()

Returns a list of the states which are defined as preconditions for this service in the diagnostics database

Returns:

A list of precondition states

Return type:

list[DiagStateEntity]

GetSdgs()

Returns the special data of the diagnostics service from the database. The special data is a set of key/value pairs and can be subdivided into groups.

Returns:

A dictionary containing the special data group SI attribute or caption short name as key. The value will be the SD key/value pairs as further dictionaries

Return type:

dict<str, dict<str, str>>

GetServiceId()

Returns the service ID of this service

Info

e.g. 34 for ReadDataByIdentifier

Returns:

The service ID

Return type:

int

GetServiceName()

Returns the name of the service. This Methode distinguishes between different application layers (e.g. UDS, KWP 2000)

Info

e.g. “Read Data By Identifier”

Returns:

service name or “Unknown Service”

Return type:

str

GetShortName()

Returns the short name of this service

Returns:

The short name of service

Return type:

str

GetTransitions()

Returns a list of state transitions which will be performed if the service was successfully called

Returns:

A list of state transitions

Return type:

list<DiagStateTransitionEntity>

DiagStateChartEntity

class DiagStateChartEntity

The DiagStateChartEntity represents a state chart from the diagnostics database.

GetLongName()

Returns the long name of this state chart

Returns:

The long name

Return type:

str

GetSemantic()

Returns the semantic of this state chart

Returns:

The semantic

Return type:

str

GetShortName()

Returns the short name of this state chart

Returns:

The short name

Return type:

str

GetStartState()

Returns the start state of this state chart

Returns:

The start state

Return type:

DiagStateEntity

GetStateChartId()

Returns the ID of this state chart if it was defined in the diagnostics database

Returns:

The state chart ID

Return type:

str

GetStates()

Returns a list of all states inside this state chart

Returns:

A list of states

Return type:

list<DiagStateEntity>

GetTransitions()

Returns a list of all transitions inside this state chart

Returns:

A list of state transitions

Return type:

list<DiagStateTransitionEntity>

DiagStateEntity

class DiagStateEntity

The DiagStateEntity represents a state from the diagnostics database.

GetEndingTransitions()

Returns a list of state transitions which have this state as their target state

Returns:

A list of state transitions

Return type:

list[DiagStateTransitionEntity]

GetLongName()

Returns the long name of the state

Returns:

The long name of the state

Return type:

str | None

GetShortName()

Returns the short name of the state

Returns:

The short name of the state

Return type:

str

GetStartingTransitions()

Returns a list of state transitions which have this state as their source state

Returns:

A list of state transitions

Return type:

list[DiagStateTransitionEntity]

GetStateChart()

Returns the state chart this state belongs to

Returns:

The state chart

Return type:

DiagStateChartEntity

GetStateId()

Returns the ID of this state if it was specified in the diagnostics database

Returns:

The state ID

Return type:

str

DiagStateTransitionEntity

class DiagStateTransitionEntity

The DiagStateTransitionEntity represents a transition from one state to another as defined in the diagnostics data base.

GetLongName()

Returns the long name of this transition

Returns:

The long name

Return type:

str | None

GetServices()

Returns a list of all services which may trigger this transition

Returns:

A list of services

Return type:

list[DiagServiceEntity]

GetShortName()

Returns the short name of this transition

Returns:

The short name

Return type:

str | None

GetSourceState()

Returns the source state of this transition

Returns:

The state

Return type:

DiagStateEntity

GetStateChart()

Returns the state chart this transition belongs to

Returns:

The state chart

Return type:

DiagStateChartEntity

GetTargetState()

Returns the target state of this transition

Returns:

The state

Return type:

DiagStateEntity

GetTransitionId()

Returns the ID of this transition if it was specified in the diagnostics database

Returns:

The transition ID

Return type:

str

LoggingBrowser

class LoggingBrowser

The LoggingBrowser type provides an interface to a logging database. It is possible to retrieve information for a single entry or to use a full text search to get a list of filtered entries. Every entity is represented by an instance of the type LoggingEntity.

GetProtocol()

Returns the logging protocol configured for the ECU

Returns:

“DLT (non-verbose)” or “DLT (verbose)”

Return type:

str

ListArguments(messageName, filter='')

Returns a list of LoggingEntity instances corresponding to message arguments whose name matches the specified search string

Returns an empty list if the logging protocol is not “DLT (non-verbose)”.

Parameters:
messageName : str

The exact name of the message in which to search for arguments

filter : str

The search string which is part of a logging argument’s nam

Returns:

A list of LoggingEntity instances if the logging database contains entries with the given search string, otherwise an empty list

Return type:

list <LoggingEntity>

ListMessages(filter='')

Returns a list of LoggingEntity instances corresponding to messages whose name matches the specified search string

Parameters:
filter : str

The search string which is part of a logging message’s name

Returns:

A list of LoggingEntity instances if the logging database contains entries with the given search string, otherwise an empty list

Return type:

list <LoggingEntity>

LoggingEntity

class LoggingEntity

The LoggingEntity type represents one entry in a logging database.

GetArgumentLength()

Returns the length of the argument in bits if this logging entity is a logging argument of protocol “DLT (non-verbose)” else None

Returns:

The length of the argument

Return type:

int or None

GetArgumentPositionInMessage()

Returns the argument’s bit position relative to the message if this logging entity is a logging argument of protocol “DLT (non-verbose)” else None

Returns:

The argument’s bit position

Return type:

int or None

GetDescription()

Returns the description of this logging entity

Returns:

The description

Return type:

str

GetFilterDescription()

Returns the filter description if this logging message of protocol “DLT (verbose)”, otherwise None

Returns:

Dict with filter attribute name as key and filter value as value. The filter values are of type bool for flags, and type str for text values, IDs and regular expressions. Regular expressions are introduced with “RegEx: “. If an attribute is not filtered, its value is None.

Return type:

dict<str, str|bool> or None

GetId()

Returns the message identifier if this logging entity is a logging message else None

Returns:

The identifier

Return type:

str or None

GetMessageLength()

Returns the length of the message in bytes if this logging entity is a logging message of protocol “DLT (non-verbose)” else None

Returns:

The length of the message

Return type:

int or None

GetName()

Returns the name of this logging entity

Returns:

The name

Return type:

str

GetPath()

Returns the variablepath of this logging entity

Returns:

The variablepath (/<messageName>/<argumentName>/)

Return type:

str

GetPhysValue(rawValue)

Returns the physical value of given raw value

Info

Only valid for logging arguments of protocol “DLT (non-verbose)”

Returns:

The physical value of given raw value

Return type:

float

GetRawValue(value)

Returns the raw value of given value

Info

Value can be text or physical value. Only valid for logging arguments of protocol “DLT (non-verbose)”

Returns:

The raw value of given value

Return type:

int

GetTxEcuNames()

Returns the names of the ECUs which transmit this message/signal

Info

Only valid for protocol “DLT (non-verbose)”

Returns:

The names of the ECUs

Return type:

list<str>

IsArgument()

Checks if this logging entity is a logging argument

Returns:

True if this entity is a logging argument else False

Return type:

bool

IsMessage()

Checks if this logging entity is a logging message

Returns:

True if this entity is a logging message else False

Return type:

bool

MediaBrowser

class MediaBrowser

The MediaBrowser provides access to images and masks from the file system.

Images can be accessed via the Images property. E.g. mediaBrowser.Images.myImage. This will return an object of type Image.

Masks can be accessed via the Masks property. E.g. mediaBrowser.Masks.myMask. This will return an object of type Mask.

Example:

Suppose there is a file called “myImage.png” in the image directory that is associated with the media node “CAM”. Then you could access it with:

>>> api.DataBrowser.BrowseMultimedia("CAM").Images.myImage

ModelBrowser

class ModelBrowser

The ModelBrowser provides an interface to a model database. It is possible to search the available variable paths.

FindVariables(searchString, maxResults=None)

Find all variables in the model tree whose full model path matches the given search string. The search may include the wildcards ‘*’ and ‘?’. Only leaf elements of the model tree are returned. These are either parameters, signals or virtual signals of the model.

Parameters:
searchString : str

string for search

maxResults : int | None

maximal number of returned found items

Returns:

list of found model paths

Return type:

list <str>

ServiceBrowser

class ServiceBrowser

The ServiceBrowser type provides an interface to a service database which allows to access information regarding ECUs, services, methods, events etc.

GetE2EProfile(ecuName, serviceName, methodOrEventName, eventgroupName=None, fieldName=None)

Returns the E2E profile configuration of an event or a field or a method

Info

A method may have different profiles for input and output parameters. Profiles 4 and 7 are currently supported.

Parameters:
ecuName : str

The name of the ECU

serviceName : str

The name of the service

methodOrEventName : str

The event or method name

eventgroupName : str or None

The name of the event group or None

fieldName : str or None

The name of the field or None

Return type:

dict

Info

The key is the extended name of the E2E input “in” or return “out” parameter. The values are E2E configuration parameters. The validity of each of the configuration parameters depends on the E2E profile. See the item “category”.

GetEcuConsumerInfos(providerEcuName, serviceName, eventGroupName=None)

Returns network infos of the consumer ECUs of the service (or event group), that is specified by a given providerEcuName, serviceName (and eventGroupName). Use only for ARXMLs of version AUTOSAR_00048 or higher. If the port is assigned dynamically at runtime, the key ‘Port’ will return ‘dynamic’.

Parameters:
providerEcuName : str

The name of the providing ECU

serviceName : str

The name of the service

eventGroupName : str | None

If set, the name of the provided event group

Returns:

Network infos ecuName, IP, TP=UDP|TCP, Port of consuming ECUs as list of dicts with the keys: ecuName, IP, TP (transport protocol = UDP|TCP), Port (<int>|’dynamic’)

Return type:

list <dict>

GetEcuConsumerNamesByServiceName(serviceName)

Returns the ECUs the given service is consumed by

Parameters:
serviceName : str

The name of the service

Returns:

The names of the events

Return type:

list <str>

GetEcuNamesByServiceName(serviceName)

Returns the ECUs the given service is provided by

Parameters:
serviceName : str

The name of the service

Returns:

The names of the ECUs

Return type:

list <str>

GetEcus()

Returns all ECU names

Returns:

The names of the ECUs

Return type:

list <str>

GetEventGroupInfos(ecuName, serviceName)

Returns name and ID of all event groups of a given service

Parameters:
ecuName : str

The Name of the ECU

serviceName : str

The name of the service

Returns:

List of tuples with name and ID of all event groups

Return type:

list <tuple <str, int> >

GetEventInfos(ecuName, serviceName, eventgroupName, fieldName=None)

Returns name and ID of all events of a given event group

Parameters:
ecuName : str

The name of the ECU

serviceName : str

The name of the service

eventgroupName : str

The name of the event group

fieldName : str or None

(Optional) The name of the field

Returns:

List of tuples with name and ID of all events

Return type:

list <tuple <str, int> >

GetFieldNamesByServiceName(ecuName, serviceName)

Returns field names of a given service

Parameters:
ecuName : str

The name of the ECU

serviceName : str

The name of the service

Returns:

The names of the fields

Return type:

list <str>

GetInputParameterRepresentation(ecuName, serviceName, methodOrEventName, eventgroupName=None, fieldName=None)

Returns a nested dict which contains the type definitions of all input values of an event, a field or a method.

Parameters:
ecuName : str

name of the ECU

serviceName : str

name of the service

methodOrEventName : str

event or method name

eventgroupName : str / None

name of the event group or None

fieldName : str / None

name of the field or None

Return type:

dict

GetInstanceID(ecuName, serviceName)

Returns the instance ID of a given service

Parameters:
ecuName : str

The name of the ECU

serviceName : str

The name of the service

Returns:

The instance ID

Return type:

str or None

GetMethodInfos(ecuName, serviceName, fieldName=None)

Returns name and ID of all methods of a given service

Parameters:
ecuName : str

The name of the ECU

serviceName : str

The name of the service

fieldName : str or None

(Optional) The name of the field

Returns:

List of tuples with name and ID of all methods

Return type:

list <tuple <str, int> >

GetOfferCyclicDelay(ecuName, serviceName)

Returns the delay between cyclic offers in seconds of a given service

Parameters:
ecuName : str

The name of the ECU

serviceName : str

The name of the service

Returns:

Cyclic offers in seconds

Return type:

float or None

GetReturnParameterRepresentation(ecuName, serviceName, methodOrEventName, eventgroupName=None, fieldName=None)

Returns a nested dict which contains the type definitions of all return values of an event, a field or a method.

Parameters:
ecuName : str

name of the ECU

serviceName : str

name of the service

methodOrEventName : str

event or method name

eventgroupName : str / None

name of the event group or None

fieldName : str / None

name of the field or None

Return type:

dict

GetServiceAdressInfos(ecuName, serviceName)

Returns all provider adress infos of a given service

Parameters:
ecuName : str

The name of the ECU

serviceName : str

The name of the service

Returns:

Dict with provider adress ‘IP’ and ‘TCP’ or ‘UDP’ source port

Return type:

<dict>

GetServiceID(ecuName, serviceName)

Returns the service ID of a given service

Parameters:
ecuName : str

The name of the ECU

serviceName : str

The name of the service

Returns:

The service ID

Return type:

str or None

GetServiceInfos(ecuName=None)

Returns name and ID of all provided services (of a given ECU)

Parameters:
ecuName : str or None

(Optional) Name of the ECU

Returns:

List of tuples with name and ID of services

Return type:

dict <tuple <str, int> >

GetTimings(ecuName, serviceName, methodName, eventgroupName=None, fieldName=None)

Returns timing information of a given event or method

Parameters:
ecuName : str

The name of the ECU

serviceName : str

The name of the service

methodName : str

The name of the method

eventgroupName : str or None

(Optional) The name of the event group

fieldName : str or None

(Optional) The name of the field

Returns:

Dict with keys ‘ApplicationCycleTime’, ‘DebounceTimeRange’, ‘RequestDebounceTimeRange’, ‘TpSeparationTime’ and their values

Return type:

dict

GetVersion(ecuName, serviceName)

Returns the minor and major version of a given service

Parameters:
ecuName : str

The name of the ECU

serviceName : str

The name of the service

Returns:

Tuple with the minor and major version

Return type:

tuple <int, int>

GetVlanInfo(ecuName, serviceName)

Returns the VLAN ID and the default priority of a given service

Parameters:
ecuName : str

The name of the ECU

serviceName : str

nThe name of the service

Returns:

VLAN ID and the default priority

Return type:

tuple(int, int)

SgbdBrowser

class SgbdBrowser

The SgbdBrowser type provides an interface to a SGBD file. It is possible to retrieve information for a single entry or to use a full text search to get a list of filtered entries. Every entity is represented by an instance of the type SgbdEntity.

Info

prototype

GetJob(jobName)

Returns the SgbdEntity of a Job if it exists in selected SGBD or None if does not

Parameters:
jobName : str

Name of job to get

Returns:

SgbdEntity for the first matching job or None

Return type:

SgbdEntity or None

GetListTableNames()

Returns a list which contains all SGBD table names

Returns:

A list with all SGBD table names

Return type:

list <str>

IsJob(jobName)

Returns True if Job exists in selected SGBD or False if not

Parameters:
jobName : str

The name of job to be checked

Returns:

True if Job exists or False if not

Return type:

bool

ListJobs(filter='')

Returns a list which contains instances of SgbdEntity whose matches the specified job search string

Parameters:
filter : str

The search string which is part of a job

Returns:

A list of SgbdEntity instances if the SGBD file contains entries with the given search string, otherwise an empty list

Return type:

list <SgbdEntity>

Info

prototype

QueryTableByArgument(job=None, argument=None)

Returns a dictionary representing a specific argument table of the given job

Parameters:
job : str

The name of the job

argument : str

The name of the argument

Returns:

A dictionary representing the columns of the argument table

Return type:

dict

QueryTableByName(tableName=None)

Returns the SGBD table indicated by the given name

Parameters:
tableName : str

The name of a SGBD table

Returns:

A dictionary representing the columns of the SGBD table

Return type:

dict

QueryTableByResult(job=None, result=None)

Returns a dictionary representing a specific result table of the given job

Parameters:
job : str

The name of the job

result : str

The name of the result

Returns:

A dictionary representing the columns of the result table

Return type:

dict

SgbdEntity

class SgbdEntity

The SgbdEntity type represents one entry in a SGBD file.

Info

prototype

GetArgumentType(argumentName)

Returns the argument type of this SGBD entity argument name

Parameters:
argumentName : str

The argument name

Returns:

The argument type

Return type:

str

GetArguments()

Returns the arguments of this SGBD entity

Returns:

The arguments

Return type:

list <str>

Info

prototype

GetDescription()

Returns the description of this SGBD entity

Returns:

The description

Return type:

str

Info

prototype

GetName()

Returns the name of this SGBD entity

Returns:

The name

Return type:

str

Info

prototype

GetResultType(resultName)

Returns the result type of this SGBD entity result name

Parameters:
resultName : str

The result name

Returns:

The result type

Return type:

str

GetResults()

Returns the results of this SGBD entity

Returns:

The results

Return type:

list <str>

Info

prototype

UnitInfo

UnitInfo

class UnitInfo

UnitInfo provides functions to retrieve information concerning unit definitions

Convert(value, srcUnit, dstUnit)

Converts the given value from a source unit into the destination unit

Info

A unitless size (noUnit) cannot be converted.

Parameters:
value : float

Numeric value in source unit to be converted

srcUnit : str

Name of source unit

dstUnit : str

Name of destination unit

Returns:

Converted numeric value in destination unit, or None, if not convertable

Return type:

float or None

GetDimension(unitString)

Provides the dimension of a unit

Parameters:
unitString : str

Name of unit

Returns:

Dimension or None if unit unknown

Return type:

str or None

HasUnit(unitString)

Checks whether the unit is defined in the units definition file

Parameters:
unitString : str

Name of unit

Returns:

True or False

Return type:

bool