1 /*
2 * Copyright 2021 HIMSA II K/S - www.himsa.com.
3 * Represented by EHIMA - www.ehima.com
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18 #include "btm_api_mock.h"
19
20 static bluetooth::manager::MockBtmInterface* btm_interface = nullptr;
21
SetMockBtmInterface(MockBtmInterface * mock_btm_interface)22 void bluetooth::manager::SetMockBtmInterface(
23 MockBtmInterface* mock_btm_interface) {
24 btm_interface = mock_btm_interface;
25 }
26
BTM_GetSecurityFlagsByTransport(const RawAddress & bd_addr,uint8_t * p_sec_flags,tBT_TRANSPORT transport)27 bool BTM_GetSecurityFlagsByTransport(const RawAddress& bd_addr,
28 uint8_t* p_sec_flags,
29 tBT_TRANSPORT transport) {
30 return btm_interface->GetSecurityFlagsByTransport(bd_addr, p_sec_flags,
31 transport);
32 }
33
BTM_SetEncryption(const RawAddress & bd_addr,tBT_TRANSPORT transport,tBTM_SEC_CALLBACK * p_callback,void * p_ref_data,tBTM_BLE_SEC_ACT sec_act)34 tBTM_STATUS BTM_SetEncryption(const RawAddress& bd_addr,
35 tBT_TRANSPORT transport,
36 tBTM_SEC_CALLBACK* p_callback, void* p_ref_data,
37 tBTM_BLE_SEC_ACT sec_act) {
38 return btm_interface->SetEncryption(bd_addr, transport, p_callback,
39 p_ref_data, sec_act);
40 }
41