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

ble: Set short name in advertisement

This commit is contained in:
Jannik Beyerstedt 2026-09-29 15:25:16 +02:00
commit 9a820356ff
2 changed files with 12 additions and 6 deletions

View file

@ -222,12 +222,13 @@ async fn main(spawner: Spawner) -> ! {
let controller = ble::make_controller(peripherals.BT);
let serial = &mac.as_bytes()[3..6];
let name = alloc::format!(
"ESP32 C-ITS {:02x}{:02x}{:02x}",
"C-ITS ESP {:02x}:{:02x}:{:02x}",
serial[0],
serial[1],
serial[2]
);
spawner.spawn(ble::run(controller, name).expect("Failed to spawn BLE task"));
let short_name = alloc::format!("V2X {:02x}{:02x}", serial[1], serial[2]); // max 8 chars!
spawner.spawn(ble::run(controller, name, short_name).expect("Failed to spawn BLE task"));
}
// Setup GNSS: