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