BluetoothGATTRegisterEvent function

The BluetoothGATTRegisterEvent function registers a routine to be called back during a characteristic value change event on the given characteristic identified by its characteristic handle.

Syntax


HRESULT WINAPI BluetoothGATTRegisterEvent(
  _In_      HANDLE hService,
  _In_      BTH_LE_GATT_EVENT_TYPE EventType,
  _In_      PVOID EventParameterIn,
  _In_      PFNBLUETOOTH_GATT_EVENT_CALLBACK Callback,
  _In_opt_  PVOID CallbackContext,
  _Out_     BLUETOOTH_GATT_EVENT_HANDLE * pEventHandle,
  _In_      ULONG Flags
);

Parameters

hService [in]

Handle to the service.

EventType [in]

A value from BTH_LE_GATT_EVENT_TYPE. Currently, only CharacteristicValueChangedEvent is supported.

EventParameterIn [in]

Pointer to a BLUETOOTH_GATT_VALUE_CHANGED_EVENT_REGISTRATION structure to pass when the event is triggered.

Callback [in]

The routine to call when the Characteristic value changes.

CallbackContext [in, optional]

Context to pass to Callback.

pEventHandle [out]

Pointer to buffer to receive a handle for the registration. Profile drivers must pass this handle when calling BluetoothGATTUnregisterEvent.

Flags [in]

Flags to modify the behavior of BluetoothGATTRegisterEvent:

FlagDescription

BLUETOOTH_GATT_FLAG_NONE

The client does not have specific GATT requirements (default).

 

Return value

BluetoothGATTRegisterEvent returns the following values:

Return codeDescription
S_OK

The operation completed successfully.

ERROR_ACCESS_DENIED

Returned if both a parent service and a service handle are provided and the service hierarchy does not roll up to the provided parent service handle.

ERROR_INVALID_PARAMETER

A parameter was invalid.

 

Requirements

Version

Supported in Windows 8 and later versions of Windows.

Header

Bluetoothleapis.h

Library

BluetoothApis.lib

See also

BTH_LE_GATT_EVENT_TYPE
BLUETOOTH_GATT_VALUE_CHANGED_EVENT_REGISTRATION
Bluetooth GATT Event Callback Function
BluetoothGATTUnregisterEvent

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft