BluetoothGatt BluetoothGatt Class

Definition

Public API for the Bluetooth GATT Profile.

[Android.Runtime.Register("android/bluetooth/BluetoothGatt", ApiSince=18, DoNotGenerateAcw=true)]
public sealed class BluetoothGatt : Java.Lang.Object, Android.Bluetooth.IBluetoothProfile, IDisposable
type BluetoothGatt = class
    inherit Object
    interface IBluetoothProfile
    interface IJavaObject
    interface IDisposable
Inheritance
BluetoothGattBluetoothGatt
Attributes
Implements

Remarks

Android platform documentation

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Fields

ConnectionPriorityBalanced ConnectionPriorityBalanced

Connection paramter update - Use the connection paramters recommended by the Bluetooth SIG.

ConnectionPriorityHigh ConnectionPriorityHigh

Connection paramter update - Request a high priority, low latency connection.

ConnectionPriorityLowPower ConnectionPriorityLowPower

Connection paramter update - Request low power, reduced data rate connection parameters.

GattConnectionCongested GattConnectionCongested

A remote device connection is congested.

GattFailure GattFailure

A GATT operation failed, errors other than the above

GattInsufficientAuthentication GattInsufficientAuthentication

Insufficient authentication for a given operation

GattInsufficientEncryption GattInsufficientEncryption

Insufficient encryption for a given operation

GattInvalidAttributeLength GattInvalidAttributeLength

A write operation exceeds the maximum length of the attribute

GattInvalidOffset GattInvalidOffset

A read or write operation was requested with an invalid offset

GattReadNotPermitted GattReadNotPermitted

GATT read operation is not permitted

GattRequestNotSupported GattRequestNotSupported

The given request is not supported

GattSuccess GattSuccess

A GATT operation completed successfully

GattWriteNotPermitted GattWriteNotPermitted

GATT write operation is not permitted

Properties

Class Class

Returns the unique instance of Class that represents this object's class.

(Inherited from Object)
ConnectedDevices ConnectedDevices

Not supported - please use GetConnectedDevices(ProfileType) with Gatt as argument

Device Device

Return the remote bluetooth device this GATT client targets to

Handle Handle

The handle to the underlying Android instance.

(Inherited from Object)
IJavaObjectEx.IsProxy IJavaObjectEx.IsProxy Inherited from Object
IJavaObjectEx.KeyHandle IJavaObjectEx.KeyHandle Inherited from Object
IJavaObjectEx.NeedsActivation IJavaObjectEx.NeedsActivation Inherited from Object
IJavaPeerable.JniManagedPeerState IJavaPeerable.JniManagedPeerState Inherited from Object
JniIdentityHashCode JniIdentityHashCode Inherited from Object
JniPeerMembers JniPeerMembers
PeerReference PeerReference Inherited from Object
Services Services

Returns a list of GATT services offered by the remote device.

ThresholdClass ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
ThresholdType ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)

Methods

AbortReliableWrite() AbortReliableWrite()

Cancels a reliable write transaction for a given device.

AbortReliableWrite(BluetoothDevice) AbortReliableWrite(BluetoothDevice)
BeginReliableWrite() BeginReliableWrite()

Initiates a reliable write transaction for a given remote device.

Clone() Clone()

Creates and returns a copy of this Object.

(Inherited from Object)
Close() Close()

Close this Bluetooth GATT client.

Connect() Connect()

Connect back to remote device.

Disconnect() Disconnect()

Disconnects an established connection, or cancels a connection attempt currently in progress.

DiscoverServices() DiscoverServices()

Discovers services offered by a remote device as well as their characteristics and descriptors.

Dispose() Dispose() Inherited from Object
Dispose(Boolean) Dispose(Boolean) Inherited from Object
Equals(Object) Equals(Object)

Compares this instance with the specified object and indicates if they are equal.

(Inherited from Object)
ExecuteReliableWrite() ExecuteReliableWrite()

Executes a reliable write transaction for a given remote device.

GetConnectionState(BluetoothDevice) GetConnectionState(BluetoothDevice)

Not supported - please use GetConnectedDevices(ProfileType) with Gatt as argument

GetDevicesMatchingConnectionStates(ProfileState[]) GetDevicesMatchingConnectionStates(ProfileState[])

Not supported - please use GetDevicesMatchingConnectionStates(ProfileType, Int32[]) with Gatt as first argument

GetHashCode() GetHashCode()

Returns an integer hash code for this object.

(Inherited from Object)
GetService(UUID) GetService(UUID)

Returns a BluetoothGattService, if the requested UUID is supported by the remote device.

JavaFinalize() JavaFinalize()

Invoked when the garbage collector has detected that this instance is no longer reachable.

(Inherited from Object)
Notify() Notify()

Causes a thread which is waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
NotifyAll() NotifyAll()

Causes all threads which are waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
ReadCharacteristic(BluetoothGattCharacteristic) ReadCharacteristic(BluetoothGattCharacteristic)

Reads the requested characteristic from the associated remote device.

ReadDescriptor(BluetoothGattDescriptor) ReadDescriptor(BluetoothGattDescriptor)

Reads the value for a given descriptor from the associated remote device.

ReadPhy() ReadPhy()
ReadRemoteRssi() ReadRemoteRssi()

Read the RSSI for a connected remote device.

RequestConnectionPriority(GattConnectionPriority) RequestConnectionPriority(GattConnectionPriority)

Request a connection parameter update.

RequestMtu(Int32) RequestMtu(Int32)

Request an MTU size used for a given connection.

SetCharacteristicNotification(BluetoothGattCharacteristic, Boolean) SetCharacteristicNotification(BluetoothGattCharacteristic, Boolean)

Enable or disable notifications/indications for a given characteristic.

SetHandle(IntPtr, JniHandleOwnership) SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetPreferredPhy(BluetoothPhy, BluetoothPhy, BluetoothPhyOption) SetPreferredPhy(BluetoothPhy, BluetoothPhy, BluetoothPhyOption)
ToArray<T>() ToArray<T>() Inherited from Object
ToString() ToString()

Returns a string containing a concise, human-readable description of this object.

(Inherited from Object)
UnregisterFromRuntime() UnregisterFromRuntime() Inherited from Object
Wait() Wait()

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.

(Inherited from Object)
Wait(Int64) Wait(Int64)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)
Wait(Int64, Int32) Wait(Int64, Int32)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)
WriteCharacteristic(BluetoothGattCharacteristic) WriteCharacteristic(BluetoothGattCharacteristic)

Writes a given characteristic and its values to the associated remote device.

WriteDescriptor(BluetoothGattDescriptor) WriteDescriptor(BluetoothGattDescriptor)

Write the value of a given descriptor to the associated remote device.

Explicit Interface Implementations

IJavaObjectEx.ToLocalJniHandle() IJavaObjectEx.ToLocalJniHandle() Inherited from Object
IJavaPeerable.Disposed() IJavaPeerable.Disposed() Inherited from Object
IJavaPeerable.DisposeUnlessReferenced() IJavaPeerable.DisposeUnlessReferenced() Inherited from Object
IJavaPeerable.Finalized() IJavaPeerable.Finalized() Inherited from Object
IJavaPeerable.SetJniIdentityHashCode(Int32) IJavaPeerable.SetJniIdentityHashCode(Int32) Inherited from Object
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) Inherited from Object
IJavaPeerable.SetPeerReference(JniObjectReference) IJavaPeerable.SetPeerReference(JniObjectReference) Inherited from Object

Extension Methods

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable) GetJniTypeName(IJavaPeerable)

Applies to