Bluetooth Stack Extension Layer (Compact 2013)

3/26/2014

A Bluetooth stack extension layer implements data structures for accessing the layers of the Bluetooth stack. A stack extension layer exposes an interface from the Bluetooth stack to Bluetooth-enabled applications.

Introduction

OS designers and application developers use Bluetooth stack extension layers to build additional functionality on the Bluetooth stack. This section provides an outline of the steps that are required to implement a Bluetooth stack extension layer, a streaming device driver to load the stack extension layer, and a simple application to load the device driver. This section also references the Bluetooth stack extension layer sample code that ships as part of Windows Embedded Compact 2013. For more information about the layers and components of the Bluetooth stack, see Bluetooth Architecture.

You can create extension layers on top of the following four layers:

  • Host Controller Interface (HCI)
  • Radio Frequency Communication (RFCOMM)
  • Logical Link Control
  • Adaptation Protocol (L2CAP)

When you create an extension layer, you must develop it as part of an installable stream device driver that uses standard driver interface calls to manage the device. The sample code is based on an L2CAP extension layer implementation. All sample code is installed as part of Compact 2013.

The following samples ship with Compact 2013:

  • L2capdev is an L2CAP extension layer that is implemented as a stream driver. The compiled sample generates L2capdev.dll. The code is installed at %_WINCEROOT%\Public\Common\Oak\Drivers\Bluetooth\Sample\L2capdev.
  • L2capapi is a user-application API that communicates with L2capdev. The compiled sample generates L2capapi.dll. The code is installed at%_WINCEROOT%\Public\Common\Oak\Drivers\Bluetooth\Sample\L2capapi.
  • L2capapiutil is a sample application that uses L2capapi.dll APIs. The compiled sample generates btdccp.exe. The code is installed at %_WINCEROOT%\Public\Common\Oak\Drivers\Bluetooth\Sample\l2capapiutil.

For reference material that describes the APIs we use in this section, see Bluetooth Host Controller Interface Reference.

To implement an extension layer for the Bluetooth stack on Compact 2013:

  1. Implement the Bluetooth stack data structures. You implement the Bluetooth stack APIs from Bt_ddi.h to allow the extension layer to interface with a specific layer of the Bluetooth stack.
  2. Implement functions that setup and shut down the extension layer. You implement the Bluetooth stack APIs from Bt_ddi.h to set up and shut down the extension layer as a driver instance.
  3. Create an installable stream device driver for the extension layer. You implement the stream interface driver functions to create an installable stream interface driver for the stack extension so that the stack extension can be installed on top of a layer of the Bluetooth stack.

In This Section

See Also

Other Resources

Bluetooth
Bluetooth Architecture