Skip to content

Commit

Permalink
Fix remaining issues
Browse files Browse the repository at this point in the history
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
  • Loading branch information
jarhodes314 committed Feb 27, 2024
1 parent 731cd7f commit abbc4b8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions crates/extensions/c8y_config_manager/src/actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ impl ConfigManagerActor {
let plugin_config = PluginConfig::new(&path);
let message = plugin_config.to_supported_config_types_message_for_child(
&parent_dir_name.to_string_lossy(),
&self.config.c8y_prefix,
)?;
self.messages.send(message.into()).await?;
}
Expand Down
6 changes: 4 additions & 2 deletions crates/extensions/c8y_config_manager/src/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,10 @@ impl ConfigUploadManager {
)));

// Publish supported configuration types for child devices
let message = child_plugin_config
.to_supported_config_types_message_for_child(&config_response.get_child_id())?;
let message = child_plugin_config.to_supported_config_types_message_for_child(
&config_response.get_child_id(),
&self.config.c8y_prefix,
)?;
Ok(vec![message])
}
}
Expand Down
11 changes: 7 additions & 4 deletions crates/extensions/c8y_firmware_manager/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use tedge_actors::RuntimeRequest;
use tedge_actors::RuntimeRequestSink;
use tedge_actors::ServiceProvider;
use tedge_api::path::DataDir;
use tedge_config::TopicPrefix;
use tedge_mqtt_ext::MqttMessage;
use tedge_mqtt_ext::TopicFilter;
use tedge_timer_ext::SetTimeout;
Expand Down Expand Up @@ -62,8 +63,10 @@ impl FirmwareManagerBuilder {
signal_receiver,
);

let mqtt_publisher =
mqtt_actor.connect_consumer(Self::subscriptions(), input_sender.clone().into());
let mqtt_publisher = mqtt_actor.connect_consumer(
Self::subscriptions(&config.c8y_prefix),
input_sender.clone().into(),
);
let jwt_retriever = JwtRetriever::new("Firmware => JWT", jwt_actor);
let timer_sender = timer_actor.connect_consumer(NoConfig, input_sender.clone().into());
let download_sender = downloader_actor.connect_consumer(NoConfig, input_sender.into());
Expand All @@ -85,9 +88,9 @@ impl FirmwareManagerBuilder {
Ok(())
}

pub fn subscriptions(&self) -> TopicFilter {
fn subscriptions(prefix: &TopicPrefix) -> TopicFilter {
vec![
&format!("{}/s/ds", self.config.c8y_prefix),
&format!("{prefix}/s/ds"),
"tedge/+/commands/res/firmware_update",
]
.try_into()
Expand Down

0 comments on commit abbc4b8

Please sign in to comment.