Discovered Event
Fired when the component discovers a service, characteristic, or descriptor.
Syntax
type TDiscoveredEvent = procedure ( Sender: TObject; GattType: Integer; const ServiceId: String; const CharacteristicId: String; const DescriptorId: String; const Uuid: String; const Description: String ) of Object;
property OnDiscovered: TDiscoveredEvent read FOnDiscovered write FOnDiscovered;
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.