ipv4 or ipv6 parsed from .env file

This commit is contained in:
Priec
2025-10-04 22:03:45 +02:00
parent cfcdb56fe8
commit 948602bd1e
5 changed files with 144 additions and 19 deletions

View File

@@ -5,6 +5,7 @@ fn main() {
println!("cargo:rerun-if-changed={}", dotenv_path.display());
}
// Pass WIFI credentials into firmware
if let Ok(ssid) = std::env::var("SSID") {
println!("cargo:rustc-env=SSID={}", ssid);
}
@@ -12,8 +13,16 @@ fn main() {
println!("cargo:rustc-env=PASSWORD={}", password);
}
// Export BROKER_IP and PORT as string envs also (optional, for debugging)
if let Ok(ip) = std::env::var("BROKER_IP") {
println!("cargo:rustc-env=BROKER_IP={}", ip);
}
if let Ok(port) = std::env::var("BROKER_PORT") {
println!("cargo:rustc-env=BROKER_PORT={}", port);
}
linker_be_nice();
// make sure linkall.x is the last linker script (otherwise might cause problems with flip-link)
// make sure linkall.x is the last linker script
println!("cargo:rustc-link-arg=-Tlinkall.x");
}