Skip to content

Create a ClientTrait for RustSDK #142

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
04a577e
Create a ClientTrait for RustSDK
lukasmittag Feb 26, 2025
dc73f97
Fix clippy finding
lukasmittag Feb 26, 2025
6a20b9d
Use ClientTrait in integration tests for databroker
lukasmittag Feb 26, 2025
e3c9725
Fix comments
lukasmittag Feb 27, 2025
9d99ca5
Rename types for Actuation and Sensor providing
lukasmittag Feb 27, 2025
33e305c
Types, conversion and ClientTraits for different versions
lukasmittag Mar 17, 2025
36a47c0
Implement SDVClientTrait for sdv.databroker.v1 client
lukasmittag Mar 17, 2025
0788461
Implement SDVClientTrait and ClientTraitV1 for kuksa.val.v1 client
lukasmittag Mar 17, 2025
8b79c7b
Implement ClientTraitV1 and ClientTraitV2 for kuksa.val.v2 client
lukasmittag Mar 17, 2025
8e0985a
Adapt cli to use ClientTraits correctly
lukasmittag Mar 17, 2025
efb84d4
Adapt databroker tests to use ClientTraits correctly
lukasmittag Mar 17, 2025
0393283
Fix types of kuksa.val.v2 client
lukasmittag Mar 18, 2025
e99185f
Convert &str to String and use clone
lukasmittag Mar 18, 2025
94039a2
Formatting
lukasmittag Mar 20, 2025
82bfa41
Review findings
lukasmittag Mar 21, 2025
fb73023
Add unit tests for conversion functions
lukasmittag Mar 24, 2025
32fbae1
Remove unit type comparisons
lukasmittag Mar 24, 2025
0767fd1
Merge branch 'main' into feature/rust_sdk_client_trait
lukasmittag Mar 25, 2025
734411f
Adapt to new metadata structure in kuksa.val.v2
lukasmittag Mar 25, 2025
3db8572
Align naming
lukasmittag Mar 25, 2025
d6763a6
Fix logger initialization
lukasmittag Mar 25, 2025
c13cf45
Formatting
lukasmittag Mar 25, 2025
41ffc53
Update lock files
lukasmittag Mar 25, 2025
851a688
Remove code duplicates
lukasmittag Mar 25, 2025
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
66 changes: 66 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

255 changes: 101 additions & 154 deletions databroker-cli/src/kuksa_cli.rs

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions databroker-cli/src/sdv_cli.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2023 Contributors to the Eclipse Foundation
* Copyright (c) 2025 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
Expand All @@ -12,6 +12,7 @@
********************************************************************************/

use databroker_proto::sdv::databroker as proto;
use kuksa_common::SDVClientTraitV1;
use kuksa_sdv::*;

use prost_types::Timestamp;
Expand Down Expand Up @@ -451,7 +452,7 @@ pub async fn sdv_main(_cli: Cli) -> Result<(), Box<dyn std::error::Error>> {
}
let ts = Timestamp::from(SystemTime::now());
let datapoints = HashMap::from([(
metadata.id,
metadata.name.clone(),
proto::v1::Datapoint {
timestamp: Some(ts),
value: Some(data_value.unwrap()),
Expand Down
3 changes: 2 additions & 1 deletion databroker/tests/read_write_values.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2023 Contributors to the Eclipse Foundation
* Copyright (c) 2025 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
Expand All @@ -17,6 +17,7 @@ use std::{collections::HashMap, future, time::SystemTime, vec};
use cucumber::{cli, gherkin::Step, given, then, when, writer, World as _};
use databroker::broker;
use databroker_proto::kuksa::val::v1::{datapoint::Value, DataType, Datapoint};
use kuksa_common::ClientTraitV1;
use tracing::debug;
use world::{DataBrokerWorld, ValueType};

Expand Down
163 changes: 163 additions & 0 deletions lib/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions lib/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ tokio = { workspace = true, features = [
] }
tokio-stream = { workspace = true, features = ["sync"] }
http = "0.2.8"
log = "0.4"
env_logger = "0.11"

[dev-dependencies]
prost = "0.12"
prost-types = "0.12"

[lib]
name = "kuksa_common"
Expand Down
Loading
Loading