hci.c (8e97a820aab096281ef339c82d6fbbe83844482b) hci.c (182d886d4771c7888d4287bf742f80e8780f9ecb)
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 3677 unchanged lines hidden (view full) ---

3686 }
3687 conn->state = RECEIVED_CONNECTION_REQUEST;
3688 // store info about eSCO
3689 if (link_type == HCI_LINK_TYPE_ESCO){
3690 conn->remote_supported_features[0] |= 1;
3691 }
3692 // propagate remote supported sco packet packets from existing ACL to new SCO connection
3693 if (addr_type == BD_ADDR_TYPE_SCO){
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 3677 unchanged lines hidden (view full) ---

3686 }
3687 conn->state = RECEIVED_CONNECTION_REQUEST;
3688 // store info about eSCO
3689 if (link_type == HCI_LINK_TYPE_ESCO){
3690 conn->remote_supported_features[0] |= 1;
3691 }
3692 // propagate remote supported sco packet packets from existing ACL to new SCO connection
3693 if (addr_type == BD_ADDR_TYPE_SCO){
3694 hci_connection_t * acl_conn = hci_connection_for_bd_addr_and_type(addr, BD_ADDR_TYPE_ACL);
3695 btstack_assert(acl_conn != NULL);
3696 conn->remote_supported_sco_packets = acl_conn->remote_supported_sco_packets;
3694 const hci_connection_t * acl_conn = hci_connection_for_bd_addr_and_type(addr, BD_ADDR_TYPE_ACL);
3695 // ACL exists unless fuzzing
3696 if (acl_conn != NULL) {
3697 conn->remote_supported_sco_packets = acl_conn->remote_supported_sco_packets;
3698 }
3697 }
3698 hci_run();
3699 break;
3700
3701 case HCI_EVENT_CONNECTION_COMPLETE:
3702 // Connection management
3703 reverse_bd_addr(&packet[5], addr);
3704 log_info("Connection_complete (status=%u) %s", packet[2], bd_addr_to_str(addr));

--- 42 unchanged lines hidden (view full) ---

3747 }
3748 }
3749 break;
3750
3751 case HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE:
3752 reverse_bd_addr(&packet[5], addr);
3753 conn = hci_connection_for_bd_addr_and_type(addr, BD_ADDR_TYPE_SCO);
3754 log_info("Synchronous Connection Complete for %p (status=%u) %s", conn, packet[2], bd_addr_to_str(addr));
3699 }
3700 hci_run();
3701 break;
3702
3703 case HCI_EVENT_CONNECTION_COMPLETE:
3704 // Connection management
3705 reverse_bd_addr(&packet[5], addr);
3706 log_info("Connection_complete (status=%u) %s", packet[2], bd_addr_to_str(addr));

--- 42 unchanged lines hidden (view full) ---

3749 }
3750 }
3751 break;
3752
3753 case HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE:
3754 reverse_bd_addr(&packet[5], addr);
3755 conn = hci_connection_for_bd_addr_and_type(addr, BD_ADDR_TYPE_SCO);
3756 log_info("Synchronous Connection Complete for %p (status=%u) %s", conn, packet[2], bd_addr_to_str(addr));
3755 btstack_assert(conn != NULL);
3756
3757
3758 // SCO exists unless fuzzer
3759 if (conn == NULL) break;
3760
3757 if (packet[2] != ERROR_CODE_SUCCESS){
3758 // connection failed, remove entry
3759 hci_handle_connection_failed(conn, packet[2]);
3760 break;
3761 }
3762
3763 conn->state = OPEN;
3764 conn->con_handle = little_endian_read_16(packet, 3);

--- 6836 unchanged lines hidden ---
3761 if (packet[2] != ERROR_CODE_SUCCESS){
3762 // connection failed, remove entry
3763 hci_handle_connection_failed(conn, packet[2]);
3764 break;
3765 }
3766
3767 conn->state = OPEN;
3768 conn->con_handle = little_endian_read_16(packet, 3);

--- 6836 unchanged lines hidden ---