PBL mbed final
Fork of nRF51822 by
Revision 456:da0323feba9b, committed 2015-11-02
- Comitter:
- rgrover1
- Date:
- Mon Nov 02 09:05:10 2015 +0000
- Parent:
- 455:e33de7c4574c
- Child:
- 457:4b6a1f794460
- Commit message:
- Synchronized with git rev 97a65815
Author: Andres Amaya Garcia
Introduced changes for memory savings
Moved GattSecurityManager and GattClient to be allocated dynamically and
reduced the size of some arrays to increase memory savings.
Changed in this revision
--- a/source/btle/custom/custom_helper.cpp Mon Nov 02 09:05:10 2015 +0000 +++ b/source/btle/custom/custom_helper.cpp Mon Nov 02 09:05:10 2015 +0000 @@ -26,7 +26,7 @@ UUID::LongUUIDBytes_t uuid; uint8_t type; } converted_uuid_table_entry_t; -static const unsigned UUID_TABLE_MAX_ENTRIES = 8; /* This is the maximum number of 128-bit UUIDs with distinct bases that +static const unsigned 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. */ static unsigned uuidTableEntries = 0; /* current usage of the table */ converted_uuid_table_entry_t convertedUUIDTable[UUID_TABLE_MAX_ENTRIES];
--- a/source/nRF5xGattClient.cpp Mon Nov 02 09:05:10 2015 +0000 +++ b/source/nRF5xGattClient.cpp Mon Nov 02 09:05:10 2015 +0000 @@ -18,8 +18,11 @@ nRF5xGattClient & nRF5xGattClient::getInstance(void) { - static nRF5xGattClient nRFGattClientSingleton; - return nRFGattClientSingleton; + static nRF5xGattClient* nRFGattClientSingleton = NULL; + if (nRFGattClientSingleton == NULL) { + nRFGattClientSingleton = new nRF5xGattClient(); + } + return *nRFGattClientSingleton; } #if !defined(TARGET_MCU_NRF51_16K_S110) && !defined(TARGET_MCU_NRF51_32K_S110)
--- a/source/nRF5xSecurityManager.cpp Mon Nov 02 09:05:10 2015 +0000 +++ b/source/nRF5xSecurityManager.cpp Mon Nov 02 09:05:10 2015 +0000 @@ -17,6 +17,9 @@ #include "nRF5xSecurityManager.h" nRF5xSecurityManager &nRF5xSecurityManager::getInstance(void) { - static nRF5xSecurityManager m_instance; - return m_instance; + static nRF5xSecurityManager* m_instance = NULL; + if (m_instance == NULL) { + m_instance = new nRF5xSecurityManager(); + } + return *m_instance; } \ No newline at end of file
--- a/source/nordic-sdk/components/ble/device_manager/config/device_manager_cnfg.h Mon Nov 02 09:05:10 2015 +0000 +++ b/source/nordic-sdk/components/ble/device_manager/config/device_manager_cnfg.h Mon Nov 02 09:05:10 2015 +0000 @@ -85,7 +85,7 @@ * be stored. In such cases, application will be notified with DM_DEVICE_CONTEXT_FULL * as event result at the completion of the security procedure. */ -#define DEVICE_MANAGER_MAX_BONDS 4 +#define DEVICE_MANAGER_MAX_BONDS 2 /**