diff options
author | initard <solo@softwareag.com> | 2022-02-01 17:49:53 +0100 |
---|---|---|
committer | initard <solo@softwareag.com> | 2022-02-15 11:43:49 +0000 |
commit | 2411743f17e14fa6031d4940d6a0135abdc00baf (patch) | |
tree | ddc7782f8e72a4a3b4531585ec93779bfaf0c05c /crates/common/tedge_config | |
parent | ae402f67527d022a3cedd60f049d73724079850a (diff) |
c8y_api lib, tedge config, mqtt/http utilities (#790)
Preparing the repo for the log request plugin. Restructuring
folders, moving code out of sm_c8y_mapper and into c8y_api,
c8y_smartrest or tedge_config.
Signed-off-by: initard <solo@softwareag.com>
Diffstat (limited to 'crates/common/tedge_config')
-rw-r--r-- | crates/common/tedge_config/src/tedge_config.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/common/tedge_config/src/tedge_config.rs b/crates/common/tedge_config/src/tedge_config.rs index 52e0178e..32587a15 100644 --- a/crates/common/tedge_config/src/tedge_config.rs +++ b/crates/common/tedge_config/src/tedge_config.rs @@ -2,6 +2,13 @@ use crate::*; use certificate::{CertificateError, PemCertificate}; use std::convert::{TryFrom, TryInto}; +/// loads tedge config from system default +pub fn get_tedge_config() -> Result<TEdgeConfig, TEdgeConfigError> { + let tedge_config_location = TEdgeConfigLocation::from_default_system_location(); + let config_repository = TEdgeConfigRepository::new(tedge_config_location); + Ok(config_repository.load()?) +} + /// Represents the complete configuration of a thin edge device. /// This configuration is a wrapper over the device specific configurations /// as well as the IoT cloud provider specific configurations. |