System.Bluetooth.Components.TBluetoothLE.DiscoverDevices

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function DiscoverDevices(ATimeout: Integer): Boolean; overload;
function DiscoverDevices(ATimeout: Integer; const AList: TBluetoothUUIDsList): Boolean; overload;
function DiscoverDevices(ATimeout: Integer; AList: array of TBluetoothUUID): Boolean; overload;
function DiscoverDevices(ATimeout: Cardinal; const ABluetoothLEScanFilterList: TBluetoothLEScanFilterList): Boolean; overload;

C++

bool __fastcall DiscoverDevices(int ATimeout)/* overload */;
bool __fastcall DiscoverDevices(int ATimeout, System::Bluetooth::TBluetoothUUIDsList* const AList)/* overload */;
bool __fastcall DiscoverDevices(int ATimeout, GUID *AList, const System::NativeInt AList_High)/* overload */;
bool __fastcall DiscoverDevices(unsigned ATimeout, System::Bluetooth::TBluetoothLEScanFilterList* const ABluetoothLEScanFilterList)/* overload */;

Properties

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

Description

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

DiscoverDevices always expects a Timeout argument, which is how much time you want to spend discovering remote devices using Bluetooth Low Energy.

You may also provide an AList argument, an array or list of UUIDs of services to look for in remote devices. If you provide a list of service UUIDs, the discovery operation ignores any remote device that does not provide at least one service with an UUID from the specified list.

When the discovery operation finishes, the OnEndDiscoverDevices event occurs. OnEndDiscoverDevices provides a list of discovered remote devices.

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

Attention: If using iOS 13.3.1 and 13.3.0, the Bluetooth LE device discovery methods TBluetoothManagerLE.StartDiscovery and TBluetoothLE.DiscoverDevices cause the mobile app to close without notice.

Platform Support

Platform Notes

Windows

OS X

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

iOS

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

Android

See Also