pub trait AbstractLinCommunicationController: AbstractCommunicationController + Into<LinCommunicationController> {
// Provided methods
fn connected_channels(
&self,
) -> impl Iterator<Item = LinPhysicalChannel> + Send + use<Self> { ... }
fn connect_physical_channel(
&self,
connection_name: &str,
lin_channel: &LinPhysicalChannel,
) -> Result<LinCommunicationConnector, AutosarAbstractionError> { ... }
}Expand description
Common behaviour for LIN communication controllers
Provided Methods§
Sourcefn connected_channels(
&self,
) -> impl Iterator<Item = LinPhysicalChannel> + Send + use<Self>
fn connected_channels( &self, ) -> impl Iterator<Item = LinPhysicalChannel> + Send + use<Self>
return an iterator over the LinPhysicalChannels connected to this controller
§Example
let lin_master = ecu_instance.create_lin_master_communication_controller("LinMaster")?;
lin_master.connect_physical_channel("connection", &physical_channel)?;
for channel in lin_master.connected_channels() {
// ...
}§Errors
AutosarAbstractionError::ModelErrorAn error occurred in the Autosar model while trying to get the ECU-INSTANCE
Sourcefn connect_physical_channel(
&self,
connection_name: &str,
lin_channel: &LinPhysicalChannel,
) -> Result<LinCommunicationConnector, AutosarAbstractionError>
fn connect_physical_channel( &self, connection_name: &str, lin_channel: &LinPhysicalChannel, ) -> Result<LinCommunicationConnector, AutosarAbstractionError>
Connect this [CanCommunicationController] inside an EcuInstance to a [CanPhysicalChannel] in the crate::System
Creates a [CanCommunicationConnector] in the EcuInstance that contains this [CanCommunicationController].
This function establishes the relationships:
- [
CanPhysicalChannel] -> [CanCommunicationConnector] - [
CanCommunicationConnector] -> [CanCommunicationController]
§Example
let lin_slave = ecu_instance.create_lin_slave_communication_controller("LinSlave")?;
lin_slave.connect_physical_channel("connection", &physical_channel)?;§Errors
AutosarAbstractionError::ModelErrorAn error occurred in the Autosar model while trying to create the ECU-INSTANCE
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.