DiscoverDescriptors Method
Used to discover all descriptors for a specific characteristic.
Syntax
bleclientcontrol.DiscoverDescriptors ServiceId, CharacteristicId
Remarks
This method is used to discover all descriptors that belong to the characteristic represented by CharacteristicId (which is owned by the service represented by ServiceId). Discovered descriptors' data will be used to populate the Descriptors* properties when the Characteristic property is set to the applicable characteristic Id.
During the discovery process, the Discovered event will fire once for each descriptor discovered. You may control whether it fires when a descriptor is rediscovered by setting the IncludeRediscovered configuration setting.
Keep in mind that having any of the following configuration settings enabled when you call this method may cause additional, unwanted power consumption: AutoDiscoverCharacteristics, AutoDiscoverDescriptors, or AutoDiscoverIncludedServices.
Descriptor Discovery
// Discovered event handler.
bleclient1.OnDiscovered += (s, e) => {
Console.WriteLine("Descriptor discovered:" +
"\r\n\tOwning Service Id: " + e.ServiceId +
"\r\n\tOwning Characteristic Id: " + e.CharacteristicId +
"\r\n\tDescriptor Id: " + e.DescriptorId +
// The discovered descriptor's 128-bit UUID string, in the format
// "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
"\r\n\tUUID: " + e.Uuid +
// For standard descriptors whose UUIDs are defined by the Bluetooth SIG,
// the Description event parameter will contain the name of the descriptor.
"\r\n\tDescription: " + e.Description);
};
// Discover all descriptors for characteristic Id "001C001D0000", owned by
// service Id "001C00000000". (On our CC2650STK TI SensorTag, this is the
// Battery Level characteristic, which is owned by the Battery Service.)
bleclient1.DiscoverDescriptors("001C00000000", "001C001D0000");