mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-29 04:20:20 +00:00
more use of hci_can_send_packet_now_using_packet_buffer
This commit is contained in:
parent
6950c29ff6
commit
64f0b431f7
4
ble/sm.c
4
ble/sm.c
@ -737,8 +737,8 @@ static void sm_pdu_received_in_wrong_state(){
|
||||
static void sm_run(void){
|
||||
|
||||
// assert that we can send either one
|
||||
if (!hci_can_send_packet_now(HCI_COMMAND_DATA_PACKET)) return;
|
||||
if (!hci_can_send_packet_now(HCI_ACL_DATA_PACKET)) return;
|
||||
if (!hci_can_send_packet_now_using_packet_buffer(HCI_COMMAND_DATA_PACKET)) return;
|
||||
if (!hci_can_send_packet_now_using_packet_buffer(HCI_ACL_DATA_PACKET)) return;
|
||||
|
||||
// distributed key generation
|
||||
switch (dkg_state){
|
||||
|
@ -200,8 +200,8 @@ static void sm_event_packet_handler (void * connection, uint8_t packet_type, uin
|
||||
static void sm_run(void){
|
||||
|
||||
// assert that we can send either one
|
||||
if (!hci_can_send_packet_now(HCI_COMMAND_DATA_PACKET)) return;
|
||||
if (!hci_can_send_packet_now(HCI_ACL_DATA_PACKET)) return;
|
||||
if (!hci_can_send_packet_now_using_packet_buffer(HCI_COMMAND_DATA_PACKET)) return;
|
||||
if (!hci_can_send_packet_now_using_packet_buffer(HCI_ACL_DATA_PACKET)) return;
|
||||
|
||||
switch (sm_state_responding){
|
||||
case SM_STATE_SEND_LTK_REQUESTED_NEGATIVE_REPLY:
|
||||
|
@ -120,7 +120,7 @@ static void gatt_client_run();
|
||||
|
||||
// START Helper Functions - to be sorted
|
||||
static int l2cap_can_send_conectionless_packet_now(){
|
||||
return hci_can_send_packet_now(HCI_ACL_DATA_PACKET);
|
||||
return hci_can_send_packet_now_using_packet_buffer(HCI_ACL_DATA_PACKET);
|
||||
}
|
||||
|
||||
static uint16_t l2cap_max_mtu_for_handle(uint16_t handle){
|
||||
@ -412,7 +412,7 @@ static void handle_peripheral_list(){
|
||||
if (get_peripheral_w4_connect_cancelled()) return;
|
||||
// printf("handle_peripheral_list 3\n");
|
||||
|
||||
if (!hci_can_send_packet_now(HCI_COMMAND_DATA_PACKET)) return;
|
||||
if (!hci_can_send_packet_now_using_packet_buffer(HCI_COMMAND_DATA_PACKET)) return;
|
||||
// printf("handle_peripheral_list 4\n");
|
||||
if (!l2cap_can_send_conectionless_packet_now()) return;
|
||||
// printf("handle_peripheral_list 5\n");
|
||||
@ -845,7 +845,7 @@ static void gatt_client_run(){
|
||||
handle_peripheral_list();
|
||||
|
||||
// check if command is send
|
||||
if (!hci_can_send_packet_now(HCI_COMMAND_DATA_PACKET)) return;
|
||||
if (!hci_can_send_packet_now_using_packet_buffer(HCI_COMMAND_DATA_PACKET)) return;
|
||||
if (!l2cap_can_send_conectionless_packet_now()) return;
|
||||
|
||||
switch(state){
|
||||
|
@ -467,7 +467,7 @@ static uint8_t gap_adv_type(){
|
||||
}
|
||||
|
||||
static void gap_run(){
|
||||
if (!hci_can_send_packet_now(HCI_COMMAND_DATA_PACKET)) return;
|
||||
if (!hci_can_send_packet_now_using_packet_buffer(HCI_COMMAND_DATA_PACKET)) return;
|
||||
|
||||
if (todos & DISABLE_ADVERTISEMENTS){
|
||||
todos &= ~DISABLE_ADVERTISEMENTS;
|
||||
|
@ -1298,7 +1298,7 @@ void hci_run(){
|
||||
hci_connection_t * connection;
|
||||
linked_item_t * it;
|
||||
|
||||
if (!hci_can_send_packet_now(HCI_COMMAND_DATA_PACKET)) return;
|
||||
if (!hci_can_send_packet_now_using_packet_buffer(HCI_COMMAND_DATA_PACKET)) return;
|
||||
|
||||
// global/non-connection oriented commands
|
||||
|
||||
@ -1553,7 +1553,7 @@ void hci_run(){
|
||||
if (connection){
|
||||
|
||||
// send disconnect
|
||||
if (!hci_can_send_packet_now(HCI_COMMAND_DATA_PACKET)) return;
|
||||
if (!hci_can_send_packet_now_using_packet_buffer(HCI_COMMAND_DATA_PACKET)) return;
|
||||
|
||||
log_info("HCI_STATE_HALTING, connection %p, handle %u\n", connection, (uint16_t)connection->con_handle);
|
||||
hci_send_cmd(&hci_disconnect, connection->con_handle, 0x13); // remote closed connection
|
||||
@ -1600,7 +1600,7 @@ void hci_run(){
|
||||
|
||||
if (hci_classic_supported()){
|
||||
// disable page and inquiry scan
|
||||
if (!hci_can_send_packet_now(HCI_COMMAND_DATA_PACKET)) return;
|
||||
if (!hci_can_send_packet_now_using_packet_buffer(HCI_COMMAND_DATA_PACKET)) return;
|
||||
|
||||
log_info("HCI_STATE_HALTING, disabling inq scans\n");
|
||||
hci_send_cmd(&hci_write_scan_enable, hci_stack->connectable << 1); // drop inquiry scan but keep page scan
|
||||
|
Loading…
x
Reference in New Issue
Block a user