---
title: "respond(to:withResult:)"
framework: corebluetooth
role: symbol
role_heading: Instance Method
path: "corebluetooth/cbperipheralmanager/respond(to:withresult:)"
---

# respond(to:withResult:)

Responds to a read or write request from a connected central.

## Declaration

```swift
func respond(to request: CBATTRequest, withResult result: CBATTError.Code)
```

## Parameters

- `request`: The read or write request received from the connected central. For more information about read and write requests, see doc://com.apple.corebluetooth/documentation/CoreBluetooth/CBATTRequest.
- `result`: The result of attempting to fulfill the request. For a list of possible results, see doc://com.apple.corebluetooth/documentation/CoreBluetooth/deprecated-constants.

## Discussion

Discussion When the peripheral manager receives a request from a connected central to read or write a characteristic’s value, it calls the peripheralManager(_:didReceiveRead:) or peripheralManager(_:didReceiveWrite:) method of its delegate object. To respond to the corresponding read or write request, you call this method whenever you recevie one of these delegate method callbacks.
