Partager via


Device Driver Management Sample (Windows CE 5.0)

Send Feedback

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                    |
              celog {on | off}             |
              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]

Celog

This option enables CeLog in your target device. Use this option to capture log data related to Bluetooth activities. You can use the BTLog tool to convert binary log data, captured by CeLog, into a readable HTML format. For more information, see How to Capture Log Data by Using the BTLog Tool.

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 Application Development | Bluetooth Samples

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.