mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-25 09:35:42 +00:00
use l2cap_can_send_fixed_channel_packet_now
This commit is contained in:
parent
6cd4da6bc4
commit
f9a298a27e
@ -256,7 +256,7 @@ static void att_run(void){
|
||||
// NOTE: fall through for regular commands
|
||||
|
||||
case ATT_SERVER_REQUEST_RECEIVED_AND_VALIDATED:
|
||||
if (!l2cap_can_send_connectionless_packet_now()) return;
|
||||
if (!l2cap_can_send_fixed_channel_packet_now(att_connection.con_handle)) return;
|
||||
|
||||
l2cap_reserve_packet_buffer();
|
||||
uint8_t * att_response_buffer = l2cap_get_outgoing_buffer();
|
||||
@ -337,11 +337,11 @@ void att_server_register_packet_handler(btstack_packet_handler_t handler){
|
||||
|
||||
int att_server_can_send(){
|
||||
if (att_connection.con_handle == 0) return 0;
|
||||
return l2cap_can_send_connectionless_packet_now();
|
||||
return l2cap_can_send_fixed_channel_packet_now(att_connection.con_handle);
|
||||
}
|
||||
|
||||
int att_server_notify(uint16_t handle, uint8_t *value, uint16_t value_len){
|
||||
if (!l2cap_can_send_connectionless_packet_now()) return BTSTACK_ACL_BUFFERS_FULL;
|
||||
if (!l2cap_can_send_fixed_channel_packet_now(att_connection.con_handle)) return BTSTACK_ACL_BUFFERS_FULL;
|
||||
|
||||
l2cap_reserve_packet_buffer();
|
||||
uint8_t * packet_buffer = l2cap_get_outgoing_buffer();
|
||||
@ -351,7 +351,7 @@ int att_server_notify(uint16_t handle, uint8_t *value, uint16_t value_len){
|
||||
|
||||
int att_server_indicate(uint16_t handle, uint8_t *value, uint16_t value_len){
|
||||
if (att_handle_value_indication_handle) return ATT_HANDLE_VALUE_INDICATION_IN_PORGRESS;
|
||||
if (!l2cap_can_send_connectionless_packet_now()) return BTSTACK_ACL_BUFFERS_FULL;
|
||||
if (!l2cap_can_send_fixed_channel_packet_now(att_connection.con_handle)) return BTSTACK_ACL_BUFFERS_FULL;
|
||||
|
||||
// track indication
|
||||
att_handle_value_indication_handle = handle;
|
||||
|
@ -574,11 +574,11 @@ gatt_client_t * get_gatt_client_context_for_handle(uint16_t handle){
|
||||
|
||||
static void gatt_client_run(){
|
||||
|
||||
if (!l2cap_can_send_connectionless_packet_now()) return;
|
||||
|
||||
linked_item_t *it;
|
||||
for (it = (linked_item_t *) gatt_client_connections; it ; it = it->next){
|
||||
|
||||
if (!l2cap_can_send_fixed_channel_packet_now(peripheral->handle)) return;
|
||||
|
||||
gatt_client_t * peripheral = (gatt_client_t *) it;
|
||||
// printf("- handle_peripheral_list, mtu state %u, client state %u\n", peripheral->mtu_state, peripheral->gatt_client_state);
|
||||
|
2
ble/sm.c
2
ble/sm.c
@ -857,7 +857,7 @@ static void sm_run(void){
|
||||
|
||||
// assert that we can send either one
|
||||
if (!hci_can_send_command_packet_now()) return;
|
||||
if (!l2cap_can_send_connectionless_packet_now()) return;
|
||||
if (!l2cap_can_send_fixed_channel_packet_now(connection->handle)) return;
|
||||
|
||||
sm_key_t plaintext;
|
||||
|
||||
|
@ -201,7 +201,7 @@ static void sm_run(void){
|
||||
|
||||
// assert that we can send either one
|
||||
if (!hci_can_send_command_packet_now()) return;
|
||||
if (!l2cap_can_send_connectionless_packet_now()) return;
|
||||
if (!l2cap_can_send_fixed_channel_packet_now(sm_response_handle)) return;
|
||||
|
||||
switch (sm_state_responding){
|
||||
case SM_STATE_SEND_LTK_REQUESTED_NEGATIVE_REPLY:
|
||||
|
Loading…
x
Reference in New Issue
Block a user