1 /* 2 * Copyright 2021 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 18 #pragma once 19 20 #include <gmock/gmock.h> 21 22 #include "state_machine.h" 23 24 class MockLeAudioGroupStateMachine : public bluetooth::le_audio::LeAudioGroupStateMachine { 25 public: 26 MOCK_METHOD((bool), StartStream, 27 (bluetooth::le_audio::LeAudioDeviceGroup * group, 28 bluetooth::le_audio::types::LeAudioContextType context_type, 29 const bluetooth::le_audio::types::BidirectionalPair< 30 bluetooth::le_audio::types::AudioContexts>& metadata_context_types, 31 bluetooth::le_audio::types::BidirectionalPair<std::vector<uint8_t>> ccid_list), 32 (override)); 33 MOCK_METHOD((bool), AttachToStream, 34 (bluetooth::le_audio::LeAudioDeviceGroup * group, 35 bluetooth::le_audio::LeAudioDevice* leAudioDevice, 36 bluetooth::le_audio::types::BidirectionalPair<std::vector<uint8_t>> ccids), 37 (override)); 38 MOCK_METHOD((void), SuspendStream, (bluetooth::le_audio::LeAudioDeviceGroup * group), (override)); 39 MOCK_METHOD((bool), ConfigureStream, 40 (bluetooth::le_audio::LeAudioDeviceGroup * group, 41 bluetooth::le_audio::types::LeAudioContextType context_type, 42 const bluetooth::le_audio::types::BidirectionalPair< 43 bluetooth::le_audio::types::AudioContexts>& metadata_context_types, 44 bluetooth::le_audio::types::BidirectionalPair<std::vector<uint8_t>> ccid_lists, 45 bool configure_qos), 46 (override)); 47 MOCK_METHOD((void), StopStream, (bluetooth::le_audio::LeAudioDeviceGroup * group), (override)); 48 MOCK_METHOD((void), ProcessGattNotifEvent, 49 (uint8_t* value, uint16_t len, bluetooth::le_audio::types::ase* ase, 50 bluetooth::le_audio::LeAudioDevice* leAudioDevice, 51 bluetooth::le_audio::LeAudioDeviceGroup* group), 52 (override)); 53 MOCK_METHOD((void), ProcessGattCtpNotification, 54 (bluetooth::le_audio::LeAudioDeviceGroup * group, 55 bluetooth::le_audio::LeAudioDevice* leAudioDevice, uint8_t* value, uint16_t len), 56 (override)); 57 MOCK_METHOD((void), ProcessHciNotifOnCigCreate, 58 (bluetooth::le_audio::LeAudioDeviceGroup * group, uint8_t status, uint8_t cig_id, 59 std::vector<uint16_t> conn_handles), 60 (override)); 61 MOCK_METHOD((void), ProcessHciNotifOnCigRemove, 62 (uint8_t status, bluetooth::le_audio::LeAudioDeviceGroup* group), (override)); 63 MOCK_METHOD((void), ProcessHciNotifCisEstablished, 64 (bluetooth::le_audio::LeAudioDeviceGroup * group, 65 bluetooth::le_audio::LeAudioDevice* leAudioDevice, 66 const bluetooth::hci::iso_manager::cis_establish_cmpl_evt* event), 67 (override)); 68 MOCK_METHOD((void), ProcessHciNotifCisDisconnected, 69 (bluetooth::le_audio::LeAudioDeviceGroup * group, 70 bluetooth::le_audio::LeAudioDevice* leAudioDevice, 71 const bluetooth::hci::iso_manager::cis_disconnected_evt* event), 72 (override)); 73 MOCK_METHOD((void), ProcessHciNotifSetupIsoDataPath, 74 (bluetooth::le_audio::LeAudioDeviceGroup * group, 75 bluetooth::le_audio::LeAudioDevice* leAudioDevice, uint8_t status, 76 uint16_t conn_hdl), 77 (override)); 78 MOCK_METHOD((void), ProcessHciNotifRemoveIsoDataPath, 79 (bluetooth::le_audio::LeAudioDeviceGroup * group, 80 bluetooth::le_audio::LeAudioDevice* leAudioDevice, uint8_t status, 81 uint16_t conn_hdl), 82 (override)); 83 MOCK_METHOD((void), Initialize, 84 (bluetooth::le_audio::LeAudioGroupStateMachine::Callbacks * state_machine_callbacks)); 85 MOCK_METHOD((void), Cleanup, ()); 86 MOCK_METHOD((void), ProcessHciNotifIsoLinkQualityRead, 87 (bluetooth::le_audio::LeAudioDeviceGroup * group, 88 bluetooth::le_audio::LeAudioDevice* leAudioDevice, uint8_t conn_handle, 89 uint32_t txUnackedPackets, uint32_t txFlushedPackets, uint32_t txLastSubeventPackets, 90 uint32_t retransmittedPackets, uint32_t crcErrorPackets, 91 uint32_t rxUnreceivedPackets, uint32_t duplicatePackets), 92 (override)); 93 MOCK_METHOD((void), ProcessHciNotifAclDisconnected, 94 (bluetooth::le_audio::LeAudioDeviceGroup * group, 95 bluetooth::le_audio::LeAudioDevice* leAudioDevice), 96 (override)); 97 98 static void SetMockInstanceForTesting(MockLeAudioGroupStateMachine* machine); 99 }; 100