summaryrefslogtreecommitdiff
path: root/offload
diff options
context:
space:
mode:
author Antoine SOULIER <asoulier@google.com> 2025-03-04 19:52:55 +0000
committer Antoine SOULIER <asoulier@google.com> 2025-03-04 20:18:29 +0000
commit20d9144c8e8ba33a787542abe6427eb30a8fe9d2 (patch)
treeadae63a0b037ae18b4cf923a79a87c95bef92ac9 /offload
parentcdca17e4110424465274d2e34c9fa49f56776c42 (diff)
LE-Audio Software Offload: Patch ISO Data Path during phase 1
Bug: 375486605 Flag: EXEMPT, enabled by vendor Test: atest libbluetooth_offload_leaudio_hci_test Change-Id: If589d087fe98996e50b16d5f565a046951a2969a
Diffstat (limited to 'offload')
-rw-r--r--offload/hci/command.rs8
-rw-r--r--offload/leaudio/hci/proxy.rs12
2 files changed, 15 insertions, 5 deletions
diff --git a/offload/hci/command.rs b/offload/hci/command.rs
index a4bbe6f701..9aa7447137 100644
--- a/offload/hci/command.rs
+++ b/offload/hci/command.rs
@@ -450,7 +450,7 @@ impl CommandOpCode for LeSetupIsoDataPath {
const OPCODE: OpCode = OpCode::from(0x08, 0x06e);
}
-#[derive(Debug, Read, Write, CommandToBytes)]
+#[derive(Clone, Debug, Read, Write, CommandToBytes)]
pub struct LeSetupIsoDataPath {
pub connection_handle: u16,
pub data_path_direction: LeDataPathDirection,
@@ -460,20 +460,20 @@ pub struct LeSetupIsoDataPath {
pub codec_configuration: Vec<u8>,
}
-#[derive(Debug, PartialEq, Read, Write)]
+#[derive(Clone, Debug, PartialEq, Read, Write)]
pub enum LeDataPathDirection {
Input = 0x00,
Output = 0x01,
}
-#[derive(Debug, Read, Write)]
+#[derive(Clone, Debug, Read, Write)]
pub struct LeCodecId {
pub coding_format: CodingFormat,
pub company_id: u16,
pub vendor_id: u16,
}
-#[derive(Debug, PartialEq, Read, Write)]
+#[derive(Clone, Debug, PartialEq, Read, Write)]
pub enum CodingFormat {
ULawLog = 0x00,
ALawLog = 0x01,
diff --git a/offload/leaudio/hci/proxy.rs b/offload/leaudio/hci/proxy.rs
index 986da0b88e..933389d315 100644
--- a/offload/leaudio/hci/proxy.rs
+++ b/offload/leaudio/hci/proxy.rs
@@ -16,7 +16,10 @@ use bluetooth_offload_hci as hci;
use crate::arbiter::Arbiter;
use crate::service::{Service, StreamConfiguration};
-use hci::{Command, Event, EventToBytes, IsoData, Module, ModuleBuilder, ReturnParameters, Status};
+use hci::{
+ Command, CommandToBytes, Event, EventToBytes, IsoData, Module, ModuleBuilder, ReturnParameters,
+ Status,
+};
use std::collections::HashMap;
use std::sync::{Arc, Mutex};
@@ -197,6 +200,13 @@ impl Module for LeAudioModule {
let mut state = self.state.lock().unwrap();
let stream = state.stream.get_mut(&c.connection_handle).unwrap();
stream.state = StreamState::Enabling;
+
+ // Phase 1 limitation: The controller does not implement HCI Link Feedback event,
+ // and not implement the `DATA_PATH_ID_SOTWARE` to enable it.
+ // Fix the data_path_id to 0 (HCI) waiting for controller implementation.
+ self.next()
+ .out_cmd(&hci::LeSetupIsoDataPath { data_path_id: 0, ..c.clone() }.to_bytes());
+ return;
}
_ => (),