1 /*
2 * Copyright 2020 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #include "main/shim/acl_legacy_interface.h"
18 #include "stack/include/acl_hci_link_interface.h"
19 #include "stack/include/ble_acl_interface.h"
20 #include "stack/include/sco_hci_link_interface.h"
21 #include "stack/include/sec_hci_link_interface.h"
22
23 struct tBTM_ESCO_DATA;
24
25 namespace bluetooth {
26 namespace shim {
27 namespace legacy {
28
GetAclInterface()29 const acl_interface_t GetAclInterface() {
30 acl_interface_t acl_interface{
31 .on_send_data_upwards = acl_rcv_acl_data,
32 .on_packets_completed = acl_packets_completed,
33
34 .connection.classic.on_connected = on_acl_br_edr_connected,
35 .connection.classic.on_failed = on_acl_br_edr_failed,
36 .connection.classic.on_disconnected = btm_acl_disconnected,
37
38 .connection.le.on_connected =
39 acl_ble_enhanced_connection_complete_from_shim,
40 .connection.le.on_failed = acl_ble_connection_fail,
41 .connection.le.on_disconnected = btm_acl_disconnected,
42
43 .connection.sco.on_esco_connect_request = btm_sco_on_esco_connect_request,
44 .connection.sco.on_sco_connect_request = btm_sco_on_sco_connect_request,
45 .connection.sco.on_disconnected = btm_sco_on_disconnected,
46
47 .link.classic.on_authentication_complete = btm_sec_auth_complete,
48 .link.classic.on_central_link_key_complete = nullptr,
49 .link.classic.on_change_connection_link_key_complete = nullptr,
50 .link.classic.on_encryption_change = nullptr,
51 .link.classic.on_flow_specification_complete = nullptr,
52 .link.classic.on_flush_occurred = nullptr,
53 .link.classic.on_mode_change = btm_pm_on_mode_change,
54 .link.classic.on_packet_type_changed = nullptr,
55 .link.classic.on_qos_setup_complete = nullptr,
56 .link.classic.on_read_afh_channel_map_complete = nullptr,
57 .link.classic.on_read_automatic_flush_timeout_complete = nullptr,
58 .link.classic.on_sniff_subrating = btm_pm_on_sniff_subrating,
59 .link.classic.on_read_clock_complete = nullptr,
60 .link.classic.on_read_clock_offset_complete = nullptr,
61 .link.classic.on_read_failed_contact_counter_complete = nullptr,
62 .link.classic.on_read_link_policy_settings_complete = nullptr,
63 .link.classic.on_read_link_quality_complete = nullptr,
64 .link.classic.on_read_link_supervision_timeout_complete = nullptr,
65 .link.classic.on_read_remote_version_information_complete =
66 btm_read_remote_version_complete,
67 .link.classic.on_read_remote_supported_features_complete =
68 acl_process_supported_features,
69 .link.classic.on_read_remote_extended_features_complete =
70 acl_process_extended_features,
71 .link.classic.on_read_rssi_complete = nullptr,
72 .link.classic.on_read_transmit_power_level_complete = nullptr,
73 .link.classic.on_role_change = btm_acl_role_changed,
74 .link.classic.on_role_discovery_complete = nullptr,
75
76 .link.le.on_connection_update = acl_ble_update_event_received,
77 .link.le.on_data_length_change = nullptr,
78 .link.le.on_read_remote_version_information_complete =
79 btm_read_remote_version_complete,
80 };
81 return acl_interface;
82 }
83
84 } // namespace legacy
85 } // namespace shim
86 } // namespace bluetooth
87