pub struct FlexrayCluster(/* private fields */);
Expand description
A FlexrayCluster
contains all configuration items associated with a Flexray network.
The cluster connects multiple ECUs.
Implementations§
Source§impl FlexrayCluster
impl FlexrayCluster
Sourcepub fn update_settings(&self, settings: &FlexrayClusterSettings)
pub fn update_settings(&self, settings: &FlexrayClusterSettings)
update the cluster settings
The settings of a flexray cluster determine all the details of timing and slot layout. These settings are subject to multiple cross dependencies and constraints.
You may check the validity of the settings by calling FlexrayClusterSettings::verify
.
However, the update function does not require that the settings are valid, and will also update the model with invalid settings if desired.
§Example
let cluster = system.create_flexray_cluster("Cluster", &package, &FlexrayClusterSettings::default())?;
let mut settings = cluster.settings();
settings.macro_per_cycle = 5000;
cluster.update_settings(&settings);
Sourcepub fn settings(&self) -> FlexrayClusterSettings
pub fn settings(&self) -> FlexrayClusterSettings
retrieve the current flexray cluster settings from a FlexrayCluster
§Example
let cluster = system.create_flexray_cluster("Cluster", &package, &settings_in)?;
let settings = cluster.settings();
Sourcepub fn create_physical_channel(
&self,
name: &str,
channel_name: FlexrayChannelName,
) -> Result<FlexrayPhysicalChannel, AutosarAbstractionError>
pub fn create_physical_channel( &self, name: &str, channel_name: FlexrayChannelName, ) -> Result<FlexrayPhysicalChannel, AutosarAbstractionError>
Create a new physical channel for the cluster
A cluster may contain channel A, channel B, or both A and B.
§Example
let cluster = system.create_flexray_cluster("Cluster", &package, &settings)?;
let channel = cluster.create_physical_channel("Channel", FlexrayChannelName::A)?;
§Errors
AutosarAbstractionError::ItemAlreadyExists
There is already a physical channel in this CAN clusterAutosarAbstractionError::ModelError
An error occurred in the Autosar model while trying to create the ECU-INSTANCE
Sourcepub fn physical_channels(&self) -> FlexrayPhysicalChannelsInfo
pub fn physical_channels(&self) -> FlexrayPhysicalChannelsInfo
get the physical channels of this cluster
§Example
let cluster = system.create_flexray_cluster("Cluster", &package, &FlexrayClusterSettings::default())?;
let channel = cluster.create_physical_channel("Channel", FlexrayChannelName::A)?;
Trait Implementations§
Source§impl AbstractCluster for FlexrayCluster
impl AbstractCluster for FlexrayCluster
Source§impl AbstractionElement for FlexrayCluster
impl AbstractionElement for FlexrayCluster
Source§impl Clone for FlexrayCluster
impl Clone for FlexrayCluster
Source§fn clone(&self) -> FlexrayCluster
fn clone(&self) -> FlexrayCluster
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for FlexrayCluster
impl Debug for FlexrayCluster
Source§impl From<FlexrayCluster> for Cluster
impl From<FlexrayCluster> for Cluster
Source§fn from(value: FlexrayCluster) -> Self
fn from(value: FlexrayCluster) -> Self
Converts to this type from the input type.
Source§impl From<FlexrayCluster> for Element
impl From<FlexrayCluster> for Element
Source§fn from(val: FlexrayCluster) -> Self
fn from(val: FlexrayCluster) -> Self
Converts to this type from the input type.
Source§impl Hash for FlexrayCluster
impl Hash for FlexrayCluster
Source§impl PartialEq for FlexrayCluster
impl PartialEq for FlexrayCluster
Source§impl TryFrom<Element> for FlexrayCluster
impl TryFrom<Element> for FlexrayCluster
impl Eq for FlexrayCluster
impl StructuralPartialEq for FlexrayCluster
Auto Trait Implementations§
impl Freeze for FlexrayCluster
impl !RefUnwindSafe for FlexrayCluster
impl Send for FlexrayCluster
impl Sync for FlexrayCluster
impl Unpin for FlexrayCluster
impl !UnwindSafe for FlexrayCluster
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.