Watch
0
0
Fork
You've already forked esp32-c_its-companion
0

ble: Move feature listing to own module

This commit is contained in:
Jannik Beyerstedt 2026-09-25 13:09:54 +02:00
commit 6991ff5ec5
3 changed files with 22 additions and 12 deletions

View file

@ -120,20 +120,9 @@ pub async fn run(
..
} = stack.build();
let mut features = alloc::vec![];
if cfg!(feature = "cam") {
features.push("cam");
}
if cfg!(feature = "denm") {
features.push("denm");
}
if cfg!(feature = "spat") {
features.push("mapem");
features.push("spatem");
}
info!(
"Starting advertising and GATT service for {}",
features.join(",")
crate::util::get_rx_feature_list().join(",")
);
let server = Server::new_with_config(GapConfig::Peripheral(PeripheralConfig {
name: &name,

View file

@ -58,6 +58,7 @@ mod io;
mod screen;
#[cfg(feature = "gnss_ubx")]
mod ubx;
mod util;
const WIFI_CHANNEL: radio::Channel = 180;
const WIFI_TXPOWER: i8 = 10; // dBm, 2..20

20
src/util.rs Normal file
View file

@ -0,0 +1,20 @@
//! Some stuff used at several places
use alloc::vec::Vec;
#[allow(unused)]
pub(crate) fn get_rx_feature_list() -> Vec<&'static str> {
let mut features = alloc::vec![];
if cfg!(feature = "cam") {
features.push("cam");
}
if cfg!(feature = "denm") {
features.push("denm");
}
if cfg!(feature = "spat") {
features.push("mapem");
features.push("spatem");
}
features
}