/* * Copyright 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include #include #include "common/contextual_callback.h" #include "hci/address.h" #include "hci/hci_interface.h" #include "hci/hci_packets.h" #include "hci/inquiry_interface.h" // Unit test interfaces namespace bluetooth { namespace hci { namespace testing { class MockHciLayer : public HciInterface { public: MOCK_METHOD(void, EnqueueCommand, (std::unique_ptr, common::ContextualOnceCallback), (override)); MOCK_METHOD(void, EnqueueCommand, (std::unique_ptr, common::ContextualOnceCallback), (override)); MOCK_METHOD(void, EnqueueCommand, (std::unique_ptr, common::ContextualOnceCallback), (override)); MOCK_METHOD((common::BidiQueueEnd*), GetAclQueueEnd, (), (override)); MOCK_METHOD((common::BidiQueueEnd*), GetScoQueueEnd, (), (override)); MOCK_METHOD((common::BidiQueueEnd*), GetIsoQueueEnd, (), (override)); MOCK_METHOD((void), RegisterEventHandler, (EventCode, common::ContextualCallback), (override)); MOCK_METHOD((void), UnregisterEventHandler, (EventCode), (override)); MOCK_METHOD((void), RegisterLeEventHandler, (SubeventCode, common::ContextualCallback), (override)); MOCK_METHOD((void), UnregisterLeEventHandler, (SubeventCode), (override)); MOCK_METHOD((void), RegisterVendorSpecificEventHandler, (VseSubeventCode, common::ContextualCallback), (override)); MOCK_METHOD((void), UnregisterVendorSpecificEventHandler, (VseSubeventCode), (override)); MOCK_METHOD((void), RegisterDefaultVendorSpecificEventHandler, (common::ContextualCallback), (override)); MOCK_METHOD((void), UnregisterDefaultVendorSpecificEventHandler, (), (override)); MOCK_METHOD((SecurityInterface*), GetSecurityInterface, (common::ContextualCallback event_handler), (override)); MOCK_METHOD((void), RegisterForDisconnects, (common::ContextualCallback on_disconnect)); MOCK_METHOD((LeSecurityInterface*), GetLeSecurityInterface, (common::ContextualCallback event_handler), (override)); MOCK_METHOD( (AclConnectionInterface*), GetAclConnectionInterface, (common::ContextualCallback event_handler, common::ContextualCallback on_disconnect, common::ContextualCallback on_connection_request, common::ContextualCallback on_read_remote_version_complete), (override)); MOCK_METHOD((void), PutAclConnectionInterface, (), (override)); MOCK_METHOD( (LeAclConnectionInterface*), GetLeAclConnectionInterface, (common::ContextualCallback event_handler, common::ContextualCallback on_disconnect, common::ContextualCallback on_read_remote_version_complete), (override)); MOCK_METHOD((void), PutLeAclConnectionInterface, (), (override)); MOCK_METHOD((LeAdvertisingInterface*), GetLeAdvertisingInterface, (common::ContextualCallback event_handler), (override)); MOCK_METHOD((LeScanningInterface*), GetLeScanningInterface, (common::ContextualCallback event_handler), (override)); MOCK_METHOD((LeIsoInterface*), GetLeIsoInterface, (common::ContextualCallback event_handler), (override)); MOCK_METHOD((DistanceMeasurementInterface*), GetDistanceMeasurementInterface, (common::ContextualCallback event_handler), (override)); MOCK_METHOD((std::unique_ptr), GetInquiryInterface, (common::ContextualCallback event_handler), (override)); MOCK_METHOD(void, RegisterForScoConnectionRequests, (common::ContextualCallback on_sco_connection_request)); }; } // namespace testing } // namespace hci } // namespace bluetooth