netget/server/bluetooth_ble_file_transfer/
mod.rs1pub mod actions;
3use anyhow::Result;
4use std::sync::Arc;
5use tokio::sync::mpsc;
6
7pub struct BluetoothBleFileTransfer;
8impl BluetoothBleFileTransfer {
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();
31 if inst.is_empty() {
32 "Configure as a BLE file transfer service.".to_string()
33 } else {
34 format!("{inst}. Configure as a BLE file transfer service.")
35 }
36 },
37 )
38 .await
39 }
40}
41#[cfg(any(all(unix, not(feature = "bluetooth")), not(unix)))]
42impl BluetoothBleFileTransfer {
43 pub async fn spawn_with_llm_actions(
44 _: String,
45 _: crate::llm::ollama_client::OllamaClient,
46 _: Arc<crate::state::app_state::AppState>,
47 _: mpsc::UnboundedSender<String>,
48 _: crate::state::ServerId,
49 _: String,
50 ) -> Result<std::net::SocketAddr> {
51 anyhow::bail!("BLE file_transfer not enabled")
52 }
53}