-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into tjd/object-pool
Signed-off-by: Daan Steenbergen <[email protected]>
- Loading branch information
Showing
7 changed files
with
658 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright 2023 Raven Industries inc. | ||
use super::name::NAME; | ||
use crate::driver::CanId; | ||
|
||
pub struct CANMessage { | ||
data: Vec<u8>, | ||
identifier: CanId, | ||
source_name: NAME, | ||
destination_name: NAME, | ||
} | ||
|
||
impl CANMessage { | ||
pub(super) fn new(data: Vec<u8>, identifier: CanId) -> CANMessage { | ||
CANMessage { | ||
data, | ||
identifier, | ||
source_name: NAME::default(), | ||
destination_name: NAME::default(), | ||
} | ||
} | ||
|
||
pub fn get_data(&self) -> &[u8] { | ||
self.data.as_slice() | ||
} | ||
|
||
pub fn get_identifier(&self) -> CanId { | ||
self.identifier | ||
} | ||
|
||
pub fn get_source_name(&self) -> NAME { | ||
self.source_name | ||
} | ||
|
||
pub fn get_destination_name(&self) -> NAME { | ||
self.destination_name | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
// Copyright 2023 Raven Industries inc. | ||
pub mod can_message; | ||
pub mod common_parameter_group_numbers; | ||
pub mod control_function; | ||
pub mod name; | ||
pub mod network_manager; |
Oops, something went wrong.