Crate autosar_data_abstraction

Source
Expand description

§Crate autosar-data-abstraction

This crate provides an abstraction layer for the AUTOSAR data model. It is built on top of the crate autosar-data and provides complex interactions with the model on top of the elementary operations of autosar-data.

Since the AUTOSAR data model is very complex and has many different types of elements, this crate does not aim to provide full coverage of all classes. Instead the focus is on the most common classes and their interactions.

Any other data can still be accessed through the basic operations of autosar-data, because the calls to autosar-data and autosar-data-abstraction can be mixed freely.

§Example

let model = AutosarModelAbstraction::create("file.arxml", AutosarVersion::Autosar_00049);
let package_1 = model.get_or_create_package("/System")?;
let system = package_1.create_system("System", SystemCategory::SystemExtract)?;
let package_2 = model.get_or_create_package("/Clusters")?;

// create an Ethernet cluster and a physical channel for VLAN 33
let eth_cluster = system.create_ethernet_cluster("EthCluster", &package_2)?;
let vlan_info = EthernetVlanInfo {
    vlan_id: 33,
    vlan_name: "VLAN_33".to_string(),
};
let eth_channel = eth_cluster.create_physical_channel("EthChannel", Some(vlan_info))?;
let vlan_info_2 = eth_channel.vlan_info().unwrap();

// create an ECU instance and connect it to the Ethernet channel
let package_3 = model.get_or_create_package("/Ecus")?;
let ecu_instance_a = system.create_ecu_instance("Ecu_A", &package_3)?;
let ethctrl = ecu_instance_a
    .create_ethernet_communication_controller(
        "EthernetController",
        Some("ab:cd:ef:01:02:03".to_string())
    )?;
let channels_iter = ethctrl.connected_channels();
ethctrl.connect_physical_channel("Ecu_A_connector", &eth_channel)?;
let channels_iter = ethctrl.connected_channels();

// ...

Modules§

communication
Communication between ECUs in a system
datatype
Autosar Data Types
ecu_configuration
Module for ECU configuration
software_component
Software component types and compositions

Structs§

ArPackage
An ArPackage is an Autosar package, which can contain other packages or elements
AutosarModelAbstraction
The AutosarModelAbstraction wraps an AutosarModel and provides additional functionality
EcuInstance
The EcuInstance represents one ECU in a System
EcuInstanceIterator
An iterator over all EcuInstances in a System
SwcToEcuMapping
A SwcToEcuMapping contains a mapping between a SwComponentPrototype and an EcuInstance
System
The System is the top level of a system template
SystemMapping
A SystemMapping contains mappings in the System

Enums§

AutosarAbstractionError
The error type AutosarAbstractionError wraps all errors from the crate
ByteOrder
The ByteOrder is used to define the order of bytes in a multi-byte value
SystemCategory
The category of a System

Traits§

AbstractionElement
The AbstractionElement trait is implemented by all classes that represent elements in the AUTOSAR model.
IdentifiableAbstractionElement
The IdentifiableAbstractionElement trait is implemented by all classes that represent elements in the AUTOSAR model that have an item name.