doc: can send now is only valid until packet handler exit

This commit is contained in:
Milanka Ringwald 2018-12-12 15:16:27 +01:00
parent 472a1e5f81
commit 50f3b808a0
3 changed files with 11 additions and 2 deletions

View File

@ -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 - 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 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) *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 Event | Event Code
-----------|---------------------------------------- -----------|----------------------------------------
@ -65,6 +66,8 @@ by RFCOMM:
- RFCOMM_EVENT_CAN_SEND_NOW - Indicates that an RFCOMM data packet could - 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 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) *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 Event | Event Code

View File

@ -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. 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. 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 ### 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. 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 and wait for the reception of the RFCOMM_EVENT_CAN_SEND_NOW event
to send the packet, as shown in Listing [below](#lst:rfcommRequestCanSendNow). 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.}"} ~~~~ {#lst:rfcommRequestCanSendNow .c caption="{Preparing and sending data.}"}
void prepare_data(uint16_t rfcomm_channel_id){ void prepare_data(uint16_t rfcomm_channel_id){
... ...

View File

@ -16,6 +16,6 @@ pages:
- 'Existing Ports': ports/existing_ports.md - 'Existing Ports': ports/existing_ports.md
- 'Integrating with Existing Systems': integration.md - 'Integrating with Existing Systems': integration.md
- 'APIs': appendix/apis.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 - 'Migration to v1.0': appendix/migration.md
theme: readthedocs theme: readthedocs