Loading system/gd/rust/linux/service/src/iface_bluetooth_media.rs +1 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ impl IBluetoothMediaCallback for BluetoothMediaCallbackDBus { sample_rate: i32, bits_per_sample: i32, channel_mode: i32, hfp_cap: i32, ) { } Loading system/gd/rust/linux/stack/src/bluetooth_media.rs +9 −2 Original line number Diff line number Diff line Loading @@ -7,7 +7,9 @@ use bt_topshim::profiles::a2dp::{ PresentationPosition, }; use bt_topshim::profiles::avrcp::{Avrcp, AvrcpCallbacks, AvrcpCallbacksDispatcher}; use bt_topshim::profiles::hfp::{BthfConnectionState, Hfp, HfpCallbacks, HfpCallbacksDispatcher}; use bt_topshim::profiles::hfp::{ BthfConnectionState, Hfp, HfpCallbacks, HfpCallbacksDispatcher, HfpCodecCapability, }; use bt_topshim::topstack; Loading Loading @@ -48,13 +50,17 @@ pub trait IBluetoothMedia { } pub trait IBluetoothMediaCallback { /// /// Triggered when a Bluetooth audio device is ready to be used. This should /// only be triggered once for a device and send an event to clients. If the /// device supports both HFP and A2DP, both should be ready when this is /// triggered. fn on_bluetooth_audio_device_added( &self, addr: String, sample_rate: i32, bits_per_sample: i32, channel_mode: i32, hfp_cap: i32, ); /// Loading Loading @@ -127,6 +133,7 @@ impl BluetoothMedia { cap.sample_rate, cap.bits_per_sample, cap.channel_mode, HfpCodecCapability::UNSUPPORTED.bits(), ); }); return; Loading system/gd/rust/topshim/src/profiles/hfp.rs +8 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,14 @@ impl From<u32> for BthfConnectionState { } } bitflags! { pub struct HfpCodecCapability: i32 { const UNSUPPORTED = 0b00; const CVSD = 0b01; const MSBC = 0b10; } } #[cxx::bridge(namespace = bluetooth::topshim::rust)] pub mod ffi { #[derive(Debug, Copy, Clone)] Loading Loading
system/gd/rust/linux/service/src/iface_bluetooth_media.rs +1 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ impl IBluetoothMediaCallback for BluetoothMediaCallbackDBus { sample_rate: i32, bits_per_sample: i32, channel_mode: i32, hfp_cap: i32, ) { } Loading
system/gd/rust/linux/stack/src/bluetooth_media.rs +9 −2 Original line number Diff line number Diff line Loading @@ -7,7 +7,9 @@ use bt_topshim::profiles::a2dp::{ PresentationPosition, }; use bt_topshim::profiles::avrcp::{Avrcp, AvrcpCallbacks, AvrcpCallbacksDispatcher}; use bt_topshim::profiles::hfp::{BthfConnectionState, Hfp, HfpCallbacks, HfpCallbacksDispatcher}; use bt_topshim::profiles::hfp::{ BthfConnectionState, Hfp, HfpCallbacks, HfpCallbacksDispatcher, HfpCodecCapability, }; use bt_topshim::topstack; Loading Loading @@ -48,13 +50,17 @@ pub trait IBluetoothMedia { } pub trait IBluetoothMediaCallback { /// /// Triggered when a Bluetooth audio device is ready to be used. This should /// only be triggered once for a device and send an event to clients. If the /// device supports both HFP and A2DP, both should be ready when this is /// triggered. fn on_bluetooth_audio_device_added( &self, addr: String, sample_rate: i32, bits_per_sample: i32, channel_mode: i32, hfp_cap: i32, ); /// Loading Loading @@ -127,6 +133,7 @@ impl BluetoothMedia { cap.sample_rate, cap.bits_per_sample, cap.channel_mode, HfpCodecCapability::UNSUPPORTED.bits(), ); }); return; Loading
system/gd/rust/topshim/src/profiles/hfp.rs +8 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,14 @@ impl From<u32> for BthfConnectionState { } } bitflags! { pub struct HfpCodecCapability: i32 { const UNSUPPORTED = 0b00; const CVSD = 0b01; const MSBC = 0b10; } } #[cxx::bridge(namespace = bluetooth::topshim::rust)] pub mod ffi { #[derive(Debug, Copy, Clone)] Loading