Hardware Dev Center

L2CAP Callback Function function pointer

Profile drivers implement a L2CAP callback function to provide the Bluetooth driver stack with a mechanism to notify the profile driver about incoming L2CAP connection requests from remote devices, and any changes to the status of a currently open L2CAP connection.

Syntax


typedef void ( *PFNBTHPORT_INDICATION_CALLBACK)(
  _In_ PVOID                  Context,
  _In_ INDICATION_CODE        Indication,
  _In_ PINDICATION_PARAMETERS Parameters
);

Parameters

Context [in]

For incoming remote connection request indications, this is the context specified by the profile driver in the IndicationCallbackContext member of the _BRB_L2CA_REGISTER_SERVER structure when the profile driver registered the callback function. For changes to existing L2CAP connections, this is the CallbackContext member specified by the profile driver when it built and sent a _BRB_L2CA_OPEN_CHANNEL BRB.

Indication [in]

An INDICATION_CODE value that indicates the type of L2CAP event.

Parameters [in]

An INDICATION_PARAMETERS structure that contains event-specific parameters.

Return value

None

Remarks

A profile driver registers its L2CAP callback function in the following two scenarios:

  1. When a profile driver acts as a server, it registers a L2CAP callback function using the IndicationCallback member of the _BRB_L2CA_REGISTER_SERVER structure. The Bluetooth driver stack can then notify the profile driver when a remote device attempts to contact it.

  2. When the profile driver acts as a client and attempts to connect to a remote device using the BRB_L2CA_OPEN_CHANNEL BRB, the profile driver registers its L2CAP callback function using the Callback member of the _BRB_L2CA_OPEN_CHANNEL structure that is passed when the profile driver builds and sends a BRB_L2CA_OPEN_CHANNEL or BRB_L2CA_OPEN_CHANNEL_RESPONSE request.

After the profile driver registers its L2CAP callback function, the callback function is only associated with the channel that the BRB opened. The Bluetooth driver stack can call the L2CAP callback function to notify the profile driver of actions that occur over the open channel to the remote device. Profile drivers can register a single callback function to handle channel notifications as a client and connection notifications as a server.

The INDICATION_PARAMETERS structure held in the Parameters parameter is interpreted according to the value of the INDICATION_CODE enumeration that the Bluetooth driver stack passes to the profile driver's L2CAP callback function through the Indication parameter. For most notifications, there is an INDICATION_PARAMETERS union member that corresponds to the event and contains event-specific parameters.

Requirements

Target platform

Desktop

Version

Versions: Supported in Windows Vista, and later.

Header

Bthddi.h (include Bthddi.h)

IRQL

Developers should code this function to operate at either IRQL = DISPATCH_LEVEL (if the callback function does not access paged memory), or IRQL = PASSIVE_LEVEL (if the callback function must access paged memory)

See also

_BRB_L2CA_REGISTER_SERVER
_BRB_L2CA_OPEN_CHANNEL
INDICATION_CODE
INDICATION_PARAMETERS

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft