Datasheet

Page 75 of 161
nRF8001 Product Specification
Revision 1.2
21 Flow control
ACI commands received by nRF8001 are executed using the First In, First Out (FIFO) principle. System
and Data commands differ in the flow control scheme they enforce:
System commands must be confirmed as executed by nRF8001 before a new system command
can be issued by the application controller. This implies that no system command can be sent
before receiving an event from nRF8001 confirming the execution of the previous command.
Data commands can be queued in a data command buffer pending execution. The application
controller must ensure that the number of issued data commands does not overflow the data
command buffer.
21.1 System command buffering
Only one System Command can be outstanding at any moment in time before the application controller is
allowed to send another one. When the pending system command has executed, nRF8001 issues an
event or a sequence of events. See the command descriptions in chapter 23 on page 90
for details.
The application controller must receive an event confirming the execution of the command before sending
the next system command.
The response event for a command is sent from nRF8001 within 2 seconds of receiving the command from
the application controller.
21.2 Data command buffering
The data command buffer size of nRF8001 is returned in the DeviceStartedEvent. The buffer size
value represents the maximum number of data commands that may be queued by nRF8001, and is
represented by a number of credits granted by nRF8001 to the application controller.
These credits are available for use only after receiving the
ConnectedEvent. When the
ConnectedEvent is received, set the number of credits available for use as the value received in "Data
Credit Available" in the
DeviceStartedEvent.
When a data command has been executed on nRF8001, a buffer location is released. Upon release of one
or more buffer locations, nRF8001 sends a
DataCreditEvent to the application controller. The
DataCreditEvent contains the number of freed buffer locations, called credits. The application
controller must keep track of the number of available credits at any time. No assumptions can be made by
the application controller as to the timing of credit allowance, as a single
DataCreditEvent may grant
more than one credit. Submitting a data command will subtract one credit from the number of available
credits. Figure 44. on page 76
illustrates the flow control and the data credit principle.
If the application controller tries to send a data command when no credit is available, nRF8001 will
respond with a
PipeErrorEvent with its status code set to
ACI_STATUS_ERROR_CREDIT_NOT_AVAILABLE.
Please note that further restrictions apply related to ATT (Attribute Protocol) flow control, please refer to
the
Bluetooth Core specification v4.0, Vol. 3, Part F, section 3.3 for details.