iOS Developer Library


CBATTRequest Class Reference

Deployment Target:

On This Page


The CBATTRequest class represents Attribute Protocol (ATT) read and write requests from remote central devices (represented by CBCentral objects). Remote centrals use these ATT requests to read and write characteristic values on local peripherals (represented by CBPeripheralManager objects). Local peripherals, on the other hand, use the properties of CBATTRequest objects to respond to the read and write requests appropriately, using the respondToRequest:withResult: method of the CBPeripheralManager class.

  • The remote central device that originated the request. (read-only)


    @property(readonly, retain, nonatomic) CBCentral *central

  • The characteristic whose value is to be read or written. (read-only)


    @property(readonly, retain, nonatomic) CBCharacteristic *characteristic

  • The data being read or written.


    @property(readwrite, copy) NSData *value


    The value of this property differs according to the type of request. For read requests, the property of this value is nil and should be set before responding to the remote central through the respondToRequest:withResult: method. For write requests, the value of this property is the data that is to be written to the characteristic’s value.

    See Also


  • The zero-based index of the first byte for the read or write request. (read-only)


    @property(readonly, nonatomic) NSUInteger offset


    You can use the value of this property to ensure that the ATT request is attempting to read or write within the proper bounds of the characteristic’s value. For an example of how to take a request’s offset property into account when responding to a read or write request, see Responding to Read and Write Requests from a Central.