Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jorchiu committed Nov 15, 2023
1 parent 6bb417b commit 130e205
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ through an extensible, open and dynamic architecture that provides access to the

## <a name="high-level-design">High-level Design</a>

Ibeji's architecture has an In-Vehicle Digital Twin Service at its core. The In-Vehicle Digital Twin Service captures all of the vehicle's primary capabilities
Ibeji's architecture has an In-Vehicle Digital Twin Service at its core. The In-Vehicle Digital Twin Service captures all of the vehicle's hardware capabilities
and makes them available to Ibeji consumers. Another component in Ibeji's architecture is the Provider. A vehicle may have one or more providers.
A provider exposes a subset of the vehicle's primary capabilities by registering them with the In-Vehicle Digital Twin Service. Once registered with the
A provider exposes a subset of the vehicle's hardware capabilities by registering them with the In-Vehicle Digital Twin Service. Once registered with the
In-Vehicle Digital Twin Service they can in turn be offered to Ibeji consumers. Each capability includes metadata that allows Ibeji consumers to comprehend
the nature of the capability, how to work with it and how it can be remotely accessed.

Expand Down
6 changes: 3 additions & 3 deletions docs/tutorials/provider/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Throughout this tutorial, the sample contents in the `{repo-root-dir}/samples/tu

### 1.1 Define Digital Twin Provider Interface

A digital twin provider needs an interface. The interface will expose operations that allow digital twin consumers to access a subset of in-vehicle signals that your digital provider makes available.
A digital twin provider needs an interface. The interface will expose operations that allow digital twin consumers to access the in-vehicle signals that your digital provider makes available.

>Tip: A suggested approach for defining your digital twin provider is to adopt the perspective of a digital twin consumer. This requires consideration of the operations and their corresponding names for interacting with each in-vehicle signal and command. For example, for the [digital twin provider sample interface](../../../samples/interfaces/tutorial/digital_twin_provider.proto), the specified operations are `Get` and `Invoke`.
Expand Down Expand Up @@ -116,7 +116,7 @@ You have defined your digital twin provider interface, and you have implemented

You will need to register your digital twin provider with the [In-Vehicle Digital Twin Service](../../../README.md#high-level-design). This registration will make your digital twin provider discoverable by digital twin consumers through the In-Vehicle Digital Twin Service.

>[In-Vehicle Digital Twin Service:](../../../README.md#high-level-design) Ibeji's architecture has an In-Vehicle Digital Twin Service at its core. The In-Vehicle Digital Twin Service captures all of the vehicle's primary capabilities and makes them available to Ibeji consumers.
>[In-Vehicle Digital Twin Service:](../../../README.md#high-level-design) Ibeji's architecture has an In-Vehicle Digital Twin Service at its core. The In-Vehicle Digital Twin Service captures all of the vehicle's hardware capabilities and makes them available to Ibeji consumers.
The following lists out the flow for registering a digital twin provider in the programming language of your choice:

Expand Down Expand Up @@ -146,7 +146,7 @@ async fn register_entities(
) -> Result<(), Status> { .. }
```

The `register_entities` function in this Rust sample digital twin provider showcases the process of registering with the In-Vehicle Digital Twin Service.
The `register_entities` function in this Rust sample digital twin provider shows the process of registering with the In-Vehicle Digital Twin Service.

#### Run the Sample Digital Twin Provider

Expand Down
2 changes: 1 addition & 1 deletion samples/interfaces/tutorial/digital_twin_provider.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ message GetResponse {

message InvokeRequest {
string entity_id = 1;
string payload = 4;
string payload = 2;
}

message InvokeResponse {
Expand Down
8 changes: 5 additions & 3 deletions samples/tutorial/consumer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,13 @@ async fn start_show_notification_repeater(provider_uri: String) -> Result<(), St
let response = client.invoke(request).await?;

info!("Show notification response: {}", response.into_inner().response);

debug!("Completed the invoke request");
sleep(Duration::from_secs(15)).await;
}
}

/// Send a GET request to the digital twin provider.
/// Send a GET request to the digital twin provider and return the resulting value.
///
/// # Arguments
/// `provider_uri` - The provider's URI.
Expand Down Expand Up @@ -124,7 +125,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
)
.await?;

// Acquire the provider's endpoint for show notification
// Acquire the provider's endpoint for the show notification command
let show_notification_command_provider_endpoint_info =
discover_digital_twin_provider_using_ibeji(
&invehicle_digital_twin_uri,
Expand All @@ -137,7 +138,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let show_notification_command_provider_uri =
show_notification_command_provider_endpoint_info.uri;

// Acquire the provider's endpoint for ambient air temperature and is air conditioning active.
// Acquire the provider's endpoint for the ambient air temperature signal
let mut provider_uri_map = HashMap::new();
let ambient_air_temperature_property_provider_endpoint_info =
discover_digital_twin_provider_using_ibeji(
Expand All @@ -153,6 +154,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
ambient_air_temperature_property_provider_endpoint_info.uri,
);

// Acquire the provider's endpoint for the is air conditioning active signal
let is_air_conditioning_active_property_provider_endpoint_info =
discover_digital_twin_provider_using_ibeji(
&invehicle_digital_twin_uri,
Expand Down
2 changes: 1 addition & 1 deletion samples/tutorial/provider/src/provider_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl DigitalTwinProviderTutorial for ProviderImpl {
let entity_id: String = request_inner.entity_id.clone();

let value = match entity_id.as_str() {
sdv::hvac::ambient_air_temperature::ID => "42",
sdv::hvac::ambient_air_temperature::ID => "70",
sdv::hvac::is_air_conditioning_active::ID => "true",
_ => "NULL",
};
Expand Down

0 comments on commit 130e205

Please sign in to comment.