Show: Object Pascal C++
Display Preferences

System.Bluetooth.TBluetoothLEManager.StartDiscovery

From Appmethod Libraries
Jump to: navigation, search

Object Pascal

function StartDiscovery(Timeout: Cardinal; const AFilterUUIDList: TBluetoothUUIDsList = nil; ForceConnect: Boolean = False): Boolean;

C++

bool __fastcall StartDiscovery(unsigned Timeout, TBluetoothUUIDsList* const AFilterUUIDList = (TBluetoothUUIDsList*)(0x0), bool ForceConnect = false);

Properties

Type Visibility Source Unit Parent
function public
System.Bluetooth.pas
System.Bluetooth.hpp
System.Bluetooth TBluetoothLEManager

Description

Starts a discovery operation to find remote devices using Bluetooth Low Energy.

StartDiscovery accepts the following parameters:

  • <Timeout> determines how much time you want to spend discovering remote devices using Bluetooth Low Energy.
  • <AFilterUUIDList> is an optional list of one or more UUIDs of Bluetooth GATT services. If you provide this list, the manager ignores the remote devices that do not advertise at least one of the specified services.
  • If <ForceConnect> is True and you provide a value for <AFilterUUIDList>, the manager connects to every discovered remote device to obtain a complete list of the services that each remote device provides, so that StartDiscovery does not ignore devices that do provide one of the specified services but do not advertise it.

The OnDiscoverLeDevice event occurs once for each discovered remote device. When the discovery operation finishes, the OnDiscoveryEnd event occurs. OnDiscoveryEnd provides a list of discovered remote devices.

When a device is ignored because it does not advertise or provide one of the specified services:

  • The OnDiscoverLeDevice event does not occur for that remote device.
  • The remote device is not part of the list of remote devices that the event handler of OnDiscoveryEnd receives.

StartDiscovery returns True if the discovery starts successfully, or False if something prevents the discovery from starting.

StartDiscovery calls StartDiscovery of the current adapter.

Platform Support

Platform Notes

32-bit Windows
64-bit Windows

  • <Timeout> is ignored because StartDiscovery triggers the OnDiscoveryEnd event immediately.
  • Always returns True.

Mac OS X

  • OnDiscoveryEnd always occurs some time after the specified <Timeout>, never before.
  • Always returns True.

iOS

  • OnDiscoveryEnd always occurs some time after the specified <Timeout>, never before.
  • Always returns True.

Android

  • OnDiscoveryEnd always occurs after the specified <Timeout>, never before.

See Also

Personal tools
Translations