Instance Method


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


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



The read or write request that was received from the connected central. For more information about read and write requests, see CBATTRequest.


The result of attempting to fulfill the request. For a list of possible results, see Core Bluetooth Constants.


When the peripheral manager receives a request (represented as a CBATTRequest object) 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. Each time one of these delegate methods is called, you call this method to respond to the corresponding read or write request.