ActivateBTDevice
10/16/2008
This function activates a profile on a remote device.
Syntax
DWORD ActivateBTDevice(
BT_ADDR btDevice,
USHORT nProfileID,
UINT *pnPortNo
);
Parameters
- btDevice
[in] A BT_ADDR type specifying the Bluetooth address of the device.
- nProfileID
[in] A Service Class UUID representing which service class (Profile) to activate.
- pnPortNo
[out] A pointer to an unsigned integer that, after the function call returns, indicates the logical port number reserved for the activated device profile.
Return Values
Returns the following standard Win32 error codes.
Code | Description |
---|---|
ERROR_SUCCESS |
Success. |
ERROR_BUSY |
The Bluetooth device is in the process of pairing. |
ERROR_ACCESS_DENIED |
The service is not initialized or the Bluetooth device is off. |
ERROR_INVALID_PARAMETER |
A parameter is invalid. |
ERROR_NOT_FOUND |
The profile specified in the nProfileID parameter is not found. |
ERROR_OPEN_FAILED |
The specified profile does not have a valid RFComm channel assigned. |
Remarks
When this function activates a profile, it reserves a logical port number, and registers the Bluetooth COM driver to that port.
You can only activate 10 profiles. If you attempt to activate more profiles, this function will return an error.
Requirements
Header | btpairapi.h |
Library | btpairapi.lib |
Windows Embedded CE | Windows CE 5.0, Windows Embedded NavReady 2009 |