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 18 #pragma once 19 20 #include <cstdint> 21 22 #include "stack/include/hci_error_code.h" 23 #include "types/raw_address.h" 24 25 // This header contains functions for HCI-LinkManagement to invoke 26 27 extern bool l2c_link_hci_disc_comp(uint16_t handle, tHCI_REASON reason); 28 29 extern void l2c_link_role_changed(const RawAddress* bd_addr, uint8_t new_role, 30 uint8_t hci_status); 31 32 extern bool l2cble_conn_comp(uint16_t handle, uint8_t role, 33 const RawAddress& bda, tBLE_ADDR_TYPE type, 34 uint16_t conn_interval, uint16_t conn_latency, 35 uint16_t conn_timeout); 36 37 extern bool l2cble_conn_comp_from_address_with_type( 38 uint16_t handle, uint8_t role, const tBLE_BD_ADDR& address_with_type, 39 uint16_t conn_interval, uint16_t conn_latency, uint16_t conn_timeout); 40 41 extern void l2cble_process_conn_update_evt(uint16_t handle, uint8_t status, 42 uint16_t interval, uint16_t latency, 43 uint16_t timeout); 44 45 extern void l2cble_process_data_length_change_event(uint16_t handle, 46 uint16_t tx_data_len, 47 uint16_t rx_data_len); 48 49 // Notify to L2cap layer that ACL data or remote version is received 50 extern void l2cble_notify_le_connection(const RawAddress& bda); 51 52 void l2cble_use_preferred_conn_params(const RawAddress& bda); 53 54 extern void l2cble_process_rc_param_request_evt(uint16_t handle, 55 uint16_t int_min, 56 uint16_t int_max, 57 uint16_t latency, 58 uint16_t timeout); 59 60 // Invoked when HCI mode is changed to HCI_MODE_ACTIVE or HCI_MODE_SNIFF 61 extern void l2c_OnHciModeChangeSendPendingPackets(RawAddress remote); 62 63 // Invoked when HCI indicates to L2cap to check Security requirement 64 extern void l2cu_resubmit_pending_sec_req(const RawAddress* p_bda); 65