sendResponse

abstract fun sendResponse(device: ClientDevice, requestId: Int, status: Int, offset: Int, value: DataByteArray?)

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

It should be send as a response for one of this events:

  • OnCharacteristicReadRequest

  • OnCharacteristicWriteRequest

  • OnDescriptorReadRequest

  • OnDescriptorWriteRequest

Parameters

device

The remote device to send this response to.

requestId

The ID of the request that was received with the callback.

status

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

offset

Value offset for partial read/write response.

value

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

See also

(https://developer.android.com/reference/android/bluetooth/BluetoothGattServer#sendResponse(android.bluetooth.BluetoothDevice,%20int,%20int,%20int,%20byte[]))