mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-10 15:40:11 +00:00
use hci_acl_le_data_buffer_length to get max le l2cap mtu
This commit is contained in:
parent
6c26b08747
commit
eb7f386b26
@ -73,13 +73,15 @@ void l2cap_init(){
|
||||
}
|
||||
|
||||
uint16_t l2cap_max_mtu(void){
|
||||
int classic_acl_lenght = hci_max_acl_data_packet_length();
|
||||
if (classic_acl_lenght == 0) return 0;
|
||||
return hci_max_acl_data_packet_length() - L2CAP_HEADER_SIZE;
|
||||
int classic_acl_length = hci_max_acl_data_packet_length();
|
||||
if (classic_acl_length == 0) return 0;
|
||||
return classic_acl_length - L2CAP_HEADER_SIZE;
|
||||
}
|
||||
|
||||
uint16_t l2cap_max_le_mtu(){
|
||||
return L2CAP_LE_DEFAULT_MTU;
|
||||
int le_acl_length = hci_max_acl_le_data_packet_length();
|
||||
if (le_acl_length == 0) return 0;
|
||||
return le_acl_length - L2CAP_HEADER_SIZE;
|
||||
}
|
||||
|
||||
/** Register L2CAP packet handlers */
|
||||
|
13
src/l2cap.c
13
src/l2cap.c
@ -686,15 +686,16 @@ void l2cap_run(void){
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
uint16_t l2cap_max_mtu(void){
|
||||
int classic_acl_lenght = hci_max_acl_data_packet_length();
|
||||
if (classic_acl_lenght == 0) return 0;
|
||||
return hci_max_acl_data_packet_length() - L2CAP_HEADER_SIZE;
|
||||
int classic_acl_length = hci_max_acl_data_packet_length();
|
||||
if (classic_acl_length == 0) return 0;
|
||||
return classic_acl_length - L2CAP_HEADER_SIZE;
|
||||
}
|
||||
|
||||
uint16_t l2cap_max_le_mtu(void){
|
||||
return L2CAP_LE_DEFAULT_MTU;
|
||||
uint16_t l2cap_max_le_mtu(){
|
||||
int le_acl_length = hci_max_acl_le_data_packet_length();
|
||||
if (le_acl_length == 0) return 0;
|
||||
return le_acl_length - L2CAP_HEADER_SIZE;
|
||||
}
|
||||
|
||||
static void l2cap_handle_connection_complete(uint16_t handle, l2cap_channel_t * channel){
|
||||
|
Loading…
x
Reference in New Issue
Block a user