Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ jobs:

- uses: actions/setup-dotnet@v6
with:
dotnet-version: '10.x'
dotnet-version: |
10.x
11.x

- name: Restore workloads
run: dotnet workload restore DSoft.System.BluetoothLe/DSoft.System.BluetoothLe.csproj
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ jobs:

- uses: actions/setup-dotnet@v6
with:
dotnet-version: '10.x'
dotnet-version: |
10.x
11.x

- name: Version
id: version
Expand Down
12 changes: 8 additions & 4 deletions DSoft.System.BluetoothLe/DSoft.System.BluetoothLe.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net10.0;net10.0-android;net10.0-ios;net10.0-maccatalyst;net10.0-macos;net10.0-tvos;</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net10.0-windows10.0.19041.0;net481;</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net10.0;net10.0-android;net10.0-ios;net10.0-maccatalyst;net10.0-macos;net10.0-tvos;net11.0;net11.0-android;net11.0-ios;net11.0-maccatalyst;net11.0-macos;net11.0-tvos;</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net10.0-windows10.0.19041.0;net11.0-windows10.0.19041.0;net481;</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net10.0-tizen</TargetFrameworks> -->
<!-- <UseMaui>true</UseMaui>-->
Expand Down Expand Up @@ -51,6 +51,8 @@
<PackageTags>BluetoothLe dotnet android ios macos maccatalyst windows wpf netstandard tvos</PackageTags>
<Copyright>Copyright © 2026 DSoft</Copyright>
<PackageReleaseNotes>
Adds net11.0 targets (net11.0, android, ios, maccatalyst, macos, tvos and windows) alongside net10.0.

4.1 - adds bonding and the GATT status on failures. Device.BondState reports a device's bond (pairing) state, and on Android
Adapter.DeviceBondStateChanged is raised when it changes. DeviceBondState gains Unknown, declared last
so existing values are unchanged, which Apple platforms always report because CoreBluetooth does not
Expand Down Expand Up @@ -124,6 +126,8 @@
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'macos'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tvos'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<!-- The .NET 11 Android SDK refuses a minimum below API 24 (XA4216). -->
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net11.0-android'">24.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
Expand Down Expand Up @@ -165,7 +169,7 @@
<Compile Include="**\*.shared.*.cs" Exclude="$(DefaultItemExcludes)" />
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('netstandard')) Or '$(TargetFramework)' == 'net10.0' ">
<ItemGroup Condition=" $(TargetFramework.StartsWith('netstandard')) Or '$(TargetFramework)' == 'net10.0' Or '$(TargetFramework)' == 'net11.0' ">
<Compile Include="**\*.netstandard.cs" Exclude="$(DefaultItemExcludes)" />
<Compile Include="**\*.netstandard.*.cs" Exclude="$(DefaultItemExcludes)" />
</ItemGroup>
Expand All @@ -176,7 +180,7 @@
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('net481')) ">
<!-- Aligned with the net10.0-windows10.0.19041.0 target so both Windows builds see the same metadata.
<!-- Aligned with the net10.0/net11.0-windows10.0.19041.0 targets so the Windows builds see the same metadata.
Members newer than the 17763 minimum are guarded with ApiInformation at the call site. -->
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.19041.2" />
<Compile Include="**\*.netf.cs" Exclude="$(DefaultItemExcludes)" />
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@ The library started as a fork/repackage of [Plugin.BLE](https://github.com/dotne
| Target | Minimum OS |
| --- | --- |
| `net10.0-android` | Android API 21 |
| `net11.0-android` | Android API 24 |
| `net10.0-ios` | iOS 15.0 |
| `net11.0-ios` | iOS 15.0 |
| `net10.0-maccatalyst` | Mac Catalyst 15.0 |
| `net11.0-maccatalyst` | Mac Catalyst 15.0 |
| `net10.0-macos` | macOS 15.0 |
| `net11.0-macos` | macOS 15.0 |
| `net10.0-tvos` | tvOS 15.0 |
| `net11.0-tvos` | tvOS 15.0 |
| `net10.0-windows10.0.19041.0` | Windows 10 1809 |
| `net11.0-windows10.0.19041.0` | Windows 10 1809 |
| `net481` | Windows 10 1809 |
| `net10.0` / `netstandard2.0` | API surface only; platform Bluetooth calls throw on unsupported platforms |
| `net10.0` / `net11.0` / `netstandard2.0` | API surface only; platform Bluetooth calls throw on unsupported platforms |

## Install

Expand Down Expand Up @@ -233,7 +239,7 @@ A peripheral that requires an encrypted link only answers a central it is bonded
| Android | `NotBonded`, `Bonding` or `Bonded`, read from the system on every call | Raised on the main thread for every bond change the system broadcasts, including changes made in the system Bluetooth settings |
| iOS, macOS, Mac Catalyst, tvOS | Always `Unknown` | Never raised |
| Windows | `Bonded` or `NotBonded`, from the device's pairing information | Never raised |
| `net10.0` / `netstandard2.0` | Always `Unknown` | Never raised |
| `net10.0` / `net11.0` / `netstandard2.0` | Always `Unknown` | Never raised |

**Apple platforms.** CoreBluetooth gives an app no way to read or request a bond. The operating system pairs on demand: the first time the app reads, writes or subscribes to a characteristic the peripheral protects, iOS shows the pairing prompt itself, and once the user accepts the link is encrypted for that and later operations. If the user declines, or the peripheral has lost its keys (for example after a factory reset), the operation fails, and the user has to remove the device in Settings > Bluetooth before pairing again. Design the app around attempting the protected operation and handling its failure, not around checking the bond first.

Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "10.0.100",
"rollForward": "latestFeature"
"rollForward": "latestMajor"
}
}
Loading