pub mod actions;
pub const HID_GAMEPAD_INPUT_REPORT_LEN: usize = 2;
pub const HID_GAMEPAD_REPORT_DESCRIPTOR: &[u8] = &[
0x05, 0x01, 0x09, 0x05, 0xA1, 0x01, 0x05, 0x09, 0x19, 0x01, 0x29, 0x10, 0x15, 0x00, 0x25, 0x01, 0x75, 0x01, 0x95, 0x10, 0x81, 0x02, 0xC0, ];
use anyhow::Result;
use std::sync::Arc;
use tokio::sync::mpsc;
pub struct BluetoothBleGamepad;
impl BluetoothBleGamepad {
#[cfg(all(unix, feature = "bluetooth"))]
pub async fn spawn_with_llm_actions(
device_name: String,
llm: crate::llm::ollama_client::OllamaClient,
state: Arc<crate::state::app_state::AppState>,
tx: mpsc::UnboundedSender<String>,
id: crate::state::ServerId,
inst: String,
) -> Result<std::net::SocketAddr> {
crate::server::bluetooth_ble::BluetoothBle::spawn_with_llm_actions(
device_name,
llm,
state,
tx,
id,
format!("{}. Configure as BLE Gamepad.", inst),
)
.await
}
}
#[cfg(any(all(unix, not(feature = "bluetooth")), not(unix)))]
impl BluetoothBleGamepad {
pub async fn spawn_with_llm_actions(
_: String,
_: crate::llm::ollama_client::OllamaClient,
_: Arc<crate::state::app_state::AppState>,
_: mpsc::UnboundedSender<String>,
_: crate::state::ServerId,
_: String,
) -> Result<std::net::SocketAddr> {
anyhow::bail!("BLE gamepad not enabled")
}
}