Merge pull request #55 from andresag01/develop

Introduced changes for memory savings
This commit is contained in:
Rohit Grover 2015-10-29 13:03:37 +00:00
commit 2fc324f01b
4 changed files with 12 additions and 6 deletions

View File

@ -26,7 +26,7 @@ typedef struct {
UUID::LongUUIDBytes_t uuid; UUID::LongUUIDBytes_t uuid;
uint8_t type; uint8_t type;
} converted_uuid_table_entry_t; } 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. */ * we expect to be in use; increase this limit if needed. */
static unsigned uuidTableEntries = 0; /* current usage of the table */ static unsigned uuidTableEntries = 0; /* current usage of the table */
converted_uuid_table_entry_t convertedUUIDTable[UUID_TABLE_MAX_ENTRIES]; converted_uuid_table_entry_t convertedUUIDTable[UUID_TABLE_MAX_ENTRIES];

View File

@ -18,8 +18,11 @@
nRF5xGattClient & nRF5xGattClient &
nRF5xGattClient::getInstance(void) { nRF5xGattClient::getInstance(void) {
static nRF5xGattClient nRFGattClientSingleton; static nRF5xGattClient* nRFGattClientSingleton = NULL;
return nRFGattClientSingleton; if (nRFGattClientSingleton == NULL) {
nRFGattClientSingleton = new nRF5xGattClient();
}
return *nRFGattClientSingleton;
} }
#if !defined(TARGET_MCU_NRF51_16K_S110) && !defined(TARGET_MCU_NRF51_32K_S110) #if !defined(TARGET_MCU_NRF51_16K_S110) && !defined(TARGET_MCU_NRF51_32K_S110)

View File

@ -17,6 +17,9 @@
#include "nRF5xSecurityManager.h" #include "nRF5xSecurityManager.h"
nRF5xSecurityManager &nRF5xSecurityManager::getInstance(void) { nRF5xSecurityManager &nRF5xSecurityManager::getInstance(void) {
static nRF5xSecurityManager m_instance; static nRF5xSecurityManager* m_instance = NULL;
return m_instance; if (m_instance == NULL) {
m_instance = new nRF5xSecurityManager();
}
return *m_instance;
} }

View File

@ -85,7 +85,7 @@
* be stored. In such cases, application will be notified with DM_DEVICE_CONTEXT_FULL * be stored. In such cases, application will be notified with DM_DEVICE_CONTEXT_FULL
* as event result at the completion of the security procedure. * as event result at the completion of the security procedure.
*/ */
#define DEVICE_MANAGER_MAX_BONDS 4 #define DEVICE_MANAGER_MAX_BONDS 2
/** /**