1 /* 2 * Copyright 2022 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 <map> 18 #include <string> 19 20 #include "stack/include/btm_api_types.h" 21 #include "stack/include/btm_status.h" 22 #include "test/common/mock_functions.h" 23 #include "types/bt_transport.h" 24 #include "types/raw_address.h" 25 26 namespace test { 27 namespace mock { 28 namespace stack_btm_sec { 29 30 // Function state capture and return values, if needed 31 struct BTM_SetEncryption { 32 std::function<tBTM_STATUS(const RawAddress& bd_addr, tBT_TRANSPORT transport, 33 tBTM_SEC_CALLBACK* p_callback, void* p_ref_data, 34 tBTM_BLE_SEC_ACT sec_act)> 35 body{}; operatorBTM_SetEncryption36 tBTM_STATUS operator()(const RawAddress& bd_addr, tBT_TRANSPORT transport, 37 tBTM_SEC_CALLBACK* p_callback, void* p_ref_data, 38 tBTM_BLE_SEC_ACT sec_act) { 39 return body(bd_addr, transport, p_callback, p_ref_data, sec_act); 40 }; 41 }; 42 extern struct BTM_SetEncryption BTM_SetEncryption; 43 44 } // namespace stack_btm_sec 45 } // namespace mock 46 } // namespace test 47