TwclBluetoothRadio.SetDiscoverable(Boolean) Method

Changes the discoverable state of the local Bluetooth Radio.

Namespace: wclBluetooth
public
 function SetDiscoverable(const Discoverable: Boolean): Integer;

Parameters

Discoverable
Type: Boolean

The new discoverable state for the Radio.

Return Value

Type: Integer

If the function succeed the return value is wclErrors.WCL_E_SUCCESS. Otherwise the method returns one of the WCL error codes.

Setting the Discoverable parameter to True allows remote Bluetooth enabled devices to discover this Radio.

Setting the Discoverable parameter to False blocks the Radio from discovering by remote Bluetooth enabled devices.

Microsoft: Use the GetDiscoverable method to determine the current state of a Bluetooth radio. Windows ensures that a discoverable system is connectable, and as such, the radio must allow incoming connections prior to making a radio discoverable. Failure to allow incoming connections results in the SetDiscoverable method call failing.

When SetDiscoverable changes the discovery state, the new state is valid for the lifetime of the calling application. Additionally, if a Bluetooth radio previously made discoverable with this function is disabled and re-enabled via the application, discoverability will not persist. Once the calling application terminates, the discovery state of the specified Bluetooth radio reverts to the state it was in before SetDiscoverable was called.