diff --git a/Source/Plugin.BLE/Windows/Adapter.cs b/Source/Plugin.BLE/Windows/Adapter.cs index 232a4569..8f196394 100644 --- a/Source/Plugin.BLE/Windows/Adapter.cs +++ b/Source/Plugin.BLE/Windows/Adapter.cs @@ -16,6 +16,7 @@ namespace Plugin.BLE.Windows { public class Adapter : AdapterBase { + private readonly BluetoothAdapter _bluetoothAdapter; private BluetoothLEAdvertisementWatcher _bleWatcher; /// @@ -24,8 +25,9 @@ public class Adapter : AdapterBase /// private readonly IDictionary disconnectingRegistry = new ConcurrentDictionary(); - public Adapter() + public Adapter(BluetoothAdapter adapter) { + _bluetoothAdapter = adapter; } public override async Task BondAsync(IDevice device) @@ -199,7 +201,7 @@ protected override IReadOnlyList GetBondedDevices() this, bluetoothLeDevice, 0, id); - devlist.Add(device); + devlist.Add(device); Trace.Message("GetBondedDevices: {0}: {1}", dev.Id, dev.Name); } else @@ -298,5 +300,10 @@ public override IReadOnlyList GetKnownDevicesByIds(Guid[] ids) // TODO: implement this return new List(); } + + public override bool SupportsExtendedAdvertising() + { + return _bluetoothAdapter.IsExtendedAdvertisingSupported; + } } -} \ No newline at end of file +} diff --git a/Source/Plugin.BLE/Windows/BleImplementation.cs b/Source/Plugin.BLE/Windows/BleImplementation.cs index f5795ab0..9df8c411 100644 --- a/Source/Plugin.BLE/Windows/BleImplementation.cs +++ b/Source/Plugin.BLE/Windows/BleImplementation.cs @@ -22,7 +22,7 @@ public class BleImplementation : BleImplementationBase protected override IAdapter CreateNativeAdapter() { - return new Adapter(); + return new Adapter(btAdapter); } protected override BluetoothState GetInitialStateNative()