diff options
author | Rina Fujino <18257209+rina23q@users.noreply.github.com> | 2022-02-08 17:44:12 +0100 |
---|---|---|
committer | Rina Fujino <18257209+rina23q@users.noreply.github.com> | 2022-02-08 18:24:25 +0100 |
commit | 86e8b8079bc1c8e4b75f46becb27c31d95284f0c (patch) | |
tree | dec5f320f02645c086e2477ddb67e245bd4f0a4c /crates/core/tedge_mapper/src/c8y_converter.rs | |
parent | 88062f5008da779c76d1f747922ddb0ab651c3bb (diff) |
Fix tedge/measurement to tedge/measurements
Signed-off-by: Rina Fujino <18257209+rina23q@users.noreply.github.com>
Diffstat (limited to 'crates/core/tedge_mapper/src/c8y_converter.rs')
-rw-r--r-- | crates/core/tedge_mapper/src/c8y_converter.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/core/tedge_mapper/src/c8y_converter.rs b/crates/core/tedge_mapper/src/c8y_converter.rs index ccc8a975..475bac40 100644 --- a/crates/core/tedge_mapper/src/c8y_converter.rs +++ b/crates/core/tedge_mapper/src/c8y_converter.rs @@ -21,6 +21,7 @@ const SUPPORTED_OPERATIONS_DIRECTORY: &str = "/etc/tedge/operations"; const SMARTREST_PUBLISH_TOPIC: &str = "c8y/s/us"; const TEDGE_ALARMS_TOPIC: &str = "tedge/alarms/"; const INTERNAL_ALARMS_TOPIC: &str = "c8y-internal/alarms/"; +const TEDGE_MEASUREMENTS_TOPIC: &str = "tedge/measurements"; pub struct CumulocityConverter { pub(crate) size_threshold: SizeThreshold, @@ -110,7 +111,8 @@ impl Converter for CumulocityConverter { fn try_convert(&mut self, input: &Message) -> Result<Vec<Message>, ConversionError> { let () = self.size_threshold.validate(input.payload_str()?)?; - if input.topic.name.starts_with("tedge/measurement") { + + if input.topic.name.starts_with(TEDGE_MEASUREMENTS_TOPIC) { self.try_convert_measurement(input) } else if input.topic.name.starts_with(TEDGE_ALARMS_TOPIC) { self.alarm_converter.try_convert_alarm(input) |