This file provides the Definition of an ACL packet buffer, as well as some usefull functions helping to deal with ACL packet buffers.
Note: Applications typically make not use of the functions defined here. Instead, this API is intended for lower layer protocols.
#include <sys/types.h>
#include <bt/bt_defs.h>
Data Structures | |
struct | bt_acl_pkt_buf_s |
ACL Packet Buffer Definition. More... | |
Typedefs | |
typedef bt_acl_pkt_buf_s | bt_acl_pkt_buf |
ACL packet buffer typedef. | |
typedef bt_acl_pkt_fifo_s | bt_acl_pkt_fifo |
Typedef of a FIFO queue, buffering ACL packet buffers. | |
Functions | |
ACL Packet Buffer Creation & Destruction | |
Definition of an ACL packet buffer and API functions for creating / destroying ACL packet buffers | |
bt_acl_pkt_buf * | bt_acl_pkt_buf_create (struct btstack *stack) |
Creates a single ACL packet buffer. | |
void | bt_acl_pkt_buf_destroy (bt_acl_pkt_buf *buf) |
Destroys the ACL packet buffer passed. | |
bt_acl_pkt_buf * | bt_acl_pkt_queue_create (struct btstack *stack, u_short nr_bufs) |
Creates a queue of ACL packet buffers. | |
void | bt_acl_pkt_queue_destroy (bt_acl_pkt_buf *que) |
Destroys an ACL packet buffer queue. | |
FIFO queueing ACL packet buffers | |
void | bt_acl_pkt_fifo_add_first (bt_acl_pkt_fifo *fifo, bt_acl_pkt_buf *buf) |
Adds the ACL packet buffer passed to the head of the FIFO queue specified. | |
void | bt_acl_pkt_fifo_add_last (bt_acl_pkt_fifo *fifo, bt_acl_pkt_buf *buf) |
Adds the ACL packet buffer passed to the end of the FIFO queue specified. | |
bt_acl_pkt_fifo * | bt_acl_pkt_fifo_create (void) |
Creates a fifo queue for queueing ACL packet buffers. | |
void | bt_acl_pkt_fifo_destroy (bt_acl_pkt_fifo *fifo) |
Destroys a FIFO queue. | |
bt_acl_pkt_buf * | bt_acl_pkt_fifo_get_first (bt_acl_pkt_fifo *fifo) |
Gets the first ACL packet buffer from the FIFO queue passed. | |
bt_acl_pkt_buf * | bt_acl_pkt_fifo_top (bt_acl_pkt_fifo *fifo) |
Returns a pointer to the first ACL packet buffer in the queue passed. |
bt_acl_pkt_buf* bt_acl_pkt_buf_create | ( | struct btstack * | stack | ) |
Creates a single ACL packet buffer.
Note: The memory allocated for an ACL packet buffer is determined by the ACL packet types in use. This has to be defined during initialization. See bt_acl_init for further details.
void bt_acl_pkt_buf_destroy | ( | bt_acl_pkt_buf * | buf | ) |
Destroys the ACL packet buffer passed.
Destroys a previousely created (using bt_acl_pkt_buf_create) ACL packet buffer.
void bt_acl_pkt_fifo_add_first | ( | bt_acl_pkt_fifo * | fifo, | |
bt_acl_pkt_buf * | buf | |||
) |
Adds the ACL packet buffer passed to the head of the FIFO queue specified.
fifo | Pointer to the fifo queue the buffer shall be added to | |
buf | Pointer to the ACL packet buffer to be added |
void bt_acl_pkt_fifo_add_last | ( | bt_acl_pkt_fifo * | fifo, | |
bt_acl_pkt_buf * | buf | |||
) |
Adds the ACL packet buffer passed to the end of the FIFO queue specified.
fifo | Pointer to the fifo queue the buffer shall be added to | |
buf | Pointer to the ACL packet buffer to be added |
bt_acl_pkt_fifo* bt_acl_pkt_fifo_create | ( | void | ) |
Creates a fifo queue for queueing ACL packet buffers.
void bt_acl_pkt_fifo_destroy | ( | bt_acl_pkt_fifo * | fifo | ) |
Destroys a FIFO queue.
Destroys a previousely created ACL packet buffer FIFO queue.
fifo | Pointer to the fifo queue to destroy |
bt_acl_pkt_buf* bt_acl_pkt_fifo_get_first | ( | bt_acl_pkt_fifo * | fifo | ) |
Gets the first ACL packet buffer from the FIFO queue passed.
Removes the first ACL packet buffer from the FIFO queue passed and returns a pointer to it.
fifo | Pointer to the fifo queue |
bt_acl_pkt_buf* bt_acl_pkt_fifo_top | ( | bt_acl_pkt_fifo * | fifo | ) |
Returns a pointer to the first ACL packet buffer in the queue passed.
Note: the ACL packet buffer won't be removed from the queue.
fifo | Pointer to the fifo queue |
bt_acl_pkt_buf* bt_acl_pkt_queue_create | ( | struct btstack * | stack, | |
u_short | nr_bufs | |||
) |
Creates a queue of ACL packet buffers.
Creates a queue (i.e. a linked list) of ACL packet buffers of the size given.
Note: The memory allocated for a single ACL packet buffer is determined by the ACL packet types in use. This has to be defined during initialization (see bt_acl_init).
nr_bufs | Number of buffers to create |
void bt_acl_pkt_queue_destroy | ( | bt_acl_pkt_buf * | que | ) |
Destroys an ACL packet buffer queue.
Destroys the previousely created (using bt_acl_pkt_queue_create) queue of ACL packet buffers.
que | Pointer to the first packet buf of the queue |