Skip to content

Commit

Permalink
fix build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
wilyle committed Feb 21, 2024
1 parent 29ac921 commit c45a199
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 6 deletions.
29 changes: 29 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
resolver = "2"
members = [
"cloud_connectors/azure/mqtt_connector",
"cloud_connectors/azure/proto-build",
"freyja_adapters/cloud/azure_cloud_connector_adapter",
"freyja_apps/e2e",
"freyja_apps/ibeji_integration",
Expand Down
2 changes: 1 addition & 1 deletion cloud_connectors/azure/mqtt_connector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,4 +210,4 @@ To build and run the MQTT connector, run the following command:
cargo run -p mqtt-cloud-connector
```
This will rebuild the project as necessary before running it. If you just want to build the project without running it, use `cargo build` instead of `cargo run`.
This will rebuild the project as necessary before running it. If you only want to build the project without running it, use `cargo build` instead of `cargo run`.
17 changes: 17 additions & 0 deletions cloud_connectors/azure/proto-build/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
# SPDX-License-Identifier: MIT

[package]
name = "azure-cloud-connector-proto"
version = "0.1.0"
edition = "2021"
license = "MIT"

[dependencies]
tonic = { workspace = true }
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
prost = { workspace = true }

[build-dependencies]
tonic-build = { workspace = true }
7 changes: 7 additions & 0 deletions cloud_connectors/azure/proto-build/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
// SPDX-License-Identifier: MIT

fn main() {
tonic_build::compile_protos("../proto/azure_cloud_connector.proto").unwrap();
}
7 changes: 7 additions & 0 deletions cloud_connectors/azure/proto-build/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
// SPDX-License-Identifier: MIT

pub mod azure_cloud_connector {
tonic::include_proto!("azure_cloud_connector");
}
2 changes: 1 addition & 1 deletion cloud_connectors/azure/sample-dtdl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ The steps below will guide you on manually deploying the Azure Digital Twins res

1. Set up your [Azure Digital Twin Instance](https://learn.microsoft.com/en-us/azure/digital-twins/quickstart-azure-digital-twins-explorer#set-up-azure-digital-twins).

If you wish to use the default mappings in the [.freyja directory](../../../.frejya/), create the following instances:
If you wish to use the default mappings in this repository, create the following instances:

* vehicle
* hvac
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,21 @@ impl AzureCloudConnectorAdapter {
) -> Result<CloudDigitalTwinInstance, CloudAdapterError> {
Ok(CloudDigitalTwinInstance {
model_id: cloud_message
.cloud_signal
.metadata
.get(MODEL_ID_KEY)
.ok_or_else(|| {
CloudAdapterError::key_not_found(format!("Cannot find key: {MODEL_ID_KEY:}"))
})?
.clone(),
instance_id: cloud_message
.cloud_signal
.metadata
.get(INSTANCE_ID_KEY)
.ok_or_else(|| {
CloudAdapterError::key_not_found(format!("Cannot find key: {INSTANCE_ID_KEY:}"))
})?
.clone(),
instance_property_path: cloud_message
.cloud_signal
.metadata
.get(INSTANCE_PROPERTY_PATH_KEY)
.ok_or_else(|| {
CloudAdapterError::key_not_found(format!(
Expand Down Expand Up @@ -153,7 +153,7 @@ mod azure_cloud_connector_tests {
#[tokio::test]
async fn get_instance_info_from_message_test() {
let cloud_message = CloudMessageRequest {
cloud_signal: HashMap::new(),
metadata: HashMap::new(),
signal_value: String::new(),
signal_timestamp: String::new(),
};
Expand Down

0 comments on commit c45a199

Please sign in to comment.