Creating an Installable Stream Driver for the Bluetooth Extension Layer (Windows Embedded CE 6.0)

1/6/2010

The Bluetooth stack implementation in Windows Embedded CE allows extension layers to be installed on top of the HCI layer. An extension layer must be written as an installable stream device driver. Stream device drivers make use of common APIs to manage a device.

To create an installable stream driver for the Bluetooth extension layer, implement the following common functions (where XXX is the name of the driver).

For a detailed discussion about stream interface drivers, see Stream Interface Drivers and Stream Interface Driver Implementation.

Initializing the Driver

To initialize the driver, implement the XXX_Init function. The initialization routine must include a call to the **ExtensionLayer_CreateDriverInstance to instantiate the Bluetooth extension layer.

The following code example is an excerpt from the BthLink sample that creates an instance of the extension layer class.

extern "C" DWORD BTL_Init (DWORD Index)
{
  return (DWORD)(bthlink_CreateDriverInstance () == ERROR_SUCCESS);
}

Deinitializing the Driver

To deinitialize the driver, implement the XXX_Deinit function. The deinitialization routine must include a call to the **ExtensionLayer_CloseDriverInstance to delete the existing instance of the Bluetooth extension layer.

The following code example is an excerpt from the BthLink sample that deletes an instance of the extension layer class.

extern "C" BOOL BTL_Deinit(DWORD dwData) 
{
  bthlink_CloseDriverInstance ();
  return TRUE;
}

See Also

Concepts

Creating a Bluetooth Stack Extension Layer
How to Develop and Load a Bluetooth HCI Stack Extension Layer

Other Resources

Bluetooth OS Design Development
Host Controller Interface