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

Commit f94cd35f authored by Sonny Sasaka's avatar Sonny Sasaka
Browse files

Floss: Add a stub for IBluetoothGatt::IsMsftSupported

This provides the interface for clients to query whether MSFT hardware
offload LE scanning is supported.

Bug: 244505567
Tag: #floss
Test: Build Floss on Linux

Change-Id: If748ebd0454a7289e54e2d2718dd74417b3ae413
parent 5183084b
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -860,6 +860,11 @@ impl BluetoothGattDBus {
impl IBluetoothGatt for BluetoothGattDBus {
    // Scanning

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

    #[dbus_method("RegisterScannerCallback")]
    fn register_scanner_callback(&mut self, _callback: Box<dyn IScannerCallback + Send>) -> u32 {
        dbus_generated!()
+5 −0
Original line number Diff line number Diff line
@@ -437,6 +437,11 @@ struct IBluetoothGattDBus {}
impl IBluetoothGatt for IBluetoothGattDBus {
    // Scanning

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

    #[dbus_method("RegisterScannerCallback")]
    fn register_scanner_callback(&mut self, callback: Box<dyn IScannerCallback + Send>) -> u32 {
        dbus_generated!()
+9 −0
Original line number Diff line number Diff line
@@ -182,6 +182,10 @@ impl ContextMap {
pub trait IBluetoothGatt {
    // Scanning

    /// Returns whether LE Scan can be performed by hardware offload defined by
    /// [MSFT HCI Extension](https://learn.microsoft.com/en-us/windows-hardware/drivers/bluetooth/microsoft-defined-bluetooth-hci-commands-and-events).
    fn is_msft_supported(&self) -> bool;

    /// Registers an LE scanner callback.
    ///
    /// Returns the callback id.
@@ -936,6 +940,11 @@ struct ScannerInfo {
}

impl IBluetoothGatt for BluetoothGatt {
    fn is_msft_supported(&self) -> bool {
        // TODO(b/244505567): Wire the real capability from lower layer.
        false
    }

    fn register_scanner_callback(&mut self, callback: Box<dyn IScannerCallback + Send>) -> u32 {
        self.scanner_callbacks.add_callback(callback)
    }