Instance Method

peripheralManager:didReceiveWriteRequests:

Invoked when a local peripheral device receives an Attribute Protocol (ATT) write request for a characteristic that has a dynamic value.

Declaration

- (void)peripheralManager:(CBPeripheralManager *)peripheral didReceiveWriteRequests:(NSArray<CBATTRequest *> *)requests;

Parameters

peripheral

The peripheral manager providing this information.

requests

A list of one or more CBATTRequest objects, each representing a request to write the value of a characteristic.

Discussion

In the same way that you respond to a read request, each time this method is invoked, you call the respondToRequest:withResult: method of the CBPeripheralManager class exactly once. If the requests parameter contains multiple requests, treat them as you would a single request—if any individual request cannot be fulfilled, you should not fulfill any of them. Instead, call the respondToRequest:withResult: method immediately, and provide a result that indicates the cause of the failure.

When you respond to a write request, note that the first parameter of the respondToRequest:withResult: method expects a single CBATTRequest object, even though you received an array of them from the peripheralManager:didReceiveWriteRequests: method. To respond properly, pass in the first request of the requests array.

See Also

Receiving Read and Write Requests

- peripheralManager:didReceiveReadRequest:

Invoked when a local peripheral device receives an Attribute Protocol (ATT) read request for a characteristic that has a dynamic value.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software