mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-20 18:40:31 +00:00
add MAX_NO_SERVICE_RECORD_ITEMS to all configs, generated code
This commit is contained in:
parent
b34012481f
commit
cd9ee14457
@ -34,5 +34,5 @@
|
||||
#define MAX_NO_HFP_CONNECTIONS 0
|
||||
#define MAX_NO_WHITELIST_ENTRIES 1
|
||||
#define MAX_NO_SM_LOOKUP_ENTRIES 3
|
||||
|
||||
#define MAX_NO_SERVICE_RECORD_ITEMS 1
|
||||
#endif
|
@ -37,6 +37,7 @@
|
||||
#define MAX_NO_HFP_CONNECTIONS 0
|
||||
#define MAX_NO_WHITELIST_ENTRIES 1
|
||||
#define MAX_NO_SM_LOOKUP_ENTRIES 3
|
||||
#define MAX_NO_SERVICE_RECORD_ITEMS 1
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -37,6 +37,7 @@
|
||||
#define MAX_NO_HFP_CONNECTIONS 0
|
||||
#define MAX_NO_WHITELIST_ENTRIES 1
|
||||
#define MAX_NO_SM_LOOKUP_ENTRIES 3
|
||||
#define MAX_NO_SERVICE_RECORD_ITEMS 1
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -37,6 +37,7 @@
|
||||
#define MAX_NO_HFP_CONNECTIONS 0
|
||||
#define MAX_NO_WHITELIST_ENTRIES 1
|
||||
#define MAX_NO_SM_LOOKUP_ENTRIES 3
|
||||
#define MAX_NO_SERVICE_RECORD_ITEMS 1
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -34,5 +34,6 @@
|
||||
#define MAX_NO_HFP_CONNECTIONS 0
|
||||
#define MAX_NO_WHITELIST_ENTRIES 1
|
||||
#define MAX_NO_SM_LOOKUP_ENTRIES 3
|
||||
#define MAX_NO_SERVICE_RECORD_ITEMS 1
|
||||
|
||||
#endif
|
@ -34,5 +34,6 @@
|
||||
#define MAX_NO_HFP_CONNECTIONS 0
|
||||
#define MAX_NO_WHITELIST_ENTRIES 1
|
||||
#define MAX_NO_SM_LOOKUP_ENTRIES 3
|
||||
#define MAX_NO_SERVICE_RECORD_ITEMS 1
|
||||
|
||||
#endif
|
@ -441,6 +441,39 @@ void btstack_memory_hfp_connection_free(hfp_connection_t *hfp_connection){
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// MARK: service_record_item_t
|
||||
#ifdef MAX_NO_SERVICE_RECORD_ITEMS
|
||||
#if MAX_NO_SERVICE_RECORD_ITEMS > 0
|
||||
static service_record_item_t service_record_item_storage[MAX_NO_SERVICE_RECORD_ITEMS];
|
||||
static memory_pool_t service_record_item_pool;
|
||||
service_record_item_t * btstack_memory_service_record_item_get(void){
|
||||
return (service_record_item_t *) memory_pool_get(&service_record_item_pool);
|
||||
}
|
||||
void btstack_memory_service_record_item_free(service_record_item_t *service_record_item){
|
||||
memory_pool_free(&service_record_item_pool, service_record_item);
|
||||
}
|
||||
#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);
|
||||
}
|
||||
#else
|
||||
#error "Neither HAVE_MALLOC nor MAX_NO_SERVICE_RECORD_ITEMS for struct service_record_item is defined. Please, edit the config file."
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_BLE
|
||||
|
||||
// MARK: gatt_client_t
|
||||
@ -610,6 +643,9 @@ void btstack_memory_init(void){
|
||||
#if MAX_NO_HFP_CONNECTIONS > 0
|
||||
memory_pool_create(&hfp_connection_pool, hfp_connection_storage, MAX_NO_HFP_CONNECTIONS, sizeof(hfp_connection_t));
|
||||
#endif
|
||||
#if MAX_NO_SERVICE_RECORD_ITEMS > 0
|
||||
memory_pool_create(&service_record_item_pool, service_record_item_storage, MAX_NO_SERVICE_RECORD_ITEMS, sizeof(service_record_item_t));
|
||||
#endif
|
||||
#ifdef HAVE_BLE
|
||||
#if MAX_NO_GATT_CLIENTS > 0
|
||||
memory_pool_create(&gatt_client_pool, gatt_client_storage, MAX_NO_GATT_CLIENTS, sizeof(gatt_client_t));
|
||||
|
@ -58,10 +58,11 @@ extern "C" {
|
||||
#include "l2cap.h"
|
||||
|
||||
// Classic
|
||||
#include "classic/rfcomm.h"
|
||||
#include "classic/bnep.h"
|
||||
#include "classic/hfp.h"
|
||||
#include "classic/remote_device_db.h"
|
||||
#include "classic/rfcomm.h"
|
||||
#include "classic/sdp.h"
|
||||
|
||||
// BLE
|
||||
#ifdef HAVE_BLE
|
||||
@ -114,6 +115,10 @@ void btstack_memory_bnep_channel_free(bnep_channel_t *bnep_channel);
|
||||
hfp_connection_t * btstack_memory_hfp_connection_get(void);
|
||||
void btstack_memory_hfp_connection_free(hfp_connection_t *hfp_connection);
|
||||
|
||||
// service_record_item
|
||||
service_record_item_t * btstack_memory_service_record_item_get(void);
|
||||
void btstack_memory_service_record_item_free(service_record_item_t *service_record_item);
|
||||
|
||||
#ifdef HAVE_BLE
|
||||
// gatt_client, gatt_subclient, whitelist_entry, sm_lookup_entry
|
||||
gatt_client_t * btstack_memory_gatt_client_get(void);
|
||||
|
Loading…
x
Reference in New Issue
Block a user