xref: /btstack/src/btstack_memory.h (revision 2e97c1499bddf39c62914b277ea50009d9d455fe)
1*2e97c149S[email protected] 
2a3b02b71Smatthias.ringwald /*
3*2e97c149S[email protected]  * Copyright (C) 2009 by BlueKitchen GmbH
4a3b02b71Smatthias.ringwald  *
5a3b02b71Smatthias.ringwald  * Redistribution and use in source and binary forms, with or without
6a3b02b71Smatthias.ringwald  * modification, are permitted provided that the following conditions
7a3b02b71Smatthias.ringwald  * are met:
8a3b02b71Smatthias.ringwald  *
9a3b02b71Smatthias.ringwald  * 1. Redistributions of source code must retain the above copyright
10a3b02b71Smatthias.ringwald  *    notice, this list of conditions and the following disclaimer.
11a3b02b71Smatthias.ringwald  * 2. Redistributions in binary form must reproduce the above copyright
12a3b02b71Smatthias.ringwald  *    notice, this list of conditions and the following disclaimer in the
13a3b02b71Smatthias.ringwald  *    documentation and/or other materials provided with the distribution.
14a3b02b71Smatthias.ringwald  * 3. Neither the name of the copyright holders nor the names of
15a3b02b71Smatthias.ringwald  *    contributors may be used to endorse or promote products derived
16a3b02b71Smatthias.ringwald  *    from this software without specific prior written permission.
176b64433eSmatthias.ringwald  * 4. Any redistribution, use, or modification is done solely for
186b64433eSmatthias.ringwald  *    personal benefit and not for any commercial purpose or for
196b64433eSmatthias.ringwald  *    monetary gain.
20a3b02b71Smatthias.ringwald  *
21*2e97c149S[email protected]  * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS
22a3b02b71Smatthias.ringwald  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23a3b02b71Smatthias.ringwald  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24a3b02b71Smatthias.ringwald  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MATTHIAS
25a3b02b71Smatthias.ringwald  * RINGWALD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26a3b02b71Smatthias.ringwald  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27a3b02b71Smatthias.ringwald  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
28a3b02b71Smatthias.ringwald  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29a3b02b71Smatthias.ringwald  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30a3b02b71Smatthias.ringwald  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
31a3b02b71Smatthias.ringwald  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32a3b02b71Smatthias.ringwald  * SUCH DAMAGE.
33a3b02b71Smatthias.ringwald  *
34*2e97c149S[email protected]  * Please inquire about commercial licensing options at
35*2e97c149S[email protected]  * [email protected]
366b64433eSmatthias.ringwald  *
37a3b02b71Smatthias.ringwald  */
38a3b02b71Smatthias.ringwald 
39*2e97c149S[email protected] 
40*2e97c149S[email protected] 
41a3b02b71Smatthias.ringwald /*
42a3b02b71Smatthias.ringwald  *  btstsack_memory.h
43a3b02b71Smatthias.ringwald  *
44a3b02b71Smatthias.ringwald  *  @brief BTstack memory management via configurable memory pools
45a3b02b71Smatthias.ringwald  *
46a3b02b71Smatthias.ringwald  */
47a3b02b71Smatthias.ringwald 
48f471afd8S[email protected] #ifndef __BTSTACK_MEMORY_H
49f471afd8S[email protected] #define __BTSTACK_MEMORY_H
50a3b02b71Smatthias.ringwald 
51bc64ca62S[email protected] #if defined __cplusplus
52bc64ca62S[email protected] extern "C" {
53bc64ca62S[email protected] #endif
54bc64ca62S[email protected] 
55d0fdae3cS[email protected] #include "btstack-config.h"
56d0fdae3cS[email protected] 
576527a633S[email protected] #include "hci.h"
586527a633S[email protected] #include "l2cap.h"
596527a633S[email protected] #include "rfcomm.h"
60fdb398c2S[email protected] #include "bnep.h"
616527a633S[email protected] #include "remote_device_db.h"
626527a633S[email protected] 
63d0fdae3cS[email protected] #ifdef HAVE_BLE
64d0fdae3cS[email protected] #include "gatt_client.h"
65d0fdae3cS[email protected] #endif
66d0fdae3cS[email protected] 
67a3b02b71Smatthias.ringwald void btstack_memory_init(void);
68a3b02b71Smatthias.ringwald 
69*2e97c149S[email protected] // hci_connection
706527a633S[email protected] hci_connection_t * btstack_memory_hci_connection_get(void);
716527a633S[email protected] void   btstack_memory_hci_connection_free(hci_connection_t *hci_connection);
72fdb398c2S[email protected] 
73*2e97c149S[email protected] // l2cap_service, l2cap_channel
746527a633S[email protected] l2cap_service_t * btstack_memory_l2cap_service_get(void);
756527a633S[email protected] void   btstack_memory_l2cap_service_free(l2cap_service_t *l2cap_service);
766527a633S[email protected] l2cap_channel_t * btstack_memory_l2cap_channel_get(void);
776527a633S[email protected] void   btstack_memory_l2cap_channel_free(l2cap_channel_t *l2cap_channel);
78fdb398c2S[email protected] 
79*2e97c149S[email protected] // rfcomm_multiplexer, rfcomm_service, rfcomm_channel
806527a633S[email protected] rfcomm_multiplexer_t * btstack_memory_rfcomm_multiplexer_get(void);
816527a633S[email protected] void   btstack_memory_rfcomm_multiplexer_free(rfcomm_multiplexer_t *rfcomm_multiplexer);
826527a633S[email protected] rfcomm_service_t * btstack_memory_rfcomm_service_get(void);
836527a633S[email protected] void   btstack_memory_rfcomm_service_free(rfcomm_service_t *rfcomm_service);
846527a633S[email protected] rfcomm_channel_t * btstack_memory_rfcomm_channel_get(void);
856527a633S[email protected] void   btstack_memory_rfcomm_channel_free(rfcomm_channel_t *rfcomm_channel);
86fdb398c2S[email protected] 
87*2e97c149S[email protected] // db_mem_device_name, db_mem_device_link_key, db_mem_service
886527a633S[email protected] db_mem_device_name_t * btstack_memory_db_mem_device_name_get(void);
896527a633S[email protected] void   btstack_memory_db_mem_device_name_free(db_mem_device_name_t *db_mem_device_name);
906527a633S[email protected] db_mem_device_link_key_t * btstack_memory_db_mem_device_link_key_get(void);
916527a633S[email protected] void   btstack_memory_db_mem_device_link_key_free(db_mem_device_link_key_t *db_mem_device_link_key);
926527a633S[email protected] db_mem_service_t * btstack_memory_db_mem_service_get(void);
936527a633S[email protected] void   btstack_memory_db_mem_service_free(db_mem_service_t *db_mem_service);
94bc64ca62S[email protected] 
95*2e97c149S[email protected] // bnep_service, bnep_channel
96*2e97c149S[email protected] bnep_service_t * btstack_memory_bnep_service_get(void);
97*2e97c149S[email protected] void   btstack_memory_bnep_service_free(bnep_service_t *bnep_service);
98*2e97c149S[email protected] bnep_channel_t * btstack_memory_bnep_channel_get(void);
99*2e97c149S[email protected] void   btstack_memory_bnep_channel_free(bnep_channel_t *bnep_channel);
100*2e97c149S[email protected] 
101d0fdae3cS[email protected] #ifdef HAVE_BLE
102*2e97c149S[email protected] // gatt_client, gatt_subclient
103d0fdae3cS[email protected] gatt_client_t * btstack_memory_gatt_client_get(void);
104d0fdae3cS[email protected] void   btstack_memory_gatt_client_free(gatt_client_t *gatt_client);
105*2e97c149S[email protected] gatt_subclient_t * btstack_memory_gatt_subclient_get(void);
106*2e97c149S[email protected] void   btstack_memory_gatt_subclient_free(gatt_subclient_t *gatt_subclient);
107d0fdae3cS[email protected] #endif
108d0fdae3cS[email protected] 
109bc64ca62S[email protected] #if defined __cplusplus
110bc64ca62S[email protected] }
111bc64ca62S[email protected] #endif
112f471afd8S[email protected] 
113f471afd8S[email protected] #endif // __BTSTACK_MEMORY_H
114*2e97c149S[email protected] 
115