am working on a BT app on CE 5 and need the functionality of BthSetMode. In
particular my app needs to be able to:
1. enable/disable discoverability
2. enable/disable connectability
3. power down BT to save battery life
I have scrounged through the source on CE 5 and 6 with no luck. I have also
looked through the registry in hopes of finding flags that could be set (no
luck). Also none of the socket options look any good for this functionality.
I thought of unloading the BT stack dlls but that seems extreme to me plus I
am concerned about the side effects.
Any ideas on this would be appreciated
解答:
While BTD is registered as a CE Service and you may you the
IOCTL_SERVICE_START and IOCTL_SERVICE_STOP to enable and disabled the BT
stack.
A samples could be found in
$(_WINCEROOT)/public/common/oak/drivers/bluetooth/SAMPLE/BTLOADER/btloader.cxx
For the Discoverability could be set via BthWriteScanEnableMask API and more
sample could be found in
$(_WINCEROOT)/public/common/oak/drivers/bluetooth/SAMPLE/BTCP/btcp.cxx
IOCTL_SERVICE_START and IOCTL_SERVICE_STOP to enable and disabled the BT
stack.
A samples could be found in
$(_WINCEROOT)/public/common/oak/drivers/bluetooth/SAMPLE/BTLOADER/btloader.cxx
For the Discoverability could be set via BthWriteScanEnableMask API and more
sample could be found in
$(_WINCEROOT)/public/common/oak/drivers/bluetooth/SAMPLE/BTCP/btcp.cxx