API Documentation: autosar_data.abstraction

Description

The base package of the abstraction API provides a small number of classes shared by it's sub-packages. it would usually only be used in combination with one of these:

API

abstraction

ArPackage

ArPackage(element: Element)

An ArPackage is an Autosar package, which can contain other packages or elements

element instance-attribute

element: Element

name instance-attribute

name: str

create_application_array_data_type

create_application_array_data_type(
    name: str,
    element_type: ApplicationDataType,
    size: ApplicationArraySize,
) -> ApplicationArrayDataType

create a new ApplicationArrayDataType in the package

create_application_primitive_data_type

create_application_primitive_data_type(
    name: str,
    category: ApplicationPrimitiveCategory,
    /,
    *,
    compu_method: CompuMethod = None,
    unit: Unit = None,
    data_constraint: DataConstr = None,
) -> ApplicationPrimitiveDataType

create a new ApplicationPrimitiveDataType in the package

create_application_record_data_type

create_application_record_data_type(
    name: str,
) -> ApplicationRecordDataType

create a new ApplicationRecordDataType in the package

create_application_sw_component_type

create_application_sw_component_type(
    name: str,
) -> ApplicationSwComponentType

create a new ApplicationSwComponentType in the package

create_client_server_interface

create_client_server_interface(
    name: str,
) -> ClientServerInterface

create a new ClientServerInterface in the package

create_complex_device_driver_sw_component_type

create_complex_device_driver_sw_component_type(
    name: str,
) -> ComplexDeviceDriverSwComponentType

create a new ComplexDeviceDriverSwComponentType in the package

create_composition_sw_component_type

create_composition_sw_component_type(
    name: str,
) -> CompositionSwComponentType

create a new CompositionSwComponentType in the package

create_compu_method

create_compu_method(
    name: str, content: CompuMethodContent
) -> CompuMethod

create a new CompuMethod in the package

create_data_constr

create_data_constr(name: str) -> DataConstr

create a new DataConstr in the package

create_data_transformation_set

create_data_transformation_set(
    name: str,
) -> DataTransformationSet

create a new DataTransformationSet in the package

create_data_type_mapping_set

create_data_type_mapping_set(
    name: str,
) -> DataTypeMappingSet

create a new DataTypeMappingSet in the package

create_ecu_abstraction_sw_component_type

create_ecu_abstraction_sw_component_type(
    name: str,
) -> EcuAbstractionSwComponentType

create a new EcuAbstractionSwComponentType in the package

create_ecuc_definition_collection

create_ecuc_definition_collection(
    name: str,
) -> EcucDefinitionCollection

create a new EcucDefinitionCollection in the package

create_ecuc_destination_uri_def_set

create_ecuc_destination_uri_def_set(
    name: str,
) -> EcucDestinationUriDefSet

create a new EcucDestinationUriDefSet in the package

create_ecuc_module_configuration_values

create_ecuc_module_configuration_values(
    name: str, definition: EcucModuleDef
) -> EcucModuleConfigurationValues

create a new EcucModuleConfigurationValues in the package

create_ecuc_module_def

create_ecuc_module_def(name: str) -> EcucModuleDef

create a new EcucModuleDef in the package

create_ecuc_value_collection

create_ecuc_value_collection(
    name: str,
) -> EcucValueCollection

create a new EcucValueCollection in the package

create_implementation_data_type

create_implementation_data_type(
    settings: ImplementationDataTypeSettings,
) -> ImplementationDataType

create a new ImplementationDataType in the package

create_mode_switch_interface

create_mode_switch_interface(
    name: str,
) -> ModeSwitchInterface

create a new ModeSwitchInterface in the package

create_nv_data_interface

create_nv_data_interface(name: str) -> NvDataInterface

create a new NvDataInterface in the package

create_parameter_interface

create_parameter_interface(name: str) -> ParameterInterface

create a new ParameterInterface in the package

create_sender_receiver_interface

create_sender_receiver_interface(
    name: str,
) -> SenderReceiverInterface

create a new SenderReceiverInterface in the package

create_sensor_actuator_sw_component_type

create_sensor_actuator_sw_component_type(
    name: str,
) -> SensorActuatorSwComponentType

create a new SensorActuatorSwComponentType in the package

create_service_sw_component_type

create_service_sw_component_type(
    name: str,
) -> ServiceSwComponentType

create a new ServiceSwComponentType in the package

create_someip_sd_client_event_group_timing_config

create_someip_sd_client_event_group_timing_config(
    name: str, time_to_live: int
) -> SomeipSdClientEventGroupTimingConfig

create a new SomeipSdClientEventGroupTimingConfig in the package

create_someip_sd_client_service_instance_config

create_someip_sd_client_service_instance_config(
    name: str,
) -> SomeipSdClientServiceInstanceConfig

create a new SomeipSdClientServiceInstanceConfig in the package

create_someip_sd_server_event_group_timing_config

create_someip_sd_server_event_group_timing_config(
    name: str, request_response_delay: RequestResponseDelay
) -> SomeipSdServerEventGroupTimingConfig

create a new SomeipSdServerEventGroupTimingConfig in the package

create_someip_sd_server_service_instance_config

create_someip_sd_server_service_instance_config(
    name: str, ttl: int
) -> SomeipSdServerServiceInstanceConfig

create a new SomeipSdServerServiceInstanceConfig in the package

create_sub_package

create_sub_package(name: str) -> ArPackage

create a new sub-package in the package

create_sw_base_type

create_sw_base_type(
    name: str,
    bit_length: int,
    base_type_encoding: BaseTypeEncoding,
    /,
    *,
    byte_order: Optional[ByteOrder] = None,
    mem_alignment: Optional[int] = None,
    native_declaration: Optional[str] = None,
) -> SwBaseType

create a new SwBaseType in the package

create_system

create_system(
    name: str, category: SystemCategory
) -> System

create a new System in the package

Note that an Autosar model should ony contain one SYSTEM. This is not checked here.

create_system_signal

create_system_signal(name: str) -> SystemSignal

create a new SystemSignal in the package

create_system_signal_group

create_system_signal_group(name: str) -> SystemSignalGroup

create a new SystemSignalGroup in the package

create_trigger_interface

create_trigger_interface(name: str) -> TriggerInterface

create a new TriggerInterface in the package

create_unit

create_unit(
    name: str, /, *, display_name: Optional[str] = None
) -> Unit

create a new Unit in the package

elements

elements() -> Iterator[Element]

iterate over all elements in the package

sub_packages

sub_packages() -> Iterator[ArPackage]

iterate over all sub-packages in the package

AutosarModelAbstraction

AutosarModelAbstraction(model: AutosarModel)

model instance-attribute

model: AutosarModel

Get the underlying AutosarModel from the abstraction model

root_element instance-attribute

root_element: Element

Get the root element of the model

create classmethod

create(
    filename: str,
    /,
    *,
    version: Optional[AutosarVersion] = None,
) -> AutosarModelAbstraction

create a new AutosarModelAbstraction with an empty AutosarModel

create_file

create_file(
    filename: str,
    /,
    *,
    version: Optional[AutosarVersion] = None,
) -> ArxmlFile

Create a new file in the model

files

files() -> Iterator[ArxmlFile]

iterate over all files in the model

find_system

find_system() -> Optional[System]

find an existing SYSTEM in the model, if it exists

from_file classmethod

from_file(filename: str) -> AutosarModelAbstraction

create an AutosarModelAbstraction from a file on disk

get_element_by_path

get_element_by_path(path: str) -> Optional[Element]

Get an element by its path

get_or_create_package

get_or_create_package(path: str) -> ArPackage

Get a package by its path or create it if it does not exist

packages

packages() -> Iterator[ArPackage]

iterate over all top-level packages

write

write() -> None

write the model to disk, creating or updating all files in the model

ByteOrder

The ByteOrder is used to define the order of bytes in a multi-byte value

MostSignificantByteFirst instance-attribute

MostSignificantByteFirst: ByteOrder

MostSignificantByteLast instance-attribute

MostSignificantByteLast: ByteOrder

Opaque instance-attribute

Opaque: ByteOrder

EcuInstance

EcuInstance(element: Element)

The EcuInstance represents one ECU in a SystemUnion[

element instance-attribute

element: Element

name instance-attribute

name: str

communication_controllers

communication_controllers() -> Iterator[
    CommunicationController
]

return an interator over all communication controllers in this EcuInstance

create_can_communication_controller

create_can_communication_controller(
    name: str,
) -> CanCommunicationController

Create a CAN-COMMUNICATION-CONTROLLER for this ECU-INSTANCE

The ECU must have one controller per bus it communicates on. For example, if it communicates on two CAN buses, then two CAN-COMMUNICATION-CONTROLLERs are needed.

create_ethernet_communication_controller

create_ethernet_communication_controller(
    name: str, /, *, mac_address: Optional[str] = None
) -> EthernetCommunicationController

Create an ETHERNET-COMMUNICATION-CONTROLLER for this ECU-INSTANCE

The ECU must have one controller per bus it communicates on. For example, if it communicates on two CAN buses, then two CAN-COMMUNICATION-CONTROLLERs are needed.

create_flexray_communication_controller

create_flexray_communication_controller(
    name: str,
) -> FlexrayCommunicationController

Create a FLEXRAY-COMMUNICATION-CONTROLLER for this ECU-INSTANCE

The ECU must have one controller per bus it communicates on. For example, if it communicates on two CAN buses, then two CAN-COMMUNICATION-CONTROLLERs are needed.

SwcToEcuMapping

SwcToEcuMapping(element: Element)

A SwcToEcuMapping contains a mapping between a SwComponentPrototype and an EcuInstance

ecu_instance instance-attribute

ecu_instance: Optional[EcuInstance]

get the ECU instance which is the target of this mapping

element instance-attribute

element: Element

name instance-attribute

name: str

target_component instance-attribute

target_component: Optional[SwComponentPrototype]

get the component prototype that is mapped here

System

System(element: Element)

The System is the top level of a system template

It defines how ECUs communicate with each other over various networks. It also contains the mapping of software components to ECUs.

category instance-attribute

category: Optional[SystemCategory]

category of the system

element instance-attribute

element: Element

name instance-attribute

name: str

pnc_vector_length instance-attribute

pnc_vector_length: Optional[int]

set the pncVectorLength of the system

pnc_vector_offset instance-attribute

pnc_vector_offset: Optional[int]

set the pncVectorOffset of the system

root_sw_composition instance-attribute

root_sw_composition: Optional[RootSwCompositionPrototype]

get the root software composition of the system

clusters

clusters() -> Iterator[Cluster]

Create an iterator over all clusters connected to the SYSTEM

create_can_cluster

create_can_cluster(
    cluster_name: str,
    package: ArPackage,
    /,
    *,
    can_baudrate: Optional[int] = 500000,
) -> CanCluster

create a new CAN-CLUSTER

The cluster must have a channel to be valid, but this channel is not created automatically. Call [CanCluster::create_physical_channel] to create it.

create_can_frame

create_can_frame(
    name: str, package: ArPackage, byte_length: int
) -> CanFrame

create a new [CanFrame]

This new frame needs to be linked to a CanPhysicalChannel

create_can_tp_config

create_can_tp_config(
    name: str, package: ArPackage, can_cluster: CanCluster
) -> CanTpConfig

Create a CanTpConfig in the SYSTEM

CanTpConfigs contain the configuration how to segment or reassemble diagnostic messages on a CAN bus.

create_container_ipdu

create_container_ipdu(
    name: str,
    package: ArPackage,
    length: int,
    header_type: ContainerIPduHeaderType,
    rx_accept: RxAcceptContainedIPdu,
) -> ContainerIPdu

create a [ContainerIPdu] in the [System]

create_dcm_ipdu

create_dcm_ipdu(
    name: str, package: ArPackage, length: int
) -> DcmIPdu

create a [DcmIPdu] in the [System]

create_doip_tp_config

create_doip_tp_config(
    name: str,
    package: ArPackage,
    eth_cluster: EthernetCluster,
) -> DoIpTpConfig

Create a DoIpTpConfig in the SYSTEM

DoIpTpConfigs contain the configuration how to transmit diagnostic messages over IP networks.

create_ecu_instance

create_ecu_instance(
    name: str, package: ArPackage
) -> EcuInstance

create an EcuInstance that is connected to this System

create_ethernet_cluster

create_ethernet_cluster(
    cluster_name: str, package: ArPackage
) -> EthernetCluster

create a new ETHERNET-CLUSTER and connect it to the SYSTEM

The cluster must have at least one channel to be valid. Call [EthernetCluster.create_physical_channel] to create it.

create_fibex_element_ref

create_fibex_element_ref(elem: Element) -> None

connect an element to the SYSTEM by creating a FIBEX-ELEMENT-REF

If there is already a FIBEX-ELEMENT-REF, this function does nothing, successfully.

create_flexray_ar_tp_config

create_flexray_ar_tp_config(
    name: str,
    package: ArPackage,
    flexray_cluster: FlexrayCluster,
) -> FlexrayArTpConfig

Create a FlexrayArTpConfig in the SYSTEM

FlexrayArTpConfigs describe how to segment or reassemble diagnostic messages on a Flexray bus. This configuration type is used for Flexray AUTOSAR TP communication.

create_flexray_cluster

create_flexray_cluster(
    cluster_name: str,
    package: ArPackage,
    settings: FlexrayClusterSettings,
) -> FlexrayCluster

create a new FLEXRAY-CLUSTER and connect it to the SYSTEM

A FlexrayClusterSettings structure containing the timings and parameters for the Flexray cluster must be provided.

The cluster must have at least one channel to be valid. Call [FlexrayCluster.create_physical_channel] to create it.

create_flexray_frame

create_flexray_frame(
    name: str, package: ArPackage, byte_length: int
) -> FlexrayFrame

create a new [FlexrayFrame]

This new frame needs to be linked to a FlexrayPhysicalChannel

create_flexray_tp_config

create_flexray_tp_config(
    name: str,
    package: ArPackage,
    flexray_cluster: FlexrayCluster,
) -> FlexrayTpConfig

Create a FlexrayTpConfig in the SYSTEM

FlexrayTpConfigs describe how to segment or reassemble diagnostic messages on a Flexray bus. This configuration type is used for Flexray ISO TP communication.

create_general_purpose_ipdu

create_general_purpose_ipdu(
    name: str,
    package: ArPackage,
    length: int,
    category: GeneralPurposeIPduCategory,
) -> GeneralPurposeIPdu

create a [GeneralPurposeIPdu] in the [System]

create_general_purpose_pdu

create_general_purpose_pdu(
    name: str,
    package: ArPackage,
    length: int,
    category: GeneralPurposePduCategory,
) -> GeneralPurposePdu

create a [GeneralPurposePdu] in the [System]

create_isignal

create_isignal(
    name: str,
    package: ArPackage,
    bit_length: int,
    syssignal: SystemSignal,
    /,
    *,
    datatype: Optional[SwBaseType] = None,
) -> ISignal

create a new isignal in the [System]

create_isignal_group

create_isignal_group(
    name: str,
    package: ArPackage,
    system_signal_group: SystemSignalGroup,
) -> ISignalGroup

create a new signal group in the [System]

I-SIGNAL-GROUP and SYSTEM-SIGNAL-GROUP are created using the same name; therefore they must be placed in different packages: sig_package and sys_package may not be identical.

create_isignal_ipdu

create_isignal_ipdu(
    name: str, package: ArPackage, length: int
) -> ISignalIPdu

create an [ISignalIPdu] in the [System]

create_multiplexed_ipdu

create_multiplexed_ipdu(
    name: str, package: ArPackage, length: int
) -> MultiplexedIPdu

create a [MultiplexedIPdu] in the [System]

create_n_pdu

create_n_pdu(
    name: str, package: ArPackage, length: int
) -> NPdu

create an [NPdu] in the [System]

create_nm_config

create_nm_config(name: str, package: ArPackage) -> NmConfig

Create a new NmConfig in the SYSTEM

NmConfigs contain the configuration for network management. The System may contain zero or one NmConfigs.

create_nm_pdu

create_nm_pdu(
    name: str, package: ArPackage, length: int
) -> NmPdu

create an [NmPdu] in the [System]

create_secured_ipdu

create_secured_ipdu(
    name: str,
    package: ArPackage,
    length: int,
    secure_props: SecureCommunicationProps,
) -> SecuredIPdu

create a [SecuredIPdu] in the [System]

create_service_instance_collection_set

create_service_instance_collection_set(
    name: str, package: ArPackage
) -> ServiceInstanceCollectionSet

Create a ServiceInstanceCollectionSet in the SYSTEM

ServiceInstanceCollectionSets are part of the new ethernet modeling that was introduced in Autosar 4.5.0 (AUTOSAR_00048).

create_so_ad_routing_group

create_so_ad_routing_group(
    name: str,
    package: ArPackage,
    /,
    *,
    control_type: Optional[EventGroupControlType] = None,
) -> SoAdRoutingGroup

Create a SoAdRoutingGroup in the SYSTEM

SoAdRoutingGroup are part of the old ethernet modeling that was used prior to Autosar 4.5.0 (AUTOSAR_00048). The elements are still present (but obsolete) in newer versions of the standard. Old and new elements may not be mixed in the same model.

create_socket_connection_ipdu_identifier_set

create_socket_connection_ipdu_identifier_set(
    name: str, package: ArPackage
) -> SocketConnectionIpduIdentifierSet

Create a SocketConnectionIpduIdentifierSet in the SYSTEM

SocketConnectionIpduIdentifierSet are part of the new ethernet modeling that was introduced in Autosar 4.5.0 (AUTOSAR_00048).

create_someip_tp_config

create_someip_tp_config(
    name: str, package: ArPackage, cluster: Cluster
) -> SomeipTpConfig

Create a SomeipTpConfig in the SYSTEM

SomeipTpConfigs contain the configuration how to segment or reassemble large SomeipTp PDUs.

ecu_instances

ecu_instances() -> Iterator[EcuInstance]

get an iterator over all ECU-INSTANCEs in this SYSTEM

frames

frames() -> Iterator[Frame]

iterate over all Frames in the System

get_or_create_mapping

get_or_create_mapping(name: str) -> SystemMapping

get or create a mapping for this system

There does not seem to be any benefit to having multiple mappings for a single system, so this function will return the first mapping if it exists. Otherwise a new mapping will be created with the provided name.

isignal_groups

isignal_groups() -> Iterator[ISignalGroup]

iterate over all ISignalGroups in the System

isignals

isignals() -> Iterator[ISignal]

iterate over all ISignals in the System

This iterator returns all ISignals that are connected to the System using a FibexElementRef.

nm_config

nm_config() -> Optional[NmConfig]

Get the NmConfig of the SYSTEM, if any

The System may contain zero or one NmConfigs.

pdus

pdus() -> Iterator[Pdu]

iterate over all PDUs in the System

This iterator returns all PDUs that are connected to the System using a FibexElementRef.

set_root_sw_composition

set_root_sw_composition(
    name: str, composition_type: CompositionSwComponentType
) -> RootSwCompositionPrototype

set the root software composition of the system

This function will remove any existing root software composition

SystemCategory

The category of a System

AbstractSystemDescription instance-attribute

AbstractSystemDescription: SystemCategory

EcuExtract instance-attribute

EcuExtract: SystemCategory

EcuSystemDescription instance-attribute

EcuSystemDescription: SystemCategory

RptSystem instance-attribute

RptSystem: SystemCategory

SwClusterSystemDescription instance-attribute

SwClusterSystemDescription: SystemCategory

SystemConstraints instance-attribute

SystemConstraints: SystemCategory

SystemDescription instance-attribute

SystemDescription: SystemCategory

SystemExtract instance-attribute

SystemExtract: SystemCategory

SystemMapping

SystemMapping(element: Element)

A SystemMapping contains mappings in the System

it contains mappings between SWCs and ECUs, as well as between ports and signals

element instance-attribute

element: Element

name instance-attribute

name: str

system instance-attribute

system: Optional[System]

get the system that contains this mapping

map_sender_receiver_to_signal

map_sender_receiver_to_signal(
    signal: SystemSignal,
    data_element: VariableDataPrototype,
    port_prototype: PortPrototype,
    context_components: List[SwComponentPrototype],
    /,
    *,
    root_composition_prototype: Optional[
        RootSwCompositionPrototype
    ] = None,
) -> None

create a new mapping between a sender/receiver port and a signal

signal: the system signal that the port is mapped to

data_element: the data element that is mapped to the signal

port_prototype: the port prototype that contains the data element

context_components: a list of component prototypes from the root up to the component that directly contains the port. This list may be empty, or it could only contain the final application component prototype containing the port.

root_composition_prototype: the root composition prototype that contains the swc_prototype. Rarely required, but may be needed if multiple root compositions use the same composition/component hierarchy.

map_swc_to_ecu

map_swc_to_ecu(
    name: str,
    component_prototype: SwComponentPrototype,
    ecu: EcuInstance,
) -> SwcToEcuMapping

create a new mapping between a SWC and an ECU