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