netget/server/bluetooth_ble_running/
mod.rs1pub mod actions;
3use anyhow::Result;
4use std::sync::Arc;
5use tokio::sync::mpsc;
6
7pub struct BluetoothBleRunning;
8impl BluetoothBleRunning {
9 #[cfg(all(unix, feature = "bluetooth"))]
10 pub async fn spawn_with_llm_actions(
11 device_name: String,
12 llm: crate::llm::ollama_client::OllamaClient,
13 state: Arc<crate::state::app_state::AppState>,
14 tx: mpsc::UnboundedSender<String>,
15 id: crate::state::ServerId,
16 inst: String,
17 ) -> Result<std::net::SocketAddr> {
18 crate::server::bluetooth_ble::BluetoothBle::spawn_with_llm_actions(
19 device_name,
20 llm,
21 state,
22 tx,
23 id,
24 {
25 let inst = inst.trim().trim_end_matches('.').trim();
32 if inst.is_empty() {
33 "Configure as a BLE Running Speed and Cadence Service (0x1814).".to_string()
34 } else {
35 format!(
36 "{inst}. Configure as a BLE Running Speed and Cadence Service (0x1814)."
37 )
38 }
39 },
40 )
41 .await
42 }
43}
44#[cfg(any(all(unix, not(feature = "bluetooth")), not(unix)))]
45impl BluetoothBleRunning {
46 pub async fn spawn_with_llm_actions(
47 _: String,
48 _: crate::llm::ollama_client::OllamaClient,
49 _: Arc<crate::state::app_state::AppState>,
50 _: mpsc::UnboundedSender<String>,
51 _: crate::state::ServerId,
52 _: String,
53 ) -> Result<std::net::SocketAddr> {
54 anyhow::bail!("BLE running not enabled")
55 }
56}
57
58pub const RUNNING_SERVICE: u16 = 0x1814;
59pub const RSC_MEASUREMENT: u16 = 0x2A53;