1 /*
2  * Copyright 2020 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 "mock_gatt_layer.h"
19 
20 #include "types/raw_address.h"
21 
22 static bluetooth::gatt::MockGattInterface* gatt_interface = nullptr;
23 
SetMockGattInterface(MockGattInterface * mock_gatt_interface)24 void bluetooth::gatt::SetMockGattInterface(
25     MockGattInterface* mock_gatt_interface) {
26   gatt_interface = mock_gatt_interface;
27 }
28 
gatt_profile_get_eatt_support(const RawAddress & peer_bda)29 bool gatt_profile_get_eatt_support(const RawAddress& peer_bda) {
30   return gatt_interface->GetEattSupport(peer_bda);
31 }
32 
gatt_cl_init_sr_status(tGATT_TCB & tcb)33 void gatt_cl_init_sr_status(tGATT_TCB& tcb) {
34   return gatt_interface->ClientInitServerStatus(tcb);
35 }
36 
gatt_cl_read_sr_supp_feat_req(const RawAddress & peer_bda,base::OnceCallback<void (const RawAddress &,uint8_t)> cb)37 bool gatt_cl_read_sr_supp_feat_req(
38     const RawAddress& peer_bda,
39     base::OnceCallback<void(const RawAddress&, uint8_t)> cb) {
40   return gatt_interface->ClientReadSupportedFeatures(peer_bda, std::move(cb));
41 }
42