mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-29 13:20:39 +00:00
use HCI_ACL_PAYLOAD_SIZE to determine L2CAP MTU
This commit is contained in:
parent
edb8d076e0
commit
4ff786cfeb
@ -73,15 +73,11 @@ void l2cap_init(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint16_t l2cap_max_mtu(void){
|
uint16_t l2cap_max_mtu(void){
|
||||||
int classic_acl_length = hci_max_acl_data_packet_length();
|
return HCI_ACL_PAYLOAD_SIZE - L2CAP_HEADER_SIZE;
|
||||||
if (classic_acl_length == 0) return 0;
|
|
||||||
return classic_acl_length - L2CAP_HEADER_SIZE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t l2cap_max_le_mtu(){
|
uint16_t l2cap_max_le_mtu(){
|
||||||
int le_acl_length = hci_max_acl_le_data_packet_length();
|
return l2cap_max_mtu();
|
||||||
if (le_acl_length == 0) return 0;
|
|
||||||
return le_acl_length - L2CAP_HEADER_SIZE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Register L2CAP packet handlers */
|
/** Register L2CAP packet handlers */
|
||||||
|
@ -687,15 +687,11 @@ void l2cap_run(void){
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint16_t l2cap_max_mtu(void){
|
uint16_t l2cap_max_mtu(void){
|
||||||
int classic_acl_length = hci_max_acl_data_packet_length();
|
return HCI_ACL_PAYLOAD_SIZE - L2CAP_HEADER_SIZE;
|
||||||
if (classic_acl_length == 0) return 0;
|
|
||||||
return classic_acl_length - L2CAP_HEADER_SIZE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t l2cap_max_le_mtu(){
|
uint16_t l2cap_max_le_mtu(){
|
||||||
int le_acl_length = hci_max_acl_le_data_packet_length();
|
return l2cap_max_mtu();
|
||||||
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){
|
static void l2cap_handle_connection_complete(uint16_t handle, l2cap_channel_t * channel){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user