mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-24 03:40:07 +00:00
added hci_release_packet_buffer() and l2cap_release_packet_buffer()
This commit is contained in:
parent
facf93fdba
commit
68a0fcf7e2
@ -90,6 +90,10 @@ int l2cap_reserve_packet_buffer(void){
|
||||
return hci_reserve_packet_buffer();
|
||||
}
|
||||
|
||||
void l2cap_release_packet_buffer(void){
|
||||
hci_release_packet_buffer();
|
||||
}
|
||||
|
||||
int l2cap_send_prepared_connectionless(uint16_t handle, uint16_t cid, uint16_t len){
|
||||
|
||||
if (!hci_is_packet_buffer_reserved()){
|
||||
|
@ -291,6 +291,10 @@ int hci_reserve_packet_buffer(void){
|
||||
return 1;
|
||||
}
|
||||
|
||||
void hci_release_packet_buffer(void){
|
||||
hci_stack->hci_packet_buffer_reserved = 0;
|
||||
}
|
||||
|
||||
// assumption: synchronous implementations don't provide can_send_packet_now as they don't keep the buffer after the call
|
||||
int hci_transport_synchronous(void){
|
||||
return hci_stack->hci_transport->can_send_packet_now == NULL;
|
||||
|
@ -392,7 +392,8 @@ int hci_can_send_packet_now(uint8_t packet_type);
|
||||
int hci_can_send_packet_now_using_packet_buffer(uint8_t packet_type);
|
||||
|
||||
// reserves outgoing packet buffer. @returns 1 if successful
|
||||
int hci_reserve_packet_buffer(void);
|
||||
int hci_reserve_packet_buffer(void);
|
||||
void hci_release_packet_buffer(void);
|
||||
|
||||
// used for internal checks in l2cap[-le].c
|
||||
int hci_is_packet_buffer_reserved(void);
|
||||
|
@ -349,6 +349,11 @@ int l2cap_reserve_packet_buffer(void){
|
||||
return hci_reserve_packet_buffer();
|
||||
}
|
||||
|
||||
void l2cap_release_packet_buffer(void){
|
||||
hci_release_packet_buffer();
|
||||
}
|
||||
|
||||
|
||||
int l2cap_send_prepared(uint16_t local_cid, uint16_t len){
|
||||
|
||||
if (!hci_is_packet_buffer_reserved()){
|
||||
|
@ -202,6 +202,7 @@ int l2cap_can_send_packet_now(uint16_t local_cid); // non-blocking UART writ
|
||||
int l2cap_can_send_connectionless_packet_now(void);
|
||||
|
||||
int l2cap_reserve_packet_buffer(void);
|
||||
void l2cap_release_packet_buffer(void);
|
||||
|
||||
// get outgoing buffer and prepare data
|
||||
uint8_t *l2cap_get_outgoing_buffer(void);
|
||||
|
Loading…
x
Reference in New Issue
Block a user