Language

BluetoothGattServer.SendResponse Method

Definition

Overloads

Name Description
SendResponse(BluetoothDevice, Int32, GattStatus, Int32, Byte[])

Sends a GATT read or write response to a remote client.

SendResponse(BluetoothDevice, Int32, ProfileState, Int32, Byte[])

Send a response to a read or write request to a remote device.

SendResponse(BluetoothDevice, Int32, GattStatus, Int32, Byte[])

Sends a GATT read or write response to a remote client.

public bool SendResponse(Android.Bluetooth.BluetoothDevice device, int requestId, Android.Bluetooth.GattStatus status, int offset, byte[] value);
member this.SendResponse : Android.Bluetooth.BluetoothDevice * int * Android.Bluetooth.GattStatus * int * byte[] -> bool

Parameters

device
BluetoothDevice

The remote GATT client that will receive the response.

requestId
Int32

The request identifier received in the corresponding read or write callback.

status
GattStatus

The GATT status code to send for the request.

offset
Int32

The value offset used for a partial read or write response.

value
Byte[]

The attribute bytes included in the response, or null when no value is supplied.

Returns

true if the response was submitted to the Bluetooth service; otherwise, false.

Remarks

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.

Applies to

SendResponse(BluetoothDevice, Int32, ProfileState, Int32, Byte[])

Send a response to a read or write request to a remote device.

[Android.Runtime.Register("sendResponse", "(Landroid/bluetooth/BluetoothDevice;III[B)Z", "")]
[Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")]
public bool SendResponse(Android.Bluetooth.BluetoothDevice device, int requestId, Android.Bluetooth.ProfileState status, int offset, byte[]? value);
[<Android.Runtime.Register("sendResponse", "(Landroid/bluetooth/BluetoothDevice;III[B)Z", "")>]
[<Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")>]
member this.SendResponse : Android.Bluetooth.BluetoothDevice * int * Android.Bluetooth.ProfileState * int * byte[] -> bool

Parameters

device
BluetoothDevice

The remote device to send this response to

requestId
Int32

The ID of the request that was received with the callback

status
ProfileState

The status of the request to be sent to the remote devices

offset
Int32

Value offset for partial read/write response

value
Byte[]

The value of the attribute that was read/written (optional)

Returns

true if the response was submitted to the Bluetooth service; otherwise, false.

Attributes

Remarks

Send a response to a read or write request to a remote device.

This function must be invoked in when a remote read/write request is received by one of these callback methods:

<ul> <li>BluetoothGattServerCallback#onCharacteristicReadRequest<li>BluetoothGattServerCallback#onCharacteristicWriteRequest<li>BluetoothGattServerCallback#onDescriptorReadRequest<li>BluetoothGattServerCallback#onDescriptorWriteRequest</ul>

Java documentation for android.bluetooth.BluetoothGattServer.sendResponse(android.bluetooth.BluetoothDevice, int, int, int, byte[]).

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.

Applies to