ble: Move feature listing to own module
This commit is contained in:
parent
9d2a8d31e7
commit
6991ff5ec5
3 changed files with 22 additions and 12 deletions
13
src/ble.rs
13
src/ble.rs
|
|
@ -120,20 +120,9 @@ pub async fn run(
|
||||||
..
|
..
|
||||||
} = stack.build();
|
} = 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!(
|
info!(
|
||||||
"Starting advertising and GATT service for {}",
|
"Starting advertising and GATT service for {}",
|
||||||
features.join(",")
|
crate::util::get_rx_feature_list().join(",")
|
||||||
);
|
);
|
||||||
let server = Server::new_with_config(GapConfig::Peripheral(PeripheralConfig {
|
let server = Server::new_with_config(GapConfig::Peripheral(PeripheralConfig {
|
||||||
name: &name,
|
name: &name,
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,7 @@ mod io;
|
||||||
mod screen;
|
mod screen;
|
||||||
#[cfg(feature = "gnss_ubx")]
|
#[cfg(feature = "gnss_ubx")]
|
||||||
mod ubx;
|
mod ubx;
|
||||||
|
mod util;
|
||||||
|
|
||||||
const WIFI_CHANNEL: radio::Channel = 180;
|
const WIFI_CHANNEL: radio::Channel = 180;
|
||||||
const WIFI_TXPOWER: i8 = 10; // dBm, 2..20
|
const WIFI_TXPOWER: i8 = 10; // dBm, 2..20
|
||||||
|
|
|
||||||
20
src/util.rs
Normal file
20
src/util.rs
Normal 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
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue