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 #pragma once 18 19 #include <base/functional/callback.h> 20 #include <gmock/gmock.h> 21 22 #include "bta_api.h" 23 #include "bta_dm_api.h" 24 25 namespace dm { 26 27 class BtaDmInterface { 28 public: 29 virtual void BTA_DmBleScan(bool start, uint8_t duration, 30 bool low_latency_scan) = 0; 31 virtual void BTA_DmBleCsisObserve(bool observe, 32 tBTA_DM_SEARCH_CBACK* p_results_cb) = 0; 33 virtual ~BtaDmInterface() = default; 34 }; 35 36 class MockBtaDmInterface : public BtaDmInterface { 37 public: 38 MOCK_METHOD((void), BTA_DmBleScan, 39 (bool start, uint8_t duration, bool low_latency_scan)); 40 MOCK_METHOD((void), BTA_DmBleCsisObserve, 41 (bool observe, tBTA_DM_SEARCH_CBACK* p_results_cb)); 42 }; 43 44 /** 45 * Set the {@link MockBtaDmInterface} for testing 46 * 47 * @param mock_bta_dm_interface pointer to mock bta dm interface, 48 * could be null 49 */ 50 void SetMockBtaDmInterface(MockBtaDmInterface* mock_bta_dm_interface); 51 52 } // namespace dm 53