Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ab85927a authored by Joseph Hwang's avatar Joseph Hwang
Browse files

Floss: Add wbs support to adapter API

This patch adds the is_wbs_supported dbus method to the adapter.
It queries the get_wbs_supported method in IBluetooth.

Bug: 244507283
Tag: #floss
Test: ./build.py --target test
Test: Manual - Run btclient on a brya/gimble.
      bluetooth> adapter show
      ...
      btclient:info: IsWbsSupported: true
      ...

Change-Id: I2896a56b6b0753c3f38cb35c161997c3b6b019e7
parent a9854e4c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -331,6 +331,7 @@ impl CommandHandler {
                    let cod = adapter_dbus.get_bluetooth_class();
                    let multi_adv_supported = adapter_dbus.is_multi_advertisement_supported();
                    let le_ext_adv_supported = adapter_dbus.is_le_extended_advertising_supported();
                    let wbs_supported = adapter_dbus.is_wbs_supported();
                    let uuid_helper = UuidHelper::new();
                    let enabled_profiles = uuid_helper.get_enabled_profiles();
                    let connected_profiles: Vec<Profile> = enabled_profiles
@@ -348,6 +349,7 @@ impl CommandHandler {
                    print_info!("IsMultiAdvertisementSupported: {}", multi_adv_supported);
                    print_info!("IsLeExtendedAdvertisingSupported: {}", le_ext_adv_supported);
                    print_info!("Connected profiles: {:?}", connected_profiles);
                    print_info!("IsWbsSupported: {}", wbs_supported);
                    print_info!(
                        "Uuids: {}",
                        DisplayList(
+5 −0
Original line number Diff line number Diff line
@@ -493,6 +493,11 @@ impl IBluetooth for BluetoothDBus {
    fn disconnect_all_enabled_profiles(&mut self, device: BluetoothDevice) -> bool {
        dbus_generated!()
    }

    #[dbus_method("IsWbsSupported")]
    fn is_wbs_supported(&self) -> bool {
        dbus_generated!()
    }
}

pub(crate) struct BluetoothQADBus {
+5 −0
Original line number Diff line number Diff line
@@ -360,6 +360,11 @@ impl IBluetooth for IBluetoothDBus {
    fn disconnect_all_enabled_profiles(&mut self, device: BluetoothDevice) -> bool {
        dbus_generated!()
    }

    #[dbus_method("IsWbsSupported")]
    fn is_wbs_supported(&self) -> bool {
        dbus_generated!()
    }
}

impl_dbus_arg_enum!(SocketType);
+7 −0
Original line number Diff line number Diff line
@@ -183,6 +183,9 @@ pub trait IBluetooth {

    /// Disconnect all profiles supported by device and enabled on adapter.
    fn disconnect_all_enabled_profiles(&mut self, device: BluetoothDevice) -> bool;

    /// Returns whether WBS is supported.
    fn is_wbs_supported(&self) -> bool;
}

/// Adapter API for Bluetooth qualification and verification.
@@ -1600,6 +1603,10 @@ impl IBluetooth for Bluetooth {

        return true;
    }

    fn is_wbs_supported(&self) -> bool {
        self.intf.lock().unwrap().get_wbs_supported()
    }
}

impl BtifSdpCallbacks for Bluetooth {
+4 −0
Original line number Diff line number Diff line
@@ -1149,6 +1149,10 @@ impl BluetoothInterface {
        ccall!(self, allow_wake_by_hid)
    }

    pub fn get_wbs_supported(&self) -> bool {
        ccall!(self, get_wbs_supported)
    }

    pub fn le_rand(&self) -> i32 {
        ccall!(self, le_rand)
    }