mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-22 15:40:16 +00:00
fix use of max mtu for att server
This commit is contained in:
parent
4d7288b3ec
commit
eb37a75f1d
@ -292,10 +292,11 @@ static uint16_t handle_exchange_mtu_request(att_connection_t * att_connection, u
|
||||
|
||||
uint16_t client_rx_mtu = READ_BT_16(request_buffer, 1);
|
||||
|
||||
if (client_rx_mtu < att_connection->mtu){
|
||||
// find min(local max mtu, remote mtu) and use as mtu for this connection
|
||||
if (client_rx_mtu < att_connection->max_mtu){
|
||||
att_connection->mtu = client_rx_mtu;
|
||||
} else {
|
||||
att_connection->mtu = att_connection->mtu;
|
||||
att_connection->mtu = att_connection->max_mtu;
|
||||
}
|
||||
|
||||
response_buffer[0] = ATT_EXCHANGE_MTU_RESPONSE;
|
||||
|
@ -155,6 +155,7 @@ extern "C" {
|
||||
typedef struct att_connection {
|
||||
uint16_t con_handle;
|
||||
uint16_t mtu;
|
||||
uint16_t max_mtu;
|
||||
uint8_t encryption_key_size;
|
||||
uint8_t authenticated;
|
||||
uint8_t authorized;
|
||||
|
@ -126,7 +126,8 @@ static void att_event_packet_handler (uint8_t packet_type, uint16_t channel, uin
|
||||
bt_flip_addr(att_client_address, &packet[8]);
|
||||
// reset connection properties
|
||||
att_connection.con_handle = READ_BT_16(packet, 4);
|
||||
att_connection.mtu = l2cap_max_mtu();
|
||||
att_connectino.mtu = ATT_DEFAULT_MTU;
|
||||
att_connection.max_mtu = l2cap_max_le_mtu();
|
||||
att_connection.encryption_key_size = 0;
|
||||
att_connection.authenticated = 0;
|
||||
att_connection.authorized = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user