Lines Matching +full:buffer +full:- +full:size
2 * @brief Bluetooth data buffer API
8 * SPDX-License-Identifier: Apache-2.0
57 /** Helper to include reserved HCI data in buffer calculations */
58 #define BT_BUF_SIZE(size) (BT_BUF_RESERVE + (size)) argument
60 /** Helper to calculate needed buffer size for HCI ACL packets */
61 #define BT_BUF_ACL_SIZE(size) BT_BUF_SIZE(BT_HCI_ACL_HDR_SIZE + (size)) argument
63 /** Helper to calculate needed buffer size for HCI Event packets. */
64 #define BT_BUF_EVT_SIZE(size) BT_BUF_SIZE(BT_HCI_EVT_HDR_SIZE + (size)) argument
66 /** Helper to calculate needed buffer size for HCI Command packets. */
67 #define BT_BUF_CMD_SIZE(size) BT_BUF_SIZE(BT_HCI_CMD_HDR_SIZE + (size)) argument
69 /** Helper to calculate needed buffer size for HCI ISO packets. */
70 #define BT_BUF_ISO_SIZE(size) BT_BUF_SIZE(BT_HCI_ISO_HDR_SIZE + \ argument
72 (size))
74 /** Data size needed for HCI ACL RX buffers */
77 /** Data size needed for HCI Event RX buffers */
93 * the way we re-assemble ACL packets into L2CAP PDUs.
95 * We keep around the first buffer (that comes from the driver) to do
96 * re-assembly into, and if all links are re-assembling, there will be no buffer
114 "Maximum number of ACL RX buffer is 65535, reduce CONFIG_BT_BUF_ACL_RX_COUNT_EXTRA");
116 /** Data size needed for HCI ACL, HCI ISO or Event RX buffers */
120 /** Buffer count needed for HCI ACL, HCI ISO or Event RX buffers */
125 /** Data size needed for HCI Command buffers. */
128 /** Allocate a buffer for incoming data
130 * This will set the buffer type so bt_buf_set_type() does not need to
133 * @param type Type of buffer. Only BT_BUF_EVT, BT_BUF_ACL_IN and BT_BUF_ISO_IN
135 * @param timeout Non-negative waiting period to obtain a buffer or one of the
137 * @return A new buffer.
141 /** A callback to notify about freed buffer in the incoming data pool.
143 * This callback is called when a buffer of a given type is freed and can be requested through the
144 * @ref bt_buf_get_rx function. However, this callback is called from the context of the buffer
145 * freeing operation and must not attempt to allocate a new buffer from the same pool.
149 * short non-blocking operation (e.g. submitting a work item).
151 * @param type_mask A bit mask of buffer types that have been freed.
155 /** Set the callback to notify about freed buffer in the incoming data pool.
157 * @param cb Callback to notify about freed buffer in the incoming data pool. If NULL, the callback
162 /** Allocate a buffer for outgoing data
164 * This will set the buffer type so bt_buf_set_type() does not need to
167 * @param type Type of buffer. Only BT_BUF_CMD, BT_BUF_ACL_OUT or
169 * @param timeout Non-negative waiting period to obtain a buffer or one of the
171 * @param data Initial data to append to buffer.
172 * @param size Initial data size.
173 * @return A new buffer.
176 const void *data, size_t size);
178 /** Allocate a buffer for an HCI Event
180 * This will set the buffer type so bt_buf_set_type() does not need to
185 * @param timeout Non-negative waiting period to obtain a buffer or one of
187 * @return A new buffer.
191 /** Set the buffer type
193 * @param buf Bluetooth buffer
194 * @param type The BT_* type to set the buffer to
198 ((struct bt_buf_data *)net_buf_user_data(buf))->type = type; in bt_buf_set_type()
201 /** Get the buffer type
203 * @param buf Bluetooth buffer
205 * @return The BT_* type to of the buffer
210 ->type; in bt_buf_get_type()