Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ObjectPool reading, writing and manipulations #23

Merged
merged 41 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
7e24191
Add ObjectPool reading, writing and manipulations
Thom-de-Jong Aug 15, 2023
e7d41c3
Update src/object_pool/mod.rs
Thom-de-Jong Aug 16, 2023
5249bf4
Update src/object_pool/mod.rs
Thom-de-Jong Aug 16, 2023
d20259c
Update src/object_pool/mod.rs
Thom-de-Jong Aug 16, 2023
e3c0164
integrating unit tests for object pool (to be continued)
Oct 7, 2023
67528ba
continue unit test and adding more specific option specifications
JannesBrands Oct 14, 2023
3f5b712
continue unit test from_iop
JannesBrands Oct 15, 2023
6a45980
continue unit test from_iop and simplification of pool object design
Oct 26, 2023
57934eb
GwnDaan review fixes
Nov 6, 2023
4909e68
reader.rs refactoring
Nov 6, 2023
67b4dcf
pass id to read functions
Nov 6, 2023
e00b9a5
format
Nov 6, 2023
41f756e
fix build
Nov 6, 2023
a6de6a3
format
Nov 6, 2023
1bacba5
clippy warnings
Nov 6, 2023
cd192da
writer.rs refactoring (for unit testing)
Nov 6, 2023
686c9c5
implement code planes
Nov 6, 2023
61b8c2f
Renaming and typing
Nov 6, 2023
b082dc7
example doc
Nov 9, 2023
0bc81e2
some validation stuff
Nov 9, 2023
0a66f92
..
Nov 10, 2023
ab49435
validate bool
Nov 15, 2023
5dce43f
fix read_bool
Nov 15, 2023
a8aa4ba
colour refactoring and rework
Nov 16, 2023
77d617f
add working set specific unit test
Nov 16, 2023
ff53e45
rework from_iop unit test (to be continued)
Nov 16, 2023
55e1518
todo working set read test
Nov 16, 2023
055169c
added nullable object id
Nov 16, 2023
cf25e90
.iop update
Nov 16, 2023
30c21ef
lint
Nov 16, 2023
7c9e21d
..
Nov 16, 2023
5d7132a
refactoring
Nov 16, 2023
685f836
lint
Nov 16, 2023
2bb8209
corrected test read_working_set_test
Nov 16, 2023
42d150a
refactor object attributes
Nov 16, 2023
781f3ed
fix bug -> u8 not u16
Nov 24, 2023
0cc6e9c
complete object option encapsulation
Nov 25, 2023
79c8011
add EQ to NAME
Nov 25, 2023
1c7e281
remove todo
JannesBrands Nov 26, 2023
78f6b8a
remove tests to fix them later
Dec 3, 2023
8e9c96a
Merge branch 'main' into tjd/object-pool
GwnDaan Dec 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ description = "A Free ISO-11783 and J1939 CAN Stack"
keywords = ["agriculture", "can", "canbus", "isobus", "j1939", "agritech", "smart-farming", "iso11783"]

[dependencies]
bitvec = "1.0.1"
rand = "0.8.5"
socketcan = { version = "2.0.0", optional = true }
strum_macros = "0.25.2"

[features]
default = []
Expand Down
Binary file added resources/test/AgIsoStack-rs-test-pool.iop
Binary file not shown.
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@

pub mod driver;
pub mod network_management;
pub mod object_pool;
8 changes: 7 additions & 1 deletion src/network_management/name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
SelfConfigurableAddress(bool),
}

#[derive(Copy, Clone, PartialEq)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct NAME {
raw_name: u64,
}
Expand Down Expand Up @@ -198,6 +198,12 @@
}
}

impl From<NAME> for [u8; 8] {
fn from(name: NAME) -> Self {
name.raw_name.to_le_bytes()

Check warning on line 203 in src/network_management/name.rs

View check run for this annotation

Codecov / codecov/patch

src/network_management/name.rs#L202-L203

Added lines #L202 - L203 were not covered by tests
}
}

#[derive(Default)]
pub struct NameBuilder {
self_configurable_address: bool,
Expand Down
339 changes: 339 additions & 0 deletions src/object_pool/colour.rs

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions src/object_pool/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
pub mod colour;
pub mod reader;
GwnDaan marked this conversation as resolved.
Show resolved Hide resolved
pub mod writer;

mod object;
mod object_attributes;
mod object_id;
mod object_pool;
mod object_type;
mod vt_version;

use crate::network_management::name::NAME;

pub use colour::Colour;
pub use object_pool::ObjectPool;
pub use object_type::ObjectType;

#[derive(Debug)]
pub enum ParseError {
DataEmpty,
UnknownObjectType,
}
Loading
Loading