added hci_release_packet_buffer() and l2cap_release_packet_buffer()

This commit is contained in:
matthias.ringwald@gmail.com 2014-04-03 20:24:24 +00:00
parent facf93fdba
commit 68a0fcf7e2
5 changed files with 16 additions and 1 deletions

View File

@ -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()){

View File

@ -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;

View File

@ -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);

View File

@ -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()){

View File

@ -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);