requestId: Int, characteristic: BluetoothGattCharacteristic, preparedWrite: Boolean, responseNeeded: Boolean, offset: Int, value: ByteArray) { super.onCharacteristicWriteRequest( device, requestId, characteristic, preparedWrite, responseNeeded, offset, value) if (UUID_CHARACTERISTIC == characteristic.uuid) { try { ... } finally { if (responseNeeded) { bluetoothGattServer.sendResponse( device, requestId, BluetoothGatt.GATT_SUCCESS, offset, value) } } } }