IPWorks BLE 2020 Delphi Edition

Questions / Feedback?

Connect Method

Connect to a BLE GATT server based on its identifier.

procedure Connect(ServerId: String);

Remarks

This method will attempt to connect to the BLE GATT server represented by the platform-specific identifier supplied in the ServerId parameter. The Connected event will be fired when the connection attempt finishes, and will contain additional information if the attempt failed.

If the component is connected to a server already when Connect is called, and the given ServerId is different than the currently connected server's ServerId, it will attempt to gracefully disconnect prior to initiating a new connection.

Calling Connect does nothing if ServerId is empty or matches the currently connected server's ServerId.

If Connect is called while the component is Scanning, the component will stop scanning prior to attempting to initiate a connection.

Note that there are a variety of reasons that a connection to a server may fail, not the least of which includes the server device being out of range of the client device. For the best results, it is recommended that you scan for devices before attempting a connection. Also note that the device identifier is a platform-specific value which is not guaranteed to be the same at any given point in time for any specific server device.

Connecting and Disconnecting

// Connect to our TI SensorTag device.
bleclient1.Connect("546C0E795800");
// Use BLEClient...
// Disconnect from the device.
bleclient1.Disconnect();

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks BLE 2020 Delphi Edition - Version 20.0 [Build 8158]