TwclGattClient.SubscribeForNotifications(TwclGattCharacteristic,TwclGattOperationFlag,TwclGattProtectionLevel,TwclGattSubscribeKind) Method

Subscribes for the characteristic changes notifications and writes the client configuration descriptor to the device.

Namespace: wclBluetooth
public
 function SubscribeForNotifications(
 const Characteristic: TwclGattCharacteristic;
 const Flag: TwclGattOperationFlag = goNone;
 const Protection: TwclGattProtectionLevel = plNone;
 const SubscribeKind: TwclGattSubscribeKind = skManual): Integer;

Parameters

Characteristic
Type: TwclGattCharacteristic

A characteristic object in that changes an application is interested.

Flag
Type: TwclGattOperationFlag

Operation behavior flag.

Protection
Type: TwclGattProtectionLevel

Describes the required protection level.

SubscribeKind
Type: TwclGattSubscribeKind

Indicates a characteristic value change notification method that should be used. If a characteristic has both IsIndicatable and IsNotifiable properties set then this parameter allows to control which notification method should be used.

Return Value

Type: Integer

If the function succeed the return value is wclErrors.WCL_E_SUCCESS. Otherwise the method returns one of the WCL error codes.

You can use this method to replace calls to the Subscribe and to the WriteClientConfiguration methods.