mirror of https://github.com/ARMmbed/mbed-os.git
Allow configuration (via defines) of some of the key settings for the NRF51 softdevice.
* CENTRAL_LINK_COUNT * PERIPHERAL_LINK_COUNT * gatts_enable_params.attr_tab_size * gatts_enable_params.service_changed * common_enable_params.vs_uuid_count These settings control the range of functionality enabled in the softdevice as well as ram consumption. In particular reducing these values is critical to enable usage of 16K nrf51 devices.pull/6860/head
parent
52cb119571
commit
ff5ca11253
|
@ -111,20 +111,6 @@ error_t btle_init(void)
|
|||
SOFTDEVICE_HANDLER_INIT(&clockConfiguration, signalEvent);
|
||||
|
||||
// Enable BLE stack
|
||||
/**
|
||||
* Using this call, the application can select whether to include the
|
||||
* Service Changed characteristic in the GATT Server. The default in all
|
||||
* previous releases has been to include the Service Changed characteristic,
|
||||
* but this affects how GATT clients behave. Specifically, it requires
|
||||
* clients to subscribe to this attribute and not to cache attribute handles
|
||||
* between connections unless the devices are bonded. If the application
|
||||
* does not need to change the structure of the GATT server attributes at
|
||||
* runtime this adds unnecessary complexity to the interaction with peer
|
||||
* clients. If the SoftDevice is enabled with the Service Changed
|
||||
* Characteristics turned off, then clients are allowed to cache attribute
|
||||
* handles making applications simpler on both sides.
|
||||
*/
|
||||
static const bool IS_SRVC_CHANGED_CHARACT_PRESENT = true;
|
||||
|
||||
ble_enable_params_t ble_enable_params;
|
||||
uint32_t err_code = softdevice_enable_get_default_config(CENTRAL_LINK_COUNT,
|
||||
|
|
|
@ -26,12 +26,50 @@ extern "C" {
|
|||
#include "ble_srv_common.h"
|
||||
#include "headers/nrf_ble.h"
|
||||
|
||||
#define CENTRAL_LINK_COUNT 3 /**<number of central links used by the application. When changing this number remember to adjust the RAM settings */
|
||||
/** If value for YOTTA_CFG_NORDIC_BLE_PERIPHERAL_LINKS was used, ram settings are adjusted by the yotta target module. */
|
||||
#define PERIPHERAL_LINK_COUNT 1 /**<number of peripheral links used by the application. When changing this number remember to adjust the RAM settings*/
|
||||
/** If value for YOTTA_CFG_NORDIC_BLE_CENTRAL_LINKS was used, ram settings are adjusted by the yotta target module. */
|
||||
#define GATTS_ATTR_TAB_SIZE 0x600 /**< GATTS attribite table size. */
|
||||
/** If value for YOTTA_CFG_NORDIC_BLE_GATTS_ATTR_TAB_SIZE was used, ram settings are adjusted by the yotta target module. */
|
||||
/* number of central links used by the application.
|
||||
* When changing this number remember to adjust the RAM settings */
|
||||
#ifndef NRF_SDH_BLE_CENTRAL_LINK_COUNT
|
||||
#define CENTRAL_LINK_COUNT 3
|
||||
#else
|
||||
#define CENTRAL_LINK_COUNT NRF_SDH_BLE_CENTRAL_LINK_COUNT
|
||||
#endif
|
||||
|
||||
/* number of peripheral links used by the application.
|
||||
* When changing this number remember to adjust the RAM settings */
|
||||
#ifndef NRF_SDH_BLE_PERIPHERAL_LINK_COUNT
|
||||
#define PERIPHERAL_LINK_COUNT 1
|
||||
#else
|
||||
#define PERIPHERAL_LINK_COUNT NRF_SDH_BLE_PERIPHERAL_LINK_COUNT
|
||||
#endif
|
||||
|
||||
|
||||
/* GATTS attribite table size.
|
||||
* When changing this number remember to adjust the RAM settings */
|
||||
#ifndef NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE
|
||||
#define GATTS_ATTR_TAB_SIZE 0x600
|
||||
#else
|
||||
#define GATTS_ATTR_TAB_SIZE NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Using this call, the application can select whether to include the
|
||||
* Service Changed characteristic in the GATT Server. The default in all
|
||||
* previous releases has been to include the Service Changed characteristic,
|
||||
* but this affects how GATT clients behave. Specifically, it requires
|
||||
* clients to subscribe to this attribute and not to cache attribute handles
|
||||
* between connections unless the devices are bonded. If the application
|
||||
* does not need to change the structure of the GATT server attributes at
|
||||
* runtime this adds unnecessary complexity to the interaction with peer
|
||||
* clients. If the SoftDevice is enabled with the Service Changed
|
||||
* Characteristics turned off, then clients are allowed to cache attribute
|
||||
* handles making applications simpler on both sides.
|
||||
*/
|
||||
#ifndef NRF_SDH_BLE_SERVICE_CHANGED
|
||||
#define IS_SRVC_CHANGED_CHARACT_PRESENT 1
|
||||
#else
|
||||
#define IS_SRVC_CHANGED_CHARACT_PRESENT NRF_SDH_BLE_SERVICE_CHANGED
|
||||
#endif
|
||||
|
||||
error_t btle_init(void);
|
||||
|
||||
|
|
|
@ -26,8 +26,13 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define UUID_TABLE_MAX_ENTRIES (4) /* This is the maximum number of 128-bit UUIDs with distinct bases that
|
||||
* we expect to be in use; increase this limit if needed. */
|
||||
/* This is the maximum number of 128-bit UUIDs with distinct bases that *
|
||||
* we expect to be in use; increase this limit if needed. */
|
||||
#ifdef NRF_SDH_BLE_VS_UUID_COUNT
|
||||
#define UUID_TABLE_MAX_ENTRIES NRF_SDH_BLE_VS_UUID_COUNT
|
||||
#else
|
||||
#define UUID_TABLE_MAX_ENTRIES (4)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Reset the table of 128bits uuids.
|
||||
|
|
Loading…
Reference in New Issue