Ejemplo n.º 1
0
        /// <summary>
        /// Create a Generic Attribute Profile client to exchange profile and user data with a specific device.
        /// </summary>
        /// <param name="bluetoothAddress">Address of the Bluetooth device to connect to</param>
        /// <returns>Returns the <c>Gatt</c> Client</returns>
        public static MLResult GattConnect(string bluetoothAddress)
        {
            if (!MLBluetoothLE.IsValidInstance())
            {
                return(MLResult.Create(MLResult.Code.UnspecifiedFailure));
            }

            if (!NativeBindings.GattConnect(bluetoothAddress).IsOk)
            {
                // Failed to connect. Exit.
                return(MLResult.Create(MLResult.Code.UnspecifiedFailure));
            }

            return(MLResult.Create(MLResult.Code.Ok));
        }