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 #pragma once 18 19 #include <gmock/gmock.h> 20 21 #include "stack/eatt/eatt.h" 22 #include "types/raw_address.h" 23 24 using bluetooth::eatt::EattChannel; 25 using bluetooth::eatt::EattExtension; 26 27 class MockEattExtension : public EattExtension { 28 public: 29 MockEattExtension() = default; 30 MockEattExtension(const MockEattExtension&) = delete; 31 MockEattExtension& operator=(const MockEattExtension&) = delete; 32 33 ~MockEattExtension() override = default; 34 35 static MockEattExtension* GetInstance(); 36 37 MOCK_METHOD((void), Connect, (const RawAddress& bd_addr)); 38 MOCK_METHOD((void), Disconnect, (const RawAddress& bd_addr, uint16_t cid)); 39 MOCK_METHOD((void), Reconfigure, 40 (const RawAddress& bd_addr, uint16_t cid, uint16_t mtu)); 41 MOCK_METHOD((void), ReconfigureAll, 42 (const RawAddress& bd_addr, uint16_t mtu)); 43 44 MOCK_METHOD((bool), IsEattSupportedByPeer, (const RawAddress& bd_addr)); 45 MOCK_METHOD((EattChannel*), FindEattChannelByCid, 46 (const RawAddress& bd_addr, uint16_t cid)); 47 MOCK_METHOD((EattChannel*), FindEattChannelByTransId, 48 (const RawAddress& bd_addr, uint32_t trans_id)); 49 MOCK_METHOD((bool), IsIndicationPending, 50 (const RawAddress& bd_addr, uint16_t indication_handle)); 51 MOCK_METHOD((EattChannel*), GetChannelAvailableForIndication, 52 (const RawAddress& bd_addr)); 53 MOCK_METHOD((void), FreeGattResources, (const RawAddress& bd_addr)); 54 MOCK_METHOD((bool), IsOutstandingMsgInSendQueue, (const RawAddress& bd_addr)); 55 MOCK_METHOD((EattChannel*), GetChannelWithQueuedDataToSend, 56 (const RawAddress& bd_addr)); 57 MOCK_METHOD((EattChannel*), GetChannelAvailableForClientRequest, 58 (const RawAddress& bd_addr)); 59 MOCK_METHOD((void), StartIndicationConfirmationTimer, 60 (const RawAddress& bd_addr, uint16_t cid)); 61 MOCK_METHOD((void), StopIndicationConfirmationTimer, 62 (const RawAddress& bd_addr, uint16_t cid)); 63 64 MOCK_METHOD((void), StartAppIndicationTimer, 65 (const RawAddress& bd_addr, uint16_t cid)); 66 MOCK_METHOD((void), StopAppIndicationTimer, 67 (const RawAddress& bd_addr, uint16_t cid)); 68 69 MOCK_METHOD((void), Start, ()); 70 MOCK_METHOD((void), Stop, ()); 71 }; 72