Device Driver Management Sample

This sample utility application enables users to manage Bluetooth device drivers for PCMCIA/CF cards.

The compiled sample generates a Btloader.exe application.

Note   If the stack is built with a Winsock interface, it loads when the system boots and cannot be unloaded.

To view supported command line options use BTLOADER /?.

Usage

btloader {    install                      |
              uninstall                    |
              load                         |
              unload                       |
              start card                   |
              stop card                    |
              console {on | off}           |
              debugout {console | serial}  |
              debug <hex mask>
              } <module_name>

Install/Uninstall

Uninstall will remove the following registry key and all subkeys from the registry.

[HKEY_LOCAL_MACHINE\Software\Microsoft\Bluetooth]

Load / Unload

These operations are used to load and unload the Bluetooth stack. If the load is successful, the handle to the stack is stored in the registry key. If the unload is successful, this registry key is removed from the registry.

[HKEY_LOCAL_MACHINE\Software\Microsoft\Bluetooth\hci\handle]

Card / Console / Debug

These operations are initiated after a stream is opened to communicate with the stack. The following example code performs the function of opening a stream.

HANDLE hDev = CreateFile (
                   L"BTD0:",
                   GENERIC_READ | GENERIC_WRITE,
                   FILE_SHARE_READ | FILE_SHARE_WRITE,
                   NULL, OPEN_EXISTING, 0, NULL
                  );

If the stream opens successfully, applications can manage the stack's characteristics through the DeviceIoControl call. In this example, the following services are demonstrated.

IOCTL function Service
IOCTL_SERVICE_START Card start.
IOCTL_SERVICE_STOP Card stop.
IOCTL_SERVICE_CONSOLE Console on or off.
IOCTL_SERVICE_DEBUG DebugOut console/serial, debug <mask>.

Sample Location

%_WINCEROOT%\Public\Common\Oak\Drivers\Bluetooth\Sample\Btloader

**Note   **This sample application has not been thoroughly tested and is not intended for production use.

See Also

Bluetooth | Bluetooth Samples

 Last updated on Thursday, April 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.