2011-07-24 08:51:17 +00:00
/*
2015-02-06 16:19:27 +00:00
* Copyright ( C ) 2014 BlueKitchen GmbH
2011-07-24 08:51:17 +00:00
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions
* are met :
*
* 1. Redistributions of source code must retain the above copyright
* notice , this list of conditions and the following disclaimer .
* 2. Redistributions in binary form must reproduce the above copyright
* notice , this list of conditions and the following disclaimer in the
* documentation and / or other materials provided with the distribution .
* 3. Neither the name of the copyright holders nor the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission .
2012-05-07 21:54:09 +00:00
* 4. Any redistribution , use , or modification is done solely for
* personal benefit and not for any commercial purpose or for
* monetary gain .
2011-07-24 08:51:17 +00:00
*
2014-10-31 11:42:29 +00:00
* THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS
2011-07-24 08:51:17 +00:00
* ` ` AS IS ' ' AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
* LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL MATTHIAS
* RINGWALD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT ,
* INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING ,
* BUT NOT LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS
* OF USE , DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY ,
* OR TORT ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF
* THE USE OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE .
*
2014-10-31 11:42:29 +00:00
* Please inquire about commercial licensing options at
* contact @ bluekitchen - gmbh . com
2012-05-07 21:54:09 +00:00
*
2011-07-24 08:51:17 +00:00
*/
2017-03-24 23:39:20 +01:00
# define __BTSTACK_FILE__ "btstack_memory.c"
2014-10-31 11:42:29 +00:00
2011-07-24 08:51:17 +00:00
/*
2016-02-02 21:57:10 +01:00
* btstack_memory . h
2011-07-24 08:51:17 +00:00
*
* @ brief BTstack memory management via configurable memory pools
*
2016-02-02 21:57:10 +01:00
* @ note code generated by tool / btstack_memory_generator . py
2011-07-24 08:51:17 +00:00
*
*/
# include "btstack_memory.h"
2016-01-20 14:56:28 +01:00
# include "btstack_memory_pool.h"
2011-07-24 08:51:17 +00:00
# include <stdlib.h>
2014-10-31 11:42:29 +00:00
2011-07-24 08:51:17 +00:00
// MARK: hci_connection_t
2016-03-28 12:05:33 +02:00
# if !defined(HAVE_MALLOC) && !defined(MAX_NR_HCI_CONNECTIONS)
# if defined(MAX_NO_HCI_CONNECTIONS)
2016-09-26 22:43:53 +02:00
# error "Deprecated MAX_NO_HCI_CONNECTIONS defined instead of MAX_NR_HCI_CONNECTIONS. Please update your btstack_config.h to use MAX_NR_HCI_CONNECTIONS."
2016-03-28 12:05:33 +02:00
# else
# define MAX_NR_HCI_CONNECTIONS 0
# endif
# endif
# ifdef MAX_NR_HCI_CONNECTIONS
# if MAX_NR_HCI_CONNECTIONS > 0
static hci_connection_t hci_connection_storage [ MAX_NR_HCI_CONNECTIONS ] ;
2016-01-20 14:59:38 +01:00
static btstack_memory_pool_t hci_connection_pool ;
2014-09-04 20:19:38 +00:00
hci_connection_t * btstack_memory_hci_connection_get ( void ) {
2016-01-20 14:59:38 +01:00
return ( hci_connection_t * ) btstack_memory_pool_get ( & hci_connection_pool ) ;
2011-07-24 08:51:17 +00:00
}
2014-09-04 20:19:38 +00:00
void btstack_memory_hci_connection_free ( hci_connection_t * hci_connection ) {
2016-01-20 14:59:38 +01:00
btstack_memory_pool_free ( & hci_connection_pool , hci_connection ) ;
2011-07-24 08:51:17 +00:00
}
2012-05-21 18:24:37 +00:00
# else
2014-09-04 20:19:38 +00:00
hci_connection_t * btstack_memory_hci_connection_get ( void ) {
2012-05-21 18:24:37 +00:00
return NULL ;
}
2014-09-04 20:19:38 +00:00
void btstack_memory_hci_connection_free ( hci_connection_t * hci_connection ) {
2014-09-29 19:53:42 +00:00
// silence compiler warning about unused parameter in a portable way
2014-10-31 11:42:29 +00:00
( void ) hci_connection ;
2012-05-21 18:24:37 +00:00
} ;
# endif
2011-07-24 08:51:17 +00:00
# elif defined(HAVE_MALLOC)
2014-09-04 20:19:38 +00:00
hci_connection_t * btstack_memory_hci_connection_get ( void ) {
return ( hci_connection_t * ) malloc ( sizeof ( hci_connection_t ) ) ;
2011-07-24 08:51:17 +00:00
}
2014-09-04 20:19:38 +00:00
void btstack_memory_hci_connection_free ( hci_connection_t * hci_connection ) {
2011-07-24 08:51:17 +00:00
free ( hci_connection ) ;
}
# endif
2014-10-31 11:42:29 +00:00
2011-07-24 08:51:17 +00:00
// MARK: l2cap_service_t
2016-03-28 12:05:33 +02:00
# if !defined(HAVE_MALLOC) && !defined(MAX_NR_L2CAP_SERVICES)
# if defined(MAX_NO_L2CAP_SERVICES)
2016-09-26 22:43:53 +02:00
# error "Deprecated MAX_NO_L2CAP_SERVICES defined instead of MAX_NR_L2CAP_SERVICES. Please update your btstack_config.h to use MAX_NR_L2CAP_SERVICES."
2016-03-28 12:05:33 +02:00
# else
# define MAX_NR_L2CAP_SERVICES 0
# endif
# endif
# ifdef MAX_NR_L2CAP_SERVICES
# if MAX_NR_L2CAP_SERVICES > 0
static l2cap_service_t l2cap_service_storage [ MAX_NR_L2CAP_SERVICES ] ;
2016-01-20 14:59:38 +01:00
static btstack_memory_pool_t l2cap_service_pool ;
2014-09-04 20:19:38 +00:00
l2cap_service_t * btstack_memory_l2cap_service_get ( void ) {
2016-01-20 14:59:38 +01:00
return ( l2cap_service_t * ) btstack_memory_pool_get ( & l2cap_service_pool ) ;
2011-07-24 08:51:17 +00:00
}
2014-09-04 20:19:38 +00:00
void btstack_memory_l2cap_service_free ( l2cap_service_t * l2cap_service ) {
2016-01-20 14:59:38 +01:00
btstack_memory_pool_free ( & l2cap_service_pool , l2cap_service ) ;
2011-07-24 08:51:17 +00:00
}
2012-05-21 18:24:37 +00:00
# else
2014-09-04 20:19:38 +00:00
l2cap_service_t * btstack_memory_l2cap_service_get ( void ) {
2012-05-21 18:24:37 +00:00
return NULL ;
}
2014-09-04 20:19:38 +00:00
void btstack_memory_l2cap_service_free ( l2cap_service_t * l2cap_service ) {
2014-09-29 19:53:42 +00:00
// silence compiler warning about unused parameter in a portable way
2014-10-31 11:42:29 +00:00
( void ) l2cap_service ;
2012-05-21 18:24:37 +00:00
} ;
# endif
2011-07-24 08:51:17 +00:00
# elif defined(HAVE_MALLOC)
2014-09-04 20:19:38 +00:00
l2cap_service_t * btstack_memory_l2cap_service_get ( void ) {
return ( l2cap_service_t * ) malloc ( sizeof ( l2cap_service_t ) ) ;
2011-07-24 08:51:17 +00:00
}
2014-09-04 20:19:38 +00:00
void btstack_memory_l2cap_service_free ( l2cap_service_t * l2cap_service ) {
2011-07-24 08:51:17 +00:00
free ( l2cap_service ) ;
}
# endif
// MARK: l2cap_channel_t
2016-03-28 12:05:33 +02:00
# if !defined(HAVE_MALLOC) && !defined(MAX_NR_L2CAP_CHANNELS)
# if defined(MAX_NO_L2CAP_CHANNELS)
2016-09-26 22:43:53 +02:00
# error "Deprecated MAX_NO_L2CAP_CHANNELS defined instead of MAX_NR_L2CAP_CHANNELS. Please update your btstack_config.h to use MAX_NR_L2CAP_CHANNELS."
2016-03-28 12:05:33 +02:00
# else
# define MAX_NR_L2CAP_CHANNELS 0
# endif
# endif
# ifdef MAX_NR_L2CAP_CHANNELS
# if MAX_NR_L2CAP_CHANNELS > 0
static l2cap_channel_t l2cap_channel_storage [ MAX_NR_L2CAP_CHANNELS ] ;
2016-01-20 14:59:38 +01:00
static btstack_memory_pool_t l2cap_channel_pool ;
2014-09-04 20:19:38 +00:00
l2cap_channel_t * btstack_memory_l2cap_channel_get ( void ) {
2016-01-20 14:59:38 +01:00
return ( l2cap_channel_t * ) btstack_memory_pool_get ( & l2cap_channel_pool ) ;
2011-07-24 08:51:17 +00:00
}
2014-09-04 20:19:38 +00:00
void btstack_memory_l2cap_channel_free ( l2cap_channel_t * l2cap_channel ) {
2016-01-20 14:59:38 +01:00
btstack_memory_pool_free ( & l2cap_channel_pool , l2cap_channel ) ;
2011-07-24 08:51:17 +00:00
}
2012-05-21 18:24:37 +00:00
# else
2014-09-04 20:19:38 +00:00
l2cap_channel_t * btstack_memory_l2cap_channel_get ( void ) {
2012-05-21 18:24:37 +00:00
return NULL ;
}
2014-09-04 20:19:38 +00:00
void btstack_memory_l2cap_channel_free ( l2cap_channel_t * l2cap_channel ) {
2014-09-29 19:53:42 +00:00
// silence compiler warning about unused parameter in a portable way
2014-10-31 11:42:29 +00:00
( void ) l2cap_channel ;
2012-05-21 18:24:37 +00:00
} ;
# endif
2011-07-24 08:51:17 +00:00
# elif defined(HAVE_MALLOC)
2014-09-04 20:19:38 +00:00
l2cap_channel_t * btstack_memory_l2cap_channel_get ( void ) {
return ( l2cap_channel_t * ) malloc ( sizeof ( l2cap_channel_t ) ) ;
2011-07-24 08:51:17 +00:00
}
2014-09-04 20:19:38 +00:00
void btstack_memory_l2cap_channel_free ( l2cap_channel_t * l2cap_channel ) {
2011-07-24 08:51:17 +00:00
free ( l2cap_channel ) ;
}
# endif
2014-10-31 11:42:29 +00:00
2011-07-24 08:51:17 +00:00
// MARK: rfcomm_multiplexer_t
2016-03-28 12:05:33 +02:00
# if !defined(HAVE_MALLOC) && !defined(MAX_NR_RFCOMM_MULTIPLEXERS)
# if defined(MAX_NO_RFCOMM_MULTIPLEXERS)
2016-09-26 22:43:53 +02:00
# error "Deprecated MAX_NO_RFCOMM_MULTIPLEXERS defined instead of MAX_NR_RFCOMM_MULTIPLEXERS. Please update your btstack_config.h to use MAX_NR_RFCOMM_MULTIPLEXERS."
2016-03-28 12:05:33 +02:00
# else
# define MAX_NR_RFCOMM_MULTIPLEXERS 0
# endif
# endif
# ifdef MAX_NR_RFCOMM_MULTIPLEXERS
# if MAX_NR_RFCOMM_MULTIPLEXERS > 0
static rfcomm_multiplexer_t rfcomm_multiplexer_storage [ MAX_NR_RFCOMM_MULTIPLEXERS ] ;
2016-01-20 14:59:38 +01:00
static btstack_memory_pool_t rfcomm_multiplexer_pool ;
2014-09-04 20:19:38 +00:00
rfcomm_multiplexer_t * btstack_memory_rfcomm_multiplexer_get ( void ) {
2016-01-20 14:59:38 +01:00
return ( rfcomm_multiplexer_t * ) btstack_memory_pool_get ( & rfcomm_multiplexer_pool ) ;
2011-07-24 08:51:17 +00:00
}
2014-09-04 20:19:38 +00:00
void btstack_memory_rfcomm_multiplexer_free ( rfcomm_multiplexer_t * rfcomm_multiplexer ) {
2016-01-20 14:59:38 +01:00
btstack_memory_pool_free ( & rfcomm_multiplexer_pool , rfcomm_multiplexer ) ;
2011-07-24 08:51:17 +00:00
}
2012-05-21 18:24:37 +00:00
# else
2014-09-04 20:19:38 +00:00
rfcomm_multiplexer_t * btstack_memory_rfcomm_multiplexer_get ( void ) {
2012-05-21 18:24:37 +00:00
return NULL ;
}
2014-09-04 20:19:38 +00:00
void btstack_memory_rfcomm_multiplexer_free ( rfcomm_multiplexer_t * rfcomm_multiplexer ) {
2014-09-29 19:53:42 +00:00
// silence compiler warning about unused parameter in a portable way
( void ) rfcomm_multiplexer ;
2012-05-21 18:24:37 +00:00
} ;
# endif
2011-07-24 08:51:17 +00:00
# elif defined(HAVE_MALLOC)
2014-09-04 20:19:38 +00:00
rfcomm_multiplexer_t * btstack_memory_rfcomm_multiplexer_get ( void ) {
return ( rfcomm_multiplexer_t * ) malloc ( sizeof ( rfcomm_multiplexer_t ) ) ;
2011-07-24 08:51:17 +00:00
}
2014-09-04 20:19:38 +00:00
void btstack_memory_rfcomm_multiplexer_free ( rfcomm_multiplexer_t * rfcomm_multiplexer ) {
2011-07-24 08:51:17 +00:00
free ( rfcomm_multiplexer ) ;
}
# endif
// MARK: rfcomm_service_t
2016-03-28 12:05:33 +02:00
# if !defined(HAVE_MALLOC) && !defined(MAX_NR_RFCOMM_SERVICES)
# if defined(MAX_NO_RFCOMM_SERVICES)
2016-09-26 22:43:53 +02:00
# error "Deprecated MAX_NO_RFCOMM_SERVICES defined instead of MAX_NR_RFCOMM_SERVICES. Please update your btstack_config.h to use MAX_NR_RFCOMM_SERVICES."
2016-03-28 12:05:33 +02:00
# else
# define MAX_NR_RFCOMM_SERVICES 0
# endif
# endif
# ifdef MAX_NR_RFCOMM_SERVICES
# if MAX_NR_RFCOMM_SERVICES > 0
static rfcomm_service_t rfcomm_service_storage [ MAX_NR_RFCOMM_SERVICES ] ;
2016-01-20 14:59:38 +01:00
static btstack_memory_pool_t rfcomm_service_pool ;
2014-09-04 20:19:38 +00:00
rfcomm_service_t * btstack_memory_rfcomm_service_get ( void ) {
2016-01-20 14:59:38 +01:00
return ( rfcomm_service_t * ) btstack_memory_pool_get ( & rfcomm_service_pool ) ;
2011-07-24 08:51:17 +00:00
}
2014-09-04 20:19:38 +00:00
void btstack_memory_rfcomm_service_free ( rfcomm_service_t * rfcomm_service ) {
2016-01-20 14:59:38 +01:00
btstack_memory_pool_free ( & rfcomm_service_pool , rfcomm_service ) ;
2011-07-24 08:51:17 +00:00
}
2012-05-21 18:24:37 +00:00
# else
2014-09-04 20:19:38 +00:00
rfcomm_service_t * btstack_memory_rfcomm_service_get ( void ) {
2012-05-21 18:24:37 +00:00
return NULL ;
}
2014-09-04 20:19:38 +00:00
void btstack_memory_rfcomm_service_free ( rfcomm_service_t * rfcomm_service ) {
2014-09-29 19:53:42 +00:00
// silence compiler warning about unused parameter in a portable way
( void ) rfcomm_service ;
2012-05-21 18:24:37 +00:00
} ;
# endif
2011-07-24 08:51:17 +00:00
# elif defined(HAVE_MALLOC)
2014-09-04 20:19:38 +00:00
rfcomm_service_t * btstack_memory_rfcomm_service_get ( void ) {
return ( rfcomm_service_t * ) malloc ( sizeof ( rfcomm_service_t ) ) ;
2011-07-24 08:51:17 +00:00
}
2014-09-04 20:19:38 +00:00
void btstack_memory_rfcomm_service_free ( rfcomm_service_t * rfcomm_service ) {
2011-07-24 08:51:17 +00:00
free ( rfcomm_service ) ;
}
# endif
// MARK: rfcomm_channel_t
2016-03-28 12:05:33 +02:00
# if !defined(HAVE_MALLOC) && !defined(MAX_NR_RFCOMM_CHANNELS)
# if defined(MAX_NO_RFCOMM_CHANNELS)
2016-09-26 22:43:53 +02:00
# error "Deprecated MAX_NO_RFCOMM_CHANNELS defined instead of MAX_NR_RFCOMM_CHANNELS. Please update your btstack_config.h to use MAX_NR_RFCOMM_CHANNELS."
2016-03-28 12:05:33 +02:00
# else
# define MAX_NR_RFCOMM_CHANNELS 0
# endif
# endif
# ifdef MAX_NR_RFCOMM_CHANNELS
# if MAX_NR_RFCOMM_CHANNELS > 0
static rfcomm_channel_t rfcomm_channel_storage [ MAX_NR_RFCOMM_CHANNELS ] ;
2016-01-20 14:59:38 +01:00
static btstack_memory_pool_t rfcomm_channel_pool ;
2014-09-04 20:19:38 +00:00
rfcomm_channel_t * btstack_memory_rfcomm_channel_get ( void ) {
2016-01-20 14:59:38 +01:00
return ( rfcomm_channel_t * ) btstack_memory_pool_get ( & rfcomm_channel_pool ) ;
2011-07-24 08:51:17 +00:00
}
2014-09-04 20:19:38 +00:00
void btstack_memory_rfcomm_channel_free ( rfcomm_channel_t * rfcomm_channel ) {
2016-01-20 14:59:38 +01:00
btstack_memory_pool_free ( & rfcomm_channel_pool , rfcomm_channel ) ;
2011-07-24 08:51:17 +00:00
}
2012-05-21 18:24:37 +00:00
# else
2014-09-04 20:19:38 +00:00
rfcomm_channel_t * btstack_memory_rfcomm_channel_get ( void ) {
2012-05-21 18:24:37 +00:00
return NULL ;
}
2014-09-04 20:19:38 +00:00
void btstack_memory_rfcomm_channel_free ( rfcomm_channel_t * rfcomm_channel ) {
2014-09-29 19:53:42 +00:00
// silence compiler warning about unused parameter in a portable way
( void ) rfcomm_channel ;
2012-05-21 18:24:37 +00:00
} ;
# endif
2011-07-24 08:51:17 +00:00
# elif defined(HAVE_MALLOC)
2014-09-04 20:19:38 +00:00
rfcomm_channel_t * btstack_memory_rfcomm_channel_get ( void ) {
return ( rfcomm_channel_t * ) malloc ( sizeof ( rfcomm_channel_t ) ) ;
2011-07-24 08:51:17 +00:00
}
2014-09-04 20:19:38 +00:00
void btstack_memory_rfcomm_channel_free ( rfcomm_channel_t * rfcomm_channel ) {
2011-07-24 08:51:17 +00:00
free ( rfcomm_channel ) ;
}
# endif
2014-10-08 13:21:55 +00:00
2011-08-26 22:14:31 +00:00
2016-03-27 23:10:54 +02:00
// MARK: btstack_link_key_db_memory_entry_t
2016-03-28 12:05:33 +02:00
# if !defined(HAVE_MALLOC) && !defined(MAX_NR_BTSTACK_LINK_KEY_DB_MEMORY_ENTRIES)
# if defined(MAX_NO_BTSTACK_LINK_KEY_DB_MEMORY_ENTRIES)
2016-09-26 22:43:53 +02:00
# error "Deprecated MAX_NO_BTSTACK_LINK_KEY_DB_MEMORY_ENTRIES defined instead of MAX_NR_BTSTACK_LINK_KEY_DB_MEMORY_ENTRIES. Please update your btstack_config.h to use MAX_NR_BTSTACK_LINK_KEY_DB_MEMORY_ENTRIES."
2016-03-28 12:05:33 +02:00
# else
# define MAX_NR_BTSTACK_LINK_KEY_DB_MEMORY_ENTRIES 0
# endif
# endif
# ifdef MAX_NR_BTSTACK_LINK_KEY_DB_MEMORY_ENTRIES
# if MAX_NR_BTSTACK_LINK_KEY_DB_MEMORY_ENTRIES > 0
static btstack_link_key_db_memory_entry_t btstack_link_key_db_memory_entry_storage [ MAX_NR_BTSTACK_LINK_KEY_DB_MEMORY_ENTRIES ] ;
2016-03-27 23:10:54 +02:00
static btstack_memory_pool_t btstack_link_key_db_memory_entry_pool ;
btstack_link_key_db_memory_entry_t * btstack_memory_btstack_link_key_db_memory_entry_get ( void ) {
return ( btstack_link_key_db_memory_entry_t * ) btstack_memory_pool_get ( & btstack_link_key_db_memory_entry_pool ) ;
2011-08-26 22:14:31 +00:00
}
2016-03-27 23:10:54 +02:00
void btstack_memory_btstack_link_key_db_memory_entry_free ( btstack_link_key_db_memory_entry_t * btstack_link_key_db_memory_entry ) {
btstack_memory_pool_free ( & btstack_link_key_db_memory_entry_pool , btstack_link_key_db_memory_entry ) ;
2011-08-26 22:14:31 +00:00
}
2012-05-21 18:24:37 +00:00
# else
2016-03-27 23:10:54 +02:00
btstack_link_key_db_memory_entry_t * btstack_memory_btstack_link_key_db_memory_entry_get ( void ) {
2012-05-21 18:24:37 +00:00
return NULL ;
}
2016-03-27 23:10:54 +02:00
void btstack_memory_btstack_link_key_db_memory_entry_free ( btstack_link_key_db_memory_entry_t * btstack_link_key_db_memory_entry ) {
2014-09-29 19:53:42 +00:00
// silence compiler warning about unused parameter in a portable way
2016-03-27 23:10:54 +02:00
( void ) btstack_link_key_db_memory_entry ;
2012-05-21 18:24:37 +00:00
} ;
# endif
2011-08-26 22:14:31 +00:00
# elif defined(HAVE_MALLOC)
2016-03-27 23:10:54 +02:00
btstack_link_key_db_memory_entry_t * btstack_memory_btstack_link_key_db_memory_entry_get ( void ) {
return ( btstack_link_key_db_memory_entry_t * ) malloc ( sizeof ( btstack_link_key_db_memory_entry_t ) ) ;
2011-08-26 22:14:31 +00:00
}
2016-03-27 23:10:54 +02:00
void btstack_memory_btstack_link_key_db_memory_entry_free ( btstack_link_key_db_memory_entry_t * btstack_link_key_db_memory_entry ) {
free ( btstack_link_key_db_memory_entry ) ;
2011-08-26 22:14:31 +00:00
}
2011-07-29 22:24:15 +00:00
# endif
2014-10-31 11:42:29 +00:00
// MARK: bnep_service_t
2016-03-28 12:05:33 +02:00
# if !defined(HAVE_MALLOC) && !defined(MAX_NR_BNEP_SERVICES)
# if defined(MAX_NO_BNEP_SERVICES)
2016-09-26 22:43:53 +02:00
# error "Deprecated MAX_NO_BNEP_SERVICES defined instead of MAX_NR_BNEP_SERVICES. Please update your btstack_config.h to use MAX_NR_BNEP_SERVICES."
2016-03-28 12:05:33 +02:00
# else
# define MAX_NR_BNEP_SERVICES 0
# endif
# endif
# ifdef MAX_NR_BNEP_SERVICES
# if MAX_NR_BNEP_SERVICES > 0
static bnep_service_t bnep_service_storage [ MAX_NR_BNEP_SERVICES ] ;
2016-01-20 14:59:38 +01:00
static btstack_memory_pool_t bnep_service_pool ;
2014-10-31 11:42:29 +00:00
bnep_service_t * btstack_memory_bnep_service_get ( void ) {
2016-01-20 14:59:38 +01:00
return ( bnep_service_t * ) btstack_memory_pool_get ( & bnep_service_pool ) ;
2014-10-31 11:42:29 +00:00
}
void btstack_memory_bnep_service_free ( bnep_service_t * bnep_service ) {
2016-01-20 14:59:38 +01:00
btstack_memory_pool_free ( & bnep_service_pool , bnep_service ) ;
2014-10-31 11:42:29 +00:00
}
# else
bnep_service_t * btstack_memory_bnep_service_get ( void ) {
return NULL ;
}
void btstack_memory_bnep_service_free ( bnep_service_t * bnep_service ) {
// silence compiler warning about unused parameter in a portable way
( void ) bnep_service ;
} ;
# endif
# elif defined(HAVE_MALLOC)
bnep_service_t * btstack_memory_bnep_service_get ( void ) {
return ( bnep_service_t * ) malloc ( sizeof ( bnep_service_t ) ) ;
}
void btstack_memory_bnep_service_free ( bnep_service_t * bnep_service ) {
free ( bnep_service ) ;
}
# endif
// MARK: bnep_channel_t
2016-03-28 12:05:33 +02:00
# if !defined(HAVE_MALLOC) && !defined(MAX_NR_BNEP_CHANNELS)
# if defined(MAX_NO_BNEP_CHANNELS)
2016-09-26 22:43:53 +02:00
# error "Deprecated MAX_NO_BNEP_CHANNELS defined instead of MAX_NR_BNEP_CHANNELS. Please update your btstack_config.h to use MAX_NR_BNEP_CHANNELS."
2016-03-28 12:05:33 +02:00
# else
# define MAX_NR_BNEP_CHANNELS 0
# endif
# endif
# ifdef MAX_NR_BNEP_CHANNELS
# if MAX_NR_BNEP_CHANNELS > 0
static bnep_channel_t bnep_channel_storage [ MAX_NR_BNEP_CHANNELS ] ;
2016-01-20 14:59:38 +01:00
static btstack_memory_pool_t bnep_channel_pool ;
2014-10-31 11:42:29 +00:00
bnep_channel_t * btstack_memory_bnep_channel_get ( void ) {
2016-01-20 14:59:38 +01:00
return ( bnep_channel_t * ) btstack_memory_pool_get ( & bnep_channel_pool ) ;
2014-10-31 11:42:29 +00:00
}
void btstack_memory_bnep_channel_free ( bnep_channel_t * bnep_channel ) {
2016-01-20 14:59:38 +01:00
btstack_memory_pool_free ( & bnep_channel_pool , bnep_channel ) ;
2014-10-31 11:42:29 +00:00
}
# else
bnep_channel_t * btstack_memory_bnep_channel_get ( void ) {
return NULL ;
}
void btstack_memory_bnep_channel_free ( bnep_channel_t * bnep_channel ) {
// silence compiler warning about unused parameter in a portable way
( void ) bnep_channel ;
} ;
# endif
# elif defined(HAVE_MALLOC)
bnep_channel_t * btstack_memory_bnep_channel_get ( void ) {
return ( bnep_channel_t * ) malloc ( sizeof ( bnep_channel_t ) ) ;
}
void btstack_memory_bnep_channel_free ( bnep_channel_t * bnep_channel ) {
free ( bnep_channel ) ;
}
# endif
2015-07-09 15:28:06 +02:00
// MARK: hfp_connection_t
2016-03-28 12:05:33 +02:00
# if !defined(HAVE_MALLOC) && !defined(MAX_NR_HFP_CONNECTIONS)
# if defined(MAX_NO_HFP_CONNECTIONS)
2016-09-26 22:43:53 +02:00
# error "Deprecated MAX_NO_HFP_CONNECTIONS defined instead of MAX_NR_HFP_CONNECTIONS. Please update your btstack_config.h to use MAX_NR_HFP_CONNECTIONS."
2016-03-28 12:05:33 +02:00
# else
# define MAX_NR_HFP_CONNECTIONS 0
# endif
# endif
# ifdef MAX_NR_HFP_CONNECTIONS
# if MAX_NR_HFP_CONNECTIONS > 0
static hfp_connection_t hfp_connection_storage [ MAX_NR_HFP_CONNECTIONS ] ;
2016-01-20 14:59:38 +01:00
static btstack_memory_pool_t hfp_connection_pool ;
2015-07-09 15:28:06 +02:00
hfp_connection_t * btstack_memory_hfp_connection_get ( void ) {
2016-01-20 14:59:38 +01:00
return ( hfp_connection_t * ) btstack_memory_pool_get ( & hfp_connection_pool ) ;
2015-07-09 15:28:06 +02:00
}
void btstack_memory_hfp_connection_free ( hfp_connection_t * hfp_connection ) {
2016-01-20 14:59:38 +01:00
btstack_memory_pool_free ( & hfp_connection_pool , hfp_connection ) ;
2015-07-09 15:28:06 +02:00
}
# else
hfp_connection_t * btstack_memory_hfp_connection_get ( void ) {
return NULL ;
}
void btstack_memory_hfp_connection_free ( hfp_connection_t * hfp_connection ) {
// silence compiler warning about unused parameter in a portable way
( void ) hfp_connection ;
} ;
# endif
# elif defined(HAVE_MALLOC)
hfp_connection_t * btstack_memory_hfp_connection_get ( void ) {
return ( hfp_connection_t * ) malloc ( sizeof ( hfp_connection_t ) ) ;
}
void btstack_memory_hfp_connection_free ( hfp_connection_t * hfp_connection ) {
free ( hfp_connection ) ;
}
# endif
2015-11-15 14:20:35 +01:00
// MARK: service_record_item_t
2016-03-28 12:05:33 +02:00
# if !defined(HAVE_MALLOC) && !defined(MAX_NR_SERVICE_RECORD_ITEMS)
# if defined(MAX_NO_SERVICE_RECORD_ITEMS)
2016-09-26 22:43:53 +02:00
# error "Deprecated MAX_NO_SERVICE_RECORD_ITEMS defined instead of MAX_NR_SERVICE_RECORD_ITEMS. Please update your btstack_config.h to use MAX_NR_SERVICE_RECORD_ITEMS."
2016-03-28 12:05:33 +02:00
# else
# define MAX_NR_SERVICE_RECORD_ITEMS 0
# endif
# endif
# ifdef MAX_NR_SERVICE_RECORD_ITEMS
# if MAX_NR_SERVICE_RECORD_ITEMS > 0
static service_record_item_t service_record_item_storage [ MAX_NR_SERVICE_RECORD_ITEMS ] ;
2016-01-20 14:59:38 +01:00
static btstack_memory_pool_t service_record_item_pool ;
2015-11-15 14:20:35 +01:00
service_record_item_t * btstack_memory_service_record_item_get ( void ) {
2016-01-20 14:59:38 +01:00
return ( service_record_item_t * ) btstack_memory_pool_get ( & service_record_item_pool ) ;
2015-11-15 14:20:35 +01:00
}
void btstack_memory_service_record_item_free ( service_record_item_t * service_record_item ) {
2016-01-20 14:59:38 +01:00
btstack_memory_pool_free ( & service_record_item_pool , service_record_item ) ;
2015-11-15 14:20:35 +01:00
}
# else
service_record_item_t * btstack_memory_service_record_item_get ( void ) {
return NULL ;
}
void btstack_memory_service_record_item_free ( service_record_item_t * service_record_item ) {
// silence compiler warning about unused parameter in a portable way
( void ) service_record_item ;
} ;
# endif
# elif defined(HAVE_MALLOC)
service_record_item_t * btstack_memory_service_record_item_get ( void ) {
return ( service_record_item_t * ) malloc ( sizeof ( service_record_item_t ) ) ;
}
void btstack_memory_service_record_item_free ( service_record_item_t * service_record_item ) {
free ( service_record_item ) ;
}
# endif
2016-09-26 22:43:53 +02:00
2016-11-10 15:20:01 +01:00
// MARK: avdtp_stream_endpoint_t
# if !defined(HAVE_MALLOC) && !defined(MAX_NR_AVDTP_STREAM_ENDPOINTS)
# if defined(MAX_NO_AVDTP_STREAM_ENDPOINTS)
# error "Deprecated MAX_NO_AVDTP_STREAM_ENDPOINTS defined instead of MAX_NR_AVDTP_STREAM_ENDPOINTS. Please update your btstack_config.h to use MAX_NR_AVDTP_STREAM_ENDPOINTS."
2016-09-26 22:43:53 +02:00
# else
2016-11-10 15:20:01 +01:00
# define MAX_NR_AVDTP_STREAM_ENDPOINTS 0
2016-09-26 22:43:53 +02:00
# endif
# endif
2016-11-10 15:20:01 +01:00
# ifdef MAX_NR_AVDTP_STREAM_ENDPOINTS
# if MAX_NR_AVDTP_STREAM_ENDPOINTS > 0
static avdtp_stream_endpoint_t avdtp_stream_endpoint_storage [ MAX_NR_AVDTP_STREAM_ENDPOINTS ] ;
static btstack_memory_pool_t avdtp_stream_endpoint_pool ;
avdtp_stream_endpoint_t * btstack_memory_avdtp_stream_endpoint_get ( void ) {
return ( avdtp_stream_endpoint_t * ) btstack_memory_pool_get ( & avdtp_stream_endpoint_pool ) ;
2016-09-26 22:43:53 +02:00
}
2016-11-10 15:20:01 +01:00
void btstack_memory_avdtp_stream_endpoint_free ( avdtp_stream_endpoint_t * avdtp_stream_endpoint ) {
btstack_memory_pool_free ( & avdtp_stream_endpoint_pool , avdtp_stream_endpoint ) ;
2016-09-26 22:43:53 +02:00
}
# else
2016-11-10 15:20:01 +01:00
avdtp_stream_endpoint_t * btstack_memory_avdtp_stream_endpoint_get ( void ) {
2016-09-26 22:43:53 +02:00
return NULL ;
}
2016-11-10 15:20:01 +01:00
void btstack_memory_avdtp_stream_endpoint_free ( avdtp_stream_endpoint_t * avdtp_stream_endpoint ) {
2016-09-26 22:43:53 +02:00
// silence compiler warning about unused parameter in a portable way
2016-11-10 15:20:01 +01:00
( void ) avdtp_stream_endpoint ;
2016-09-26 22:43:53 +02:00
} ;
# endif
# elif defined(HAVE_MALLOC)
2016-11-10 15:20:01 +01:00
avdtp_stream_endpoint_t * btstack_memory_avdtp_stream_endpoint_get ( void ) {
return ( avdtp_stream_endpoint_t * ) malloc ( sizeof ( avdtp_stream_endpoint_t ) ) ;
2016-09-26 22:43:53 +02:00
}
2016-11-10 15:20:01 +01:00
void btstack_memory_avdtp_stream_endpoint_free ( avdtp_stream_endpoint_t * avdtp_stream_endpoint ) {
free ( avdtp_stream_endpoint ) ;
2016-09-26 22:43:53 +02:00
}
# endif
2016-11-16 17:17:57 +01:00
// MARK: avdtp_connection_t
# if !defined(HAVE_MALLOC) && !defined(MAX_NR_AVDTP_CONNECTIONS)
# if defined(MAX_NO_AVDTP_CONNECTIONS)
# error "Deprecated MAX_NO_AVDTP_CONNECTIONS defined instead of MAX_NR_AVDTP_CONNECTIONS. Please update your btstack_config.h to use MAX_NR_AVDTP_CONNECTIONS."
# else
# define MAX_NR_AVDTP_CONNECTIONS 0
# endif
# endif
# ifdef MAX_NR_AVDTP_CONNECTIONS
# if MAX_NR_AVDTP_CONNECTIONS > 0
static avdtp_connection_t avdtp_connection_storage [ MAX_NR_AVDTP_CONNECTIONS ] ;
static btstack_memory_pool_t avdtp_connection_pool ;
avdtp_connection_t * btstack_memory_avdtp_connection_get ( void ) {
return ( avdtp_connection_t * ) btstack_memory_pool_get ( & avdtp_connection_pool ) ;
}
void btstack_memory_avdtp_connection_free ( avdtp_connection_t * avdtp_connection ) {
btstack_memory_pool_free ( & avdtp_connection_pool , avdtp_connection ) ;
}
# else
avdtp_connection_t * btstack_memory_avdtp_connection_get ( void ) {
return NULL ;
}
void btstack_memory_avdtp_connection_free ( avdtp_connection_t * avdtp_connection ) {
// silence compiler warning about unused parameter in a portable way
( void ) avdtp_connection ;
} ;
# endif
# elif defined(HAVE_MALLOC)
avdtp_connection_t * btstack_memory_avdtp_connection_get ( void ) {
return ( avdtp_connection_t * ) malloc ( sizeof ( avdtp_connection_t ) ) ;
}
void btstack_memory_avdtp_connection_free ( avdtp_connection_t * avdtp_connection ) {
free ( avdtp_connection ) ;
}
# endif
2017-01-30 17:10:16 +01:00
// MARK: avrcp_connection_t
# if !defined(HAVE_MALLOC) && !defined(MAX_NR_AVRCP_CONNECTIONS)
# if defined(MAX_NO_AVRCP_CONNECTIONS)
# error "Deprecated MAX_NO_AVRCP_CONNECTIONS defined instead of MAX_NR_AVRCP_CONNECTIONS. Please update your btstack_config.h to use MAX_NR_AVRCP_CONNECTIONS."
# else
# define MAX_NR_AVRCP_CONNECTIONS 0
# endif
# endif
# ifdef MAX_NR_AVRCP_CONNECTIONS
# if MAX_NR_AVRCP_CONNECTIONS > 0
static avrcp_connection_t avrcp_connection_storage [ MAX_NR_AVRCP_CONNECTIONS ] ;
static btstack_memory_pool_t avrcp_connection_pool ;
avrcp_connection_t * btstack_memory_avrcp_connection_get ( void ) {
return ( avrcp_connection_t * ) btstack_memory_pool_get ( & avrcp_connection_pool ) ;
}
void btstack_memory_avrcp_connection_free ( avrcp_connection_t * avrcp_connection ) {
btstack_memory_pool_free ( & avrcp_connection_pool , avrcp_connection ) ;
}
# else
avrcp_connection_t * btstack_memory_avrcp_connection_get ( void ) {
return NULL ;
}
void btstack_memory_avrcp_connection_free ( avrcp_connection_t * avrcp_connection ) {
// silence compiler warning about unused parameter in a portable way
( void ) avrcp_connection ;
} ;
# endif
# elif defined(HAVE_MALLOC)
avrcp_connection_t * btstack_memory_avrcp_connection_get ( void ) {
return ( avrcp_connection_t * ) malloc ( sizeof ( avrcp_connection_t ) ) ;
}
void btstack_memory_avrcp_connection_free ( avrcp_connection_t * avrcp_connection ) {
free ( avrcp_connection ) ;
}
# endif
2016-01-21 15:33:36 +01:00
# ifdef ENABLE_BLE
2014-10-31 11:42:29 +00:00
// MARK: gatt_client_t
2016-03-28 12:05:33 +02:00
# if !defined(HAVE_MALLOC) && !defined(MAX_NR_GATT_CLIENTS)
# if defined(MAX_NO_GATT_CLIENTS)
2016-09-26 22:43:53 +02:00
# error "Deprecated MAX_NO_GATT_CLIENTS defined instead of MAX_NR_GATT_CLIENTS. Please update your btstack_config.h to use MAX_NR_GATT_CLIENTS."
2016-03-28 12:05:33 +02:00
# else
# define MAX_NR_GATT_CLIENTS 0
# endif
# endif
# ifdef MAX_NR_GATT_CLIENTS
# if MAX_NR_GATT_CLIENTS > 0
static gatt_client_t gatt_client_storage [ MAX_NR_GATT_CLIENTS ] ;
2016-01-20 14:59:38 +01:00
static btstack_memory_pool_t gatt_client_pool ;
2014-09-04 20:40:23 +00:00
gatt_client_t * btstack_memory_gatt_client_get ( void ) {
2016-01-20 14:59:38 +01:00
return ( gatt_client_t * ) btstack_memory_pool_get ( & gatt_client_pool ) ;
2014-09-04 20:40:23 +00:00
}
void btstack_memory_gatt_client_free ( gatt_client_t * gatt_client ) {
2016-01-20 14:59:38 +01:00
btstack_memory_pool_free ( & gatt_client_pool , gatt_client ) ;
2014-09-04 20:40:23 +00:00
}
# else
gatt_client_t * btstack_memory_gatt_client_get ( void ) {
return NULL ;
}
void btstack_memory_gatt_client_free ( gatt_client_t * gatt_client ) {
2014-09-29 19:53:42 +00:00
// silence compiler warning about unused parameter in a portable way
( void ) gatt_client ;
2014-09-04 20:40:23 +00:00
} ;
# endif
# elif defined(HAVE_MALLOC)
gatt_client_t * btstack_memory_gatt_client_get ( void ) {
return ( gatt_client_t * ) malloc ( sizeof ( gatt_client_t ) ) ;
}
void btstack_memory_gatt_client_free ( gatt_client_t * gatt_client ) {
free ( gatt_client ) ;
}
# endif
2014-10-31 11:42:29 +00:00
2015-07-27 23:06:54 +02:00
// MARK: whitelist_entry_t
2016-03-28 12:05:33 +02:00
# if !defined(HAVE_MALLOC) && !defined(MAX_NR_WHITELIST_ENTRIES)
# if defined(MAX_NO_WHITELIST_ENTRIES)
2016-09-26 22:43:53 +02:00
# error "Deprecated MAX_NO_WHITELIST_ENTRIES defined instead of MAX_NR_WHITELIST_ENTRIES. Please update your btstack_config.h to use MAX_NR_WHITELIST_ENTRIES."
2016-03-28 12:05:33 +02:00
# else
# define MAX_NR_WHITELIST_ENTRIES 0
# endif
# endif
# ifdef MAX_NR_WHITELIST_ENTRIES
# if MAX_NR_WHITELIST_ENTRIES > 0
static whitelist_entry_t whitelist_entry_storage [ MAX_NR_WHITELIST_ENTRIES ] ;
2016-01-20 14:59:38 +01:00
static btstack_memory_pool_t whitelist_entry_pool ;
2015-07-27 23:06:54 +02:00
whitelist_entry_t * btstack_memory_whitelist_entry_get ( void ) {
2016-01-20 14:59:38 +01:00
return ( whitelist_entry_t * ) btstack_memory_pool_get ( & whitelist_entry_pool ) ;
2015-07-27 23:06:54 +02:00
}
void btstack_memory_whitelist_entry_free ( whitelist_entry_t * whitelist_entry ) {
2016-01-20 14:59:38 +01:00
btstack_memory_pool_free ( & whitelist_entry_pool , whitelist_entry ) ;
2015-07-27 23:06:54 +02:00
}
# else
whitelist_entry_t * btstack_memory_whitelist_entry_get ( void ) {
return NULL ;
}
void btstack_memory_whitelist_entry_free ( whitelist_entry_t * whitelist_entry ) {
// silence compiler warning about unused parameter in a portable way
( void ) whitelist_entry ;
} ;
# endif
# elif defined(HAVE_MALLOC)
whitelist_entry_t * btstack_memory_whitelist_entry_get ( void ) {
return ( whitelist_entry_t * ) malloc ( sizeof ( whitelist_entry_t ) ) ;
}
void btstack_memory_whitelist_entry_free ( whitelist_entry_t * whitelist_entry ) {
free ( whitelist_entry ) ;
}
# endif
2015-08-04 13:59:06 +02:00
// MARK: sm_lookup_entry_t
2016-03-28 12:05:33 +02:00
# if !defined(HAVE_MALLOC) && !defined(MAX_NR_SM_LOOKUP_ENTRIES)
# if defined(MAX_NO_SM_LOOKUP_ENTRIES)
2016-09-26 22:43:53 +02:00
# error "Deprecated MAX_NO_SM_LOOKUP_ENTRIES defined instead of MAX_NR_SM_LOOKUP_ENTRIES. Please update your btstack_config.h to use MAX_NR_SM_LOOKUP_ENTRIES."
2016-03-28 12:05:33 +02:00
# else
# define MAX_NR_SM_LOOKUP_ENTRIES 0
# endif
# endif
# ifdef MAX_NR_SM_LOOKUP_ENTRIES
# if MAX_NR_SM_LOOKUP_ENTRIES > 0
static sm_lookup_entry_t sm_lookup_entry_storage [ MAX_NR_SM_LOOKUP_ENTRIES ] ;
2016-01-20 14:59:38 +01:00
static btstack_memory_pool_t sm_lookup_entry_pool ;
2015-08-04 13:59:06 +02:00
sm_lookup_entry_t * btstack_memory_sm_lookup_entry_get ( void ) {
2016-01-20 14:59:38 +01:00
return ( sm_lookup_entry_t * ) btstack_memory_pool_get ( & sm_lookup_entry_pool ) ;
2015-08-04 13:59:06 +02:00
}
void btstack_memory_sm_lookup_entry_free ( sm_lookup_entry_t * sm_lookup_entry ) {
2016-01-20 14:59:38 +01:00
btstack_memory_pool_free ( & sm_lookup_entry_pool , sm_lookup_entry ) ;
2015-08-04 13:59:06 +02:00
}
# else
sm_lookup_entry_t * btstack_memory_sm_lookup_entry_get ( void ) {
return NULL ;
}
void btstack_memory_sm_lookup_entry_free ( sm_lookup_entry_t * sm_lookup_entry ) {
// silence compiler warning about unused parameter in a portable way
( void ) sm_lookup_entry ;
} ;
# endif
# elif defined(HAVE_MALLOC)
sm_lookup_entry_t * btstack_memory_sm_lookup_entry_get ( void ) {
return ( sm_lookup_entry_t * ) malloc ( sizeof ( sm_lookup_entry_t ) ) ;
}
void btstack_memory_sm_lookup_entry_free ( sm_lookup_entry_t * sm_lookup_entry ) {
free ( sm_lookup_entry ) ;
}
# endif
2014-10-31 11:42:29 +00:00
# endif
2011-07-24 08:51:17 +00:00
// init
void btstack_memory_init ( void ) {
2016-03-28 12:05:33 +02:00
# if MAX_NR_HCI_CONNECTIONS > 0
btstack_memory_pool_create ( & hci_connection_pool , hci_connection_storage , MAX_NR_HCI_CONNECTIONS , sizeof ( hci_connection_t ) ) ;
2011-07-24 08:51:17 +00:00
# endif
2016-03-28 12:05:33 +02:00
# if MAX_NR_L2CAP_SERVICES > 0
btstack_memory_pool_create ( & l2cap_service_pool , l2cap_service_storage , MAX_NR_L2CAP_SERVICES , sizeof ( l2cap_service_t ) ) ;
2011-07-24 08:51:17 +00:00
# endif
2016-03-28 12:05:33 +02:00
# if MAX_NR_L2CAP_CHANNELS > 0
btstack_memory_pool_create ( & l2cap_channel_pool , l2cap_channel_storage , MAX_NR_L2CAP_CHANNELS , sizeof ( l2cap_channel_t ) ) ;
2011-07-24 08:51:17 +00:00
# endif
2016-03-28 12:05:33 +02:00
# if MAX_NR_RFCOMM_MULTIPLEXERS > 0
btstack_memory_pool_create ( & rfcomm_multiplexer_pool , rfcomm_multiplexer_storage , MAX_NR_RFCOMM_MULTIPLEXERS , sizeof ( rfcomm_multiplexer_t ) ) ;
2011-07-24 08:51:17 +00:00
# endif
2016-03-28 12:05:33 +02:00
# if MAX_NR_RFCOMM_SERVICES > 0
btstack_memory_pool_create ( & rfcomm_service_pool , rfcomm_service_storage , MAX_NR_RFCOMM_SERVICES , sizeof ( rfcomm_service_t ) ) ;
2011-07-24 08:51:17 +00:00
# endif
2016-03-28 12:05:33 +02:00
# if MAX_NR_RFCOMM_CHANNELS > 0
btstack_memory_pool_create ( & rfcomm_channel_pool , rfcomm_channel_storage , MAX_NR_RFCOMM_CHANNELS , sizeof ( rfcomm_channel_t ) ) ;
2011-07-24 08:51:17 +00:00
# endif
2016-03-28 12:05:33 +02:00
# if MAX_NR_BTSTACK_LINK_KEY_DB_MEMORY_ENTRIES > 0
btstack_memory_pool_create ( & btstack_link_key_db_memory_entry_pool , btstack_link_key_db_memory_entry_storage , MAX_NR_BTSTACK_LINK_KEY_DB_MEMORY_ENTRIES , sizeof ( btstack_link_key_db_memory_entry_t ) ) ;
2011-07-29 22:24:15 +00:00
# endif
2016-03-28 12:05:33 +02:00
# if MAX_NR_BNEP_SERVICES > 0
btstack_memory_pool_create ( & bnep_service_pool , bnep_service_storage , MAX_NR_BNEP_SERVICES , sizeof ( bnep_service_t ) ) ;
2014-10-31 11:42:29 +00:00
# endif
2016-03-28 12:05:33 +02:00
# if MAX_NR_BNEP_CHANNELS > 0
btstack_memory_pool_create ( & bnep_channel_pool , bnep_channel_storage , MAX_NR_BNEP_CHANNELS , sizeof ( bnep_channel_t ) ) ;
2014-10-31 11:42:29 +00:00
# endif
2016-03-28 12:05:33 +02:00
# if MAX_NR_HFP_CONNECTIONS > 0
btstack_memory_pool_create ( & hfp_connection_pool , hfp_connection_storage , MAX_NR_HFP_CONNECTIONS , sizeof ( hfp_connection_t ) ) ;
2015-07-09 15:28:06 +02:00
# endif
2016-03-28 12:05:33 +02:00
# if MAX_NR_SERVICE_RECORD_ITEMS > 0
btstack_memory_pool_create ( & service_record_item_pool , service_record_item_storage , MAX_NR_SERVICE_RECORD_ITEMS , sizeof ( service_record_item_t ) ) ;
2015-11-15 14:20:35 +01:00
# endif
2016-11-10 15:20:01 +01:00
# if MAX_NR_AVDTP_STREAM_ENDPOINTS > 0
btstack_memory_pool_create ( & avdtp_stream_endpoint_pool , avdtp_stream_endpoint_storage , MAX_NR_AVDTP_STREAM_ENDPOINTS , sizeof ( avdtp_stream_endpoint_t ) ) ;
2016-09-26 22:43:53 +02:00
# endif
2016-11-16 17:17:57 +01:00
# if MAX_NR_AVDTP_CONNECTIONS > 0
btstack_memory_pool_create ( & avdtp_connection_pool , avdtp_connection_storage , MAX_NR_AVDTP_CONNECTIONS , sizeof ( avdtp_connection_t ) ) ;
# endif
2017-01-30 17:10:16 +01:00
# if MAX_NR_AVRCP_CONNECTIONS > 0
btstack_memory_pool_create ( & avrcp_connection_pool , avrcp_connection_storage , MAX_NR_AVRCP_CONNECTIONS , sizeof ( avrcp_connection_t ) ) ;
# endif
2016-01-21 15:33:36 +01:00
# ifdef ENABLE_BLE
2016-03-28 12:05:33 +02:00
# if MAX_NR_GATT_CLIENTS > 0
btstack_memory_pool_create ( & gatt_client_pool , gatt_client_storage , MAX_NR_GATT_CLIENTS , sizeof ( gatt_client_t ) ) ;
2014-09-04 20:40:23 +00:00
# endif
2016-03-28 12:05:33 +02:00
# if MAX_NR_WHITELIST_ENTRIES > 0
btstack_memory_pool_create ( & whitelist_entry_pool , whitelist_entry_storage , MAX_NR_WHITELIST_ENTRIES , sizeof ( whitelist_entry_t ) ) ;
2015-07-27 23:06:54 +02:00
# endif
2016-03-28 12:05:33 +02:00
# if MAX_NR_SM_LOOKUP_ENTRIES > 0
btstack_memory_pool_create ( & sm_lookup_entry_pool , sm_lookup_entry_storage , MAX_NR_SM_LOOKUP_ENTRIES , sizeof ( sm_lookup_entry_t ) ) ;
2015-08-04 13:59:06 +02:00
# endif
2014-09-04 21:08:31 +00:00
# endif
2011-11-09 15:31:58 +00:00
}