diff --git a/doc/manual/docs/appendix/events_errors.md b/doc/manual/docs/appendix/events_errors.md index 4156bf84c..e6a225177 100644 --- a/doc/manual/docs/appendix/events_errors.md +++ b/doc/manual/docs/appendix/events_errors.md @@ -21,7 +21,8 @@ L2CAP_DATA_PACKET packet type. L2CAP provides the following events: - L2CAP_EVENT_CAN_SEND_NOW - Indicates that an L2CAP data packet could be sent on the reported l2cap_cid. It is emitted after a call to *l2cap_request_can_send_now*. See [Sending L2CAP Data](protocols/#sec:l2capSendProtocols) - + Please note that the guarantee that a packet can be sent is only valid when the event is received. + After returning from the packet handler, BTstack might need to send itself. Event | Event Code -----------|---------------------------------------- @@ -65,6 +66,8 @@ by RFCOMM: - RFCOMM_EVENT_CAN_SEND_NOW - Indicates that an RFCOMM data packet could be sent on the reported rfcomm_cid. It is emitted after a call to *rfcomm_request_can_send_now*. See [Sending RFCOMM Data](protocols/#sec:rfcommSendProtocols) + Please note that the guarantee that a packet can be sent is only valid when the event is received. + After returning from the packet handler, BTstack might need to send itself. Event | Event Code diff --git a/doc/manual/docs/protocols.md b/doc/manual/docs/protocols.md index 03b0a2132..61673c033 100644 --- a/doc/manual/docs/protocols.md +++ b/doc/manual/docs/protocols.md @@ -303,6 +303,9 @@ as soon as possible. It might happen that the event is received via packet handler before the *l2cap_request_can_send_now_event* function returns. The L2CAP_EVENT_CAN_SEND_NOW indicates a channel ID on which sending is possible. +Please note that the guarantee that a packet can be sent is only valid when the event is received. +After returning from the packet handler, BTstack might need to send itself. + ### LE Data Channels The full title for LE Data Channels is actually LE Connection-Oriented Channels with LE Credit-Based Flow-Control Mode. In this mode, data is sent as Service Data Units (SDUs) that can be larger than an individual HCI LE ACL packet. @@ -559,6 +562,9 @@ When there is a need to send a packet, call *rcomm_request_can_send_now* and wait for the reception of the RFCOMM_EVENT_CAN_SEND_NOW event to send the packet, as shown in Listing [below](#lst:rfcommRequestCanSendNow). +Please note that the guarantee that a packet can be sent is only valid when the event is received. +After returning from the packet handler, BTstack might need to send itself. + ~~~~ {#lst:rfcommRequestCanSendNow .c caption="{Preparing and sending data.}"} void prepare_data(uint16_t rfcomm_channel_id){ ... diff --git a/doc/manual/mkdocs.yml b/doc/manual/mkdocs.yml index 479c6a247..d61d32e8f 100644 --- a/doc/manual/mkdocs.yml +++ b/doc/manual/mkdocs.yml @@ -16,6 +16,6 @@ pages: - 'Existing Ports': ports/existing_ports.md - 'Integrating with Existing Systems': integration.md - 'APIs': appendix/apis.md -- 'Eventts and Errors': appendix/events_errors.md +- 'Events and Errors': appendix/events_errors.md - 'Migration to v1.0': appendix/migration.md theme: readthedocs