File tree Expand file tree Collapse file tree
nimble/nimble/host/store/config/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4242#define NIMBLE_NVS_CCCD_SEC_KEY "cccd_sec"
4343#define NIMBLE_NVS_CSFC_SEC_KEY "csfc_sec"
4444#define NIMBLE_NVS_PEER_RECORDS_KEY "p_dev_rec"
45- #define NIMBLE_NVS_NAMESPACE "nimble_bond"
45+ #define NIMBLE_NVS_DEFAULT_NAMESPACE "nimble_bond"
4646
4747#if MYNEWT_VAL (ENC_ADV_DATA )
4848#define NIMBLE_NVS_EAD_SEC_KEY "ead_sec"
5353typedef uint32_t nvs_handle_t ;
5454
5555static const char * LOG_TAG = "NIMBLE_NVS" ;
56+ static const char * NIMBLE_NVS_NAMESPACE = NIMBLE_NVS_DEFAULT_NAMESPACE ;
5657
5758/*****************************************************************************
5859 * $ MISC *
5960 *****************************************************************************/
6061
62+ void
63+ set_nvs_namespace (const char * ns )
64+ {
65+ if (ns != NULL && strlen (ns ) < NIMBLE_NVS_STR_NAME_MAX_LEN ) {
66+ NIMBLE_NVS_NAMESPACE = ns ;
67+ } else {
68+ ESP_LOGE (LOG_TAG , "Namespace string is too long, using default namespace" );
69+ NIMBLE_NVS_NAMESPACE = NIMBLE_NVS_DEFAULT_NAMESPACE ;
70+ }
71+ }
72+
6173static void
6274get_nvs_key_string (int obj_type , int index , char * key_string )
6375{
Original file line number Diff line number Diff line change 190190# define MYNEWT_VAL_BLE_HCI_VS (0)
191191# endif
192192
193+ # ifdef __cplusplus
194+ extern "C" void set_nvs_namespace (const char * ns );
195+ # endif
196+
193197#else // !ESP_PLATFORM
194198# if defined(NRF51 )
195199# include "syscfg/devcfg/nrf51cfg.h"
You can’t perform that action at this time.
0 commit comments