Discovered Event
Fired when the component discovers a service, characteristic, or descriptor.
Syntax
public event OnDiscoveredHandler OnDiscovered; public delegate void OnDiscoveredHandler(object sender, BleclientDiscoveredEventArgs e); public class BleclientDiscoveredEventArgs : EventArgs { public int GattType { get; } public string ServiceId { get; } public string CharacteristicId { get; } public string DescriptorId { get; } public string Uuid { get; } public string Description { get; } }
Public Event OnDiscovered As OnDiscoveredHandler Public Delegate Sub OnDiscoveredHandler(sender As Object, e As BleclientDiscoveredEventArgs) Public Class BleclientDiscoveredEventArgs Inherits EventArgs Public ReadOnly Property GattType As Integer Public ReadOnly Property ServiceId As String Public ReadOnly Property CharacteristicId As String Public ReadOnly Property DescriptorId As String Public ReadOnly Property Uuid As String Public ReadOnly Property Description As String End Class
Remarks
This event is fired during any discovery process to indicate that the component has discovered a service, characteristic, or descriptor. Discovery processes take place whenever Discover, DiscoverServices, DiscoverCharacteristics, or DiscoverDescriptors is called.
GattType indicates what type of GATT object was discovered:
- 0 - Service
- 1 - Characteristic
- 2 - Descriptor
Uuid and Description are the UUID and Bluetooth SIG user-friendly name (if one is defined) of the discovered service, characteristic, or descriptor.
When a service is discovered:
- ServiceId is the Id of the newly discovered service.
- CharacteristicId is empty.
- DescriptorId is empty.
When a characteristic is discovered:
- ServiceId is the Id of the previously discovered service which owns the newly discovered characteristic.
- CharacteristicId is the Id of the newly discovered characteristic.
- DescriptorId is empty.
When a descriptor is discovered:
- ServiceId is the Id of the previously discovered service which owns the previously discovered characteristic.
- CharacteristicId is the Id of the previously discovered characteristic which owns the newly discovered descriptor.
- DescriptorId is the Id of the newly discovered descriptor.