Connect to a BLE GATT server based on its identifier.
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 control 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 control is Scanning, the control 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();