more improvements

This commit is contained in:
2024-04-10 17:13:29 +02:00
parent d0835f9393
commit 1d92084e65
3 changed files with 30 additions and 15 deletions

View File

@ -1,7 +1,10 @@
use lazy_static::lazy_static;
use num_enum::{IntoPrimitive, TryFromPrimitive};
use satrs_mib::res_code::ResultU16Info;
use satrs_mib::resultcode;
use std::env;
use std::net::Ipv4Addr;
use std::path::{Path, PathBuf};
pub const STOP_FILE_NAME: &str = "stop-experiment";
pub const HOME_FOLER_EXPERIMENT: &str = "/home/exp278";
@ -26,6 +29,19 @@ pub enum GroupId {
Action = 3,
}
lazy_static! {
pub static ref HOME_PATH: PathBuf = {
let home_path_default = env::var("HOME").expect("HOME env variable not set");
let mut home_path = PathBuf::new();
home_path.push(if Path::new(HOME_FOLER_EXPERIMENT).exists() {
HOME_FOLER_EXPERIMENT
} else {
&home_path_default
});
home_path
};
}
pub mod tmtc_err {
use super::*;
use satrs::res_code::ResultU16;