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

Cartographer + Emitter Reimplementation #43

Merged
merged 21 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
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
1 change: 1 addition & 0 deletions .accepted_words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ MappingClient
MappingClientImpl
md
microsoft
min
MockDigitalTwin
MockMappingService
MQTTProviderProxyImpl
Expand Down
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ members = [
"cloud_connectors/azure/mqtt_connector",
"cloud_connectors/azure/proto-build",
"common",
"contracts",
"digital_twin_adapters/ibeji_adapter",
"digital_twin_adapters/in_memory_mock_digital_twin_adapter",
"digital_twin_adapters/mock_digital_twin_adapter",
"freyja",
"mapping_clients/in_memory_mock_mapping_client",
"mapping_clients/mock_mapping_service_client",
Expand Down Expand Up @@ -48,6 +50,7 @@ env_logger = "0.10.0"
futures = "0.3.28"
httptest = "0.15.4"
log = "^0.4"
mockall = "0.11.4"
paho-mqtt = "0.12"
proc-macro2 = "1.0.52"
prost = "0.11.9"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl AzureCloudConnectorAdapter {
#[async_trait]
impl CloudAdapter for AzureCloudConnectorAdapter {
/// Creates a new instance of a CloudAdapter with default settings
fn create_new() -> Result<Box<dyn CloudAdapter + Send + Sync>, CloudAdapterError> {
fn create_new() -> Result<Self, CloudAdapterError> {
let cloud_connector_client = futures::executor::block_on(async {
let config_file = fs::read_to_string(Path::new(env!("OUT_DIR")).join(CONFIG_FILE))
.map_err(CloudAdapterError::io)?;
Expand All @@ -100,9 +100,9 @@ impl CloudAdapter for AzureCloudConnectorAdapter {
.map_err(CloudAdapterError::communication)
})?;

Ok(Box::new(Self {
Ok(Self {
cloud_connector_client,
}))
})
}

/// Sends the signal to the cloud
Expand Down
4 changes: 2 additions & 2 deletions cloud_adapters/in_memory_mock_cloud_adapter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ async-trait = { workspace = true }
freyja-contracts = { workspace = true }
log = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true}
tokio = { workspace = true}
serde_json = { workspace = true }
tokio = { workspace = true }
time = { workspace = true }
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ impl InMemoryMockCloudAdapter {
#[async_trait]
impl CloudAdapter for InMemoryMockCloudAdapter {
/// Creates a new instance of a CloudAdapter with default settings
fn create_new() -> Result<Box<dyn CloudAdapter + Send + Sync>, CloudAdapterError> {
fn create_new() -> Result<Self, CloudAdapterError> {
Self::from_config_file(Path::new(env!("OUT_DIR")).join(CONFIG_FILE))
.map(|r| Box::new(r) as _)
}

/// Sends the signal to the cloud
Expand Down
1 change: 1 addition & 0 deletions common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ edition = "2021"
license = "MIT"

[dependencies]
freyja-contracts = { workspace = true }
log = { workspace = true }
tokio = { workspace = true }
1 change: 1 addition & 0 deletions common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
// Licensed under the MIT license.
// SPDX-License-Identifier: MIT

pub mod signal_store;
pub mod utils;
Loading