Class ServiceExplorationOptions
- Namespace
- Bluetooth.Abstractions.Scanning.Options
- Assembly
- Bluetooth.Abstractions.Scanning.dll
Represents options for exploring Bluetooth services on a remote device.
public record ServiceExplorationOptions : IEquatable<ServiceExplorationOptions>
- Inheritance
-
ServiceExplorationOptions
- Implements
- Inherited Members
Remarks
Service exploration discovers all services available on a connected device. This is typically the first step in GATT discovery before accessing characteristics.
Properties
Depth
Gets or sets the maximum depth of exploration to perform.
public ExplorationDepth Depth { get; init; }
Property Value
Remarks
This property provides a convenient way to control exploration depth:
- ServicesOnly: Only discover services
- Characteristics: Discover services and characteristics
- Descriptors: Discover services, characteristics, and descriptors (full exploration)
Setting this property automatically sets ExploreCharacteristics and ExploreDescriptors accordingly. Default: ServicesOnly
ExploreCharacteristics
Gets or sets a value indicating whether to automatically explore characteristics after discovering services.
public bool ExploreCharacteristics { get; init; }
Property Value
Remarks
When enabled, each discovered service will have its characteristics explored automatically.
This is equivalent to calling ExploreCharacteristicsAsync(CharacteristicExplorationOptions?, TimeSpan?, CancellationToken) on each service.
Default: false
ExploreDescriptors
Gets or sets a value indicating whether to automatically explore descriptors after discovering characteristics.
public bool ExploreDescriptors { get; init; }
Property Value
Remarks
Only applicable when ExploreCharacteristics is true.
When enabled, each discovered characteristic will have its descriptors explored automatically.
This performs a full depth-first exploration: Services → Characteristics → Descriptors.
Default: false
Full
Creates exploration options for full discovery (services, characteristics, and descriptors).
public static ServiceExplorationOptions Full { get; }
Property Value
ServiceUuidFilter
Gets or sets a filter to apply when exploring services. Only services matching this filter will be explored.
public Func<Guid, bool>? ServiceUuidFilter { get; init; }
Property Value
Remarks
This can be used to limit exploration to specific services of interest.
Default: null (explore all services)
ServicesOnly
Creates exploration options for discovering only services (no characteristics or descriptors).
public static ServiceExplorationOptions ServicesOnly { get; }
Property Value
UseCache
Gets or sets a value indicating whether to skip exploration if services have already been discovered.
public bool UseCache { get; init; }
Property Value
Remarks
When enabled, if the device already has services in its collection, exploration is skipped.
This is useful to avoid redundant exploration calls on the same device.
Default: true
WithCharacteristics
Creates exploration options for discovering services and characteristics (no descriptors).
public static ServiceExplorationOptions WithCharacteristics { get; }