ble: Move feature listing to own module
This commit is contained in:
parent
a1ee228d72
commit
b079b509ae
2 changed files with 33 additions and 11 deletions
12
src/ble.rs
12
src/ble.rs
|
|
@ -120,17 +120,7 @@ pub async fn run(
|
||||||
..
|
..
|
||||||
} = stack.build();
|
} = stack.build();
|
||||||
|
|
||||||
let mut features = alloc::vec![];
|
let mut features = crate::util::get_rx_feature_list();
|
||||||
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!(
|
info!(
|
||||||
"Starting advertising and GATT service for {}",
|
"Starting advertising and GATT service for {}",
|
||||||
features.join(",")
|
features.join(",")
|
||||||
|
|
|
||||||
32
src/util.rs
Normal file
32
src/util.rs
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
//! 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
|
||||||
|
}
|
||||||
|
|
||||||
|
pub(crate) fn get_tx_feature_list() -> Vec<&'static str> {
|
||||||
|
let mut features = alloc::vec![];
|
||||||
|
if cfg!(feature = "cam_tx") {
|
||||||
|
features.push("cam-tx");
|
||||||
|
}
|
||||||
|
if cfg!(feature = "uart") {
|
||||||
|
features.push("uart-tx");
|
||||||
|
}
|
||||||
|
|
||||||
|
features
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue