1 /*
2  * Copyright 2023 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include <gmock/gmock.h>
20 
21 #include <array>
22 #include <cstdint>
23 
24 #include "hci/acl_manager/connection_management_callbacks.h"
25 #include "hci/hci_packets.h"
26 
27 namespace bluetooth {
28 namespace hci {
29 namespace acl_manager {
30 
31 class MockConnectionManagementCallbacks : public ConnectionManagementCallbacks {
32 public:
33   MOCK_METHOD(void, OnConnectionPacketTypeChanged, (uint16_t packet_type), (override));
34   MOCK_METHOD(void, OnAuthenticationComplete, (ErrorCode hci_status), (override));
35   MOCK_METHOD(void, OnEncryptionChange, (EncryptionEnabled enabled)), (override);
36   MOCK_METHOD(void, OnChangeConnectionLinkKeyComplete, (), (override));
37   MOCK_METHOD(void, OnReadClockOffsetComplete, (uint16_t clock_offse), (override));
38   MOCK_METHOD(void, OnModeChange, (ErrorCode status, Mode current_mode, uint16_t interval),
39               (override));
40   MOCK_METHOD(void, OnSniffSubrating,
41               (ErrorCode status, uint16_t maximum_transmit_latency,
42                uint16_t maximum_receive_latency, uint16_t minimum_remote_timeout,
43                uint16_t minimum_local_timeout),
44               (override));
45   MOCK_METHOD(void, OnQosSetupComplete,
46               (ServiceType service_type, uint32_t token_rate, uint32_t peak_bandwidth,
47                uint32_t latency, uint32_t delay_variation),
48               (override));
49   MOCK_METHOD(void, OnFlowSpecificationComplete,
50               (FlowDirection flow_direction, ServiceType service_type, uint32_t token_rate,
51                uint32_t token_bucket_size, uint32_t peak_bandwidth, uint32_t access_latency),
52               (override));
53   MOCK_METHOD(void, OnFlushOccurred, (), (override));
54   MOCK_METHOD(void, OnRoleDiscoveryComplete, (Role current_role), (override));
55   MOCK_METHOD(void, OnReadLinkPolicySettingsComplete, (uint16_t link_policy_settings), (override));
56   MOCK_METHOD(void, OnReadAutomaticFlushTimeoutComplete, (uint16_t flush_timeout), (override));
57   MOCK_METHOD(void, OnReadTransmitPowerLevelComplete, (uint8_t transmit_power_level), (override));
58   MOCK_METHOD(void, OnReadLinkSupervisionTimeoutComplete, (uint16_t link_supervision_timeout),
59               (override));
60   MOCK_METHOD(void, OnReadFailedContactCounterComplete, (uint16_t failed_contact_counter),
61               (override));
62   MOCK_METHOD(void, OnReadLinkQualityComplete, (uint8_t link_quality), (override));
63   MOCK_METHOD(void, OnReadAfhChannelMapComplete,
64               (AfhMode afh_mode, (std::array<uint8_t, 10>)afh_channel_map), (override));
65   MOCK_METHOD(void, OnReadRssiComplete, (uint8_t rssi), (override));
66   MOCK_METHOD(void, OnReadClockComplete, (uint32_t clock, uint16_t accuracy), (override));
67   MOCK_METHOD(void, OnCentralLinkKeyComplete, (KeyFlag flag), (override));
68   MOCK_METHOD(void, OnRoleChange, (ErrorCode hci_status, Role new_role), (override));
69   MOCK_METHOD(void, OnDisconnection, (ErrorCode reason), (override));
70   MOCK_METHOD(void, OnReadRemoteVersionInformationComplete,
71               (ErrorCode hci_status, uint8_t lmp_version, uint16_t manufacturer_name,
72                uint16_t sub_version),
73               (override));
74   MOCK_METHOD(void, OnReadRemoteSupportedFeaturesComplete, (uint64_t features), (override));
75   MOCK_METHOD(void, OnReadRemoteExtendedFeaturesComplete,
76               (uint8_t page_number, uint8_t max_page_number, uint64_t features), (override));
77 };
78 
79 }  // namespace acl_manager
80 }  // namespace hci
81 }  // namespace bluetooth
82