Class ConnectionOptions
- Namespace
- Bluetooth.Abstractions.Scanning.Options
- Assembly
- Bluetooth.Abstractions.Scanning.dll
Represents Bluetooth device connection options.
public record ConnectionOptions : IEquatable<ConnectionOptions>
- Inheritance
-
ConnectionOptions
- Implements
- Derived
- Inherited Members
Properties
Android
Gets the Android platform-specific connection options.
public AndroidConnectionOptions? Android { get; init; }
Property Value
Remarks
These options are only used on Android platforms and are ignored on other platforms.
Apple
Gets the Apple platform-specific connection options.
public AppleConnectionOptions? Apple { get; init; }
Property Value
Remarks
These options are only used on iOS/macOS platforms and are ignored on other platforms.
ConnectionRetry
Gets the retry configuration for device connection operations.
public RetryOptions? ConnectionRetry { get; init; }
Property Value
Remarks
Retry configuration applied when initial connection attempts fail due to transient issues. Critical for Android GATT error 133 (connection failures), which is common and often resolves with retry.
Platform Support:- Android: Retries critical for GATT error 133 (connection failures)
- iOS/macOS: Retries on connection timeout or peripheral unavailable
- Windows: Retries on device connection failures
Defaults to Default (3 retries with 200ms delay). Set to None to disable retry logic.
PermissionStrategy
Gets the permission request strategy for this connection operation.
public PermissionRequestStrategy PermissionStrategy { get; init; }
Property Value
Remarks
Defaults to RequestAutomatically which automatically requests BLUETOOTH_CONNECT permission (Android 12+) before connecting if not already granted.
WaitForAdvertisementBeforeConnecting
Gets a value indicating whether to wait for an advertisement before connecting to the device.
public bool WaitForAdvertisementBeforeConnecting { get; init; }
Property Value
Windows
Gets the Windows platform-specific connection options.
public WindowsConnectionOptions? Windows { get; init; }
Property Value
Remarks
These options are only used on Windows platforms and are ignored on other platforms.