From 23f307b11a90084cc304491729b327b1d904c965 Mon Sep 17 00:00:00 2001 From: Ash Beitz <8304894+ashbeitz@users.noreply.github.com> Date: Fri, 1 Mar 2024 09:42:36 -0800 Subject: [PATCH] Improved seat massager sample --- .github/workflows/check-spelling.yml | 2 +- digital-twin-model/Cargo.toml | 1 - digital-twin-model/src/sdv_v2.rs | 9 ++++++--- dtdl-tools/.accepted_words.txt | 8 ++++++++ dtdl-tools/README.md | 2 +- 5 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 dtdl-tools/.accepted_words.txt diff --git a/.github/workflows/check-spelling.yml b/.github/workflows/check-spelling.yml index 61768720..62aa8126 100644 --- a/.github/workflows/check-spelling.yml +++ b/.github/workflows/check-spelling.yml @@ -19,7 +19,7 @@ jobs: ./tools/check_spelling.sh ./README.md ./tools/check_spelling.sh ./container/README.md ./tools/check_spelling.sh ./core/common/README.md - ./tools/check_spelling.sh ./dtdl-parser/README.md + ./tools/check_spelling.sh ./dtdl-tools/README.md ./tools/check_spelling.sh ./docs/design/README.md ./tools/check_spelling.sh ./samples/managed_subscribe/README.md shell: bash diff --git a/digital-twin-model/Cargo.toml b/digital-twin-model/Cargo.toml index 115fad6f..0d214411 100644 --- a/digital-twin-model/Cargo.toml +++ b/digital-twin-model/Cargo.toml @@ -12,7 +12,6 @@ license = "MIT" derivative = { workspace = true } serde = { workspace = true } serde_derive = { workspace = true } -serde_json = { workspace = true } [lib] path = "src/lib.rs" diff --git a/digital-twin-model/src/sdv_v2.rs b/digital-twin-model/src/sdv_v2.rs index ae6f4597..2509bf8a 100644 --- a/digital-twin-model/src/sdv_v2.rs +++ b/digital-twin-model/src/sdv_v2.rs @@ -2,12 +2,15 @@ // Licensed under the MIT license. // SPDX-License-Identifier: MIT -// Note: In the future this code should be generated from a DTDL spec. +// This file contains the generated code for the Software Defined Vehicle (SDV) model. +// This code is manually generated today, but in the future it should be automatically generated from the DTDL. -pub fn context() -> Vec { +/// The context value for all JSON-LD generated by the code in this file. +fn context() -> Vec { vec!["dtmi:dtdl:context;2".to_string(), "dtmi:sdv:context;2".to_string()] } +/// Constants and type defintiions (including JSON serialization/deserialization) for each interface in the SDV model. #[allow(dead_code)] pub mod airbag_seat_massager { pub const ID: &str = "dtmi:sdv:airbag_seat_massager;1"; @@ -126,7 +129,7 @@ pub mod airbag_seat_massager { ID.to_string() } pub const NAME: &str = "airbag_adjustment"; - pub const DESCRIPTION: &str = "The airbag adjustments."; + pub const DESCRIPTION: &str = "An airbag adjustment."; #[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)] pub struct TYPE { pub airbag_identifier: i32, diff --git a/dtdl-tools/.accepted_words.txt b/dtdl-tools/.accepted_words.txt new file mode 100644 index 00000000..b84304eb --- /dev/null +++ b/dtdl-tools/.accepted_words.txt @@ -0,0 +1,8 @@ +dtdl +DTDL +DTDLParser +ibeji +Ibeji +json +validator +Validator diff --git a/dtdl-tools/README.md b/dtdl-tools/README.md index 367aafde..7e2254e7 100644 --- a/dtdl-tools/README.md +++ b/dtdl-tools/README.md @@ -13,7 +13,7 @@ It takes two command line arguments: * -e {file extension} The file extension used by the DTDL files. The default is "json". The CI/CD pipeline automatically validates DTDL files found under the ibeji/digital-twin-model/dtdl directory via dtdl-tools -test suite. Additonal directories containing DTDL files can also be checked by addining new test cases based on the one for +test suite. Additional directories containing DTDL files can also be checked by adding new test cases based on the one for the ibeji/digital-twin-model/dtdl directory. If you wish to manually run the the DTDL Validator application, then install it from Cargo's out directory to a custom directory by