1 /* 2 * Copyright (C) 2009-2012 by Matthias Ringwald 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 3. Neither the name of the copyright holders nor the names of 14 * contributors may be used to endorse or promote products derived 15 * from this software without specific prior written permission. 16 * 4. Any redistribution, use, or modification is done solely for 17 * personal benefit and not for any commercial purpose or for 18 * monetary gain. 19 * 20 * THIS SOFTWARE IS PROVIDED BY MATTHIAS RINGWALD AND CONTRIBUTORS 21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MATTHIAS 24 * RINGWALD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 26 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 27 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 28 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 29 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 30 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * Please inquire about commercial licensing options at [email protected] 34 * 35 */ 36 37 /* 38 * btstsack_memory.h 39 * 40 * @brief BTstack memory management via configurable memory pools 41 * 42 */ 43 44 #ifndef __BTSTACK_MEMORY_H 45 #define __BTSTACK_MEMORY_H 46 47 #if defined __cplusplus 48 extern "C" { 49 #endif 50 51 #include "btstack-config.h" 52 53 #include "hci.h" 54 #include "l2cap.h" 55 #include "rfcomm.h" 56 #include "rfcomm.h" 57 #include "remote_device_db.h" 58 59 #ifdef HAVE_BLE 60 #include "gatt_client.h" 61 #endif 62 63 void btstack_memory_init(void); 64 65 hci_connection_t * btstack_memory_hci_connection_get(void); 66 void btstack_memory_hci_connection_free(hci_connection_t *hci_connection); 67 l2cap_service_t * btstack_memory_l2cap_service_get(void); 68 void btstack_memory_l2cap_service_free(l2cap_service_t *l2cap_service); 69 l2cap_channel_t * btstack_memory_l2cap_channel_get(void); 70 void btstack_memory_l2cap_channel_free(l2cap_channel_t *l2cap_channel); 71 rfcomm_multiplexer_t * btstack_memory_rfcomm_multiplexer_get(void); 72 void btstack_memory_rfcomm_multiplexer_free(rfcomm_multiplexer_t *rfcomm_multiplexer); 73 rfcomm_service_t * btstack_memory_rfcomm_service_get(void); 74 void btstack_memory_rfcomm_service_free(rfcomm_service_t *rfcomm_service); 75 rfcomm_channel_t * btstack_memory_rfcomm_channel_get(void); 76 void btstack_memory_rfcomm_channel_free(rfcomm_channel_t *rfcomm_channel); 77 db_mem_device_name_t * btstack_memory_db_mem_device_name_get(void); 78 void btstack_memory_db_mem_device_name_free(db_mem_device_name_t *db_mem_device_name); 79 db_mem_device_link_key_t * btstack_memory_db_mem_device_link_key_get(void); 80 void btstack_memory_db_mem_device_link_key_free(db_mem_device_link_key_t *db_mem_device_link_key); 81 db_mem_service_t * btstack_memory_db_mem_service_get(void); 82 void btstack_memory_db_mem_service_free(db_mem_service_t *db_mem_service); 83 84 #ifdef HAVE_BLE 85 gatt_client_t * btstack_memory_gatt_client_get(void); 86 void btstack_memory_gatt_client_free(gatt_client_t *gatt_client); 87 #endif 88 89 #if defined __cplusplus 90 } 91 #endif 92 93 #endif // __BTSTACK_MEMORY_H 94