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( 39 void, OnModeChange, (ErrorCode status, Mode current_mode, uint16_t interval), (override)); 40 MOCK_METHOD( 41 void, 42 OnSniffSubrating, 43 (ErrorCode status, 44 uint16_t maximum_transmit_latency, 45 uint16_t maximum_receive_latency, 46 uint16_t minimum_remote_timeout, 47 uint16_t minimum_local_timeout), 48 (override)); 49 MOCK_METHOD( 50 void, 51 OnQosSetupComplete, 52 (ServiceType service_type, 53 uint32_t token_rate, 54 uint32_t peak_bandwidth, 55 uint32_t latency, 56 uint32_t delay_variation), 57 (override)); 58 MOCK_METHOD( 59 void, 60 OnFlowSpecificationComplete, 61 (FlowDirection flow_direction, 62 ServiceType service_type, 63 uint32_t token_rate, 64 uint32_t token_bucket_size, 65 uint32_t peak_bandwidth, 66 uint32_t access_latency), 67 (override)); 68 MOCK_METHOD(void, OnFlushOccurred, (), (override)); 69 MOCK_METHOD(void, OnRoleDiscoveryComplete, (Role current_role), (override)); 70 MOCK_METHOD(void, OnReadLinkPolicySettingsComplete, (uint16_t link_policy_settings), (override)); 71 MOCK_METHOD(void, OnReadAutomaticFlushTimeoutComplete, (uint16_t flush_timeout), (override)); 72 MOCK_METHOD(void, OnReadTransmitPowerLevelComplete, (uint8_t transmit_power_level), (override)); 73 MOCK_METHOD( 74 void, OnReadLinkSupervisionTimeoutComplete, (uint16_t link_supervision_timeout), (override)); 75 MOCK_METHOD( 76 void, OnReadFailedContactCounterComplete, (uint16_t failed_contact_counter), (override)); 77 MOCK_METHOD(void, OnReadLinkQualityComplete, (uint8_t link_quality), (override)); 78 MOCK_METHOD( 79 void, 80 OnReadAfhChannelMapComplete, 81 (AfhMode afh_mode, (std::array<uint8_t, 10>)afh_channel_map), 82 (override)); 83 MOCK_METHOD(void, OnReadRssiComplete, (uint8_t rssi), (override)); 84 MOCK_METHOD(void, OnReadClockComplete, (uint32_t clock, uint16_t accuracy), (override)); 85 MOCK_METHOD(void, OnCentralLinkKeyComplete, (KeyFlag flag), (override)); 86 MOCK_METHOD(void, OnRoleChange, (ErrorCode hci_status, Role new_role), (override)); 87 MOCK_METHOD(void, OnDisconnection, (ErrorCode reason), (override)); 88 MOCK_METHOD( 89 void, 90 OnReadRemoteVersionInformationComplete, 91 (ErrorCode hci_status, uint8_t lmp_version, uint16_t manufacturer_name, uint16_t sub_version), 92 (override)); 93 MOCK_METHOD(void, OnReadRemoteSupportedFeaturesComplete, (uint64_t features), (override)); 94 MOCK_METHOD( 95 void, 96 OnReadRemoteExtendedFeaturesComplete, 97 (uint8_t page_number, uint8_t max_page_number, uint64_t features), 98 (override)); 99 }; 100 101 } // namespace acl_manager 102 } // namespace hci 103 } // namespace bluetooth 104