Responds to a read or write request from a connected central.
SDKs
- iOS 6.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 4.0+
Framework
- Core Bluetooth
Declaration
- (void)respondToRequest:(CBATTRequest *)request withResult:(CBATTError)result;
Parameters
request
The read or write request received from the connected central. For more information about read and write requests, see
CBATTRequest
.result
The result of attempting to fulfill the request. For a list of possible results, see Deprecated Constants.
Discussion
When the peripheral manager receives a request from a connected central to read or write a characteristic’s value, it calls the peripheral
or peripheral
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.