1 /* 2 * Copyright 2021 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 /* 18 * Generated mock file from original source file 19 * Functions generated:1 20 * 21 * mockcify.pl ver 0.2 22 */ 23 24 #include <map> 25 #include <string> 26 27 extern std::map<std::string, int> mock_function_count_map; 28 29 // Original included files, if any 30 // NOTE: Since this is a mock file with mock definitions some number of 31 // include files may not be required. The include-what-you-use 32 // still applies, but crafting proper inclusion is out of scope 33 // for this effort. This compilation unit may compile as-is, or 34 // may need attention to prune the inclusion set. 35 #include <base/logging.h> 36 #include "bt_types.h" 37 #include "btcore/include/event_mask.h" 38 #include "btcore/include/module.h" 39 #include "btcore/include/version.h" 40 #include "device/include/controller.h" 41 #include "hcimsgs.h" 42 #include "main/shim/controller.h" 43 #include "main/shim/shim.h" 44 #include "osi/include/future.h" 45 #include "osi/include/properties.h" 46 #include "stack/include/btm_ble_api.h" 47 48 // Mocked compile conditionals, if any 49 #ifndef UNUSED_ATTR 50 #define UNUSED_ATTR 51 #endif 52 53 namespace test { 54 namespace mock { 55 namespace device_controller { 56 57 constexpr size_t HCI_SUPPORTED_COMMANDS_ARRAY_SIZE = 64; 58 constexpr size_t MAX_FEATURES_CLASSIC_PAGE_COUNT = 3; 59 constexpr size_t BLE_SUPPORTED_STATES_SIZE = 8; 60 constexpr size_t MAX_LOCAL_SUPPORTED_CODECS_SIZE = 8; 61 62 // Shared state between mocked functions and tests 63 extern uint8_t supported_commands[HCI_SUPPORTED_COMMANDS_ARRAY_SIZE]; 64 extern bt_device_features_t features_classic[MAX_FEATURES_CLASSIC_PAGE_COUNT]; 65 extern uint8_t last_features_classic_page_index; 66 67 extern uint16_t acl_data_size_classic; 68 extern uint16_t acl_data_size_ble; 69 extern uint16_t iso_data_size; 70 71 extern uint16_t acl_buffer_count_classic; 72 extern uint8_t acl_buffer_count_ble; 73 extern uint8_t iso_buffer_count; 74 75 extern uint8_t ble_acceptlist_size; 76 extern uint8_t ble_resolving_list_max_size; 77 extern uint8_t ble_supported_states[BLE_SUPPORTED_STATES_SIZE]; 78 extern bt_device_features_t features_ble; 79 extern uint16_t ble_suggested_default_data_length; 80 extern uint16_t ble_supported_max_tx_octets; 81 extern uint16_t ble_supported_max_tx_time; 82 extern uint16_t ble_supported_max_rx_octets; 83 extern uint16_t ble_supported_max_rx_time; 84 85 extern uint16_t ble_maxium_advertising_data_length; 86 extern uint8_t ble_number_of_supported_advertising_sets; 87 extern uint8_t ble_periodic_advertiser_list_size; 88 extern uint8_t local_supported_codecs[MAX_LOCAL_SUPPORTED_CODECS_SIZE]; 89 extern uint8_t number_of_local_supported_codecs; 90 91 extern bool readable; 92 extern bool ble_supported; 93 extern bool iso_supported; 94 extern bool simple_pairing_supported; 95 extern bool secure_connections_supported; 96 97 } // namespace device_controller 98 } // namespace mock 99 } // namespace test 100 101 // END mockcify generation 102