Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughReplaced the compile-time NVS namespace with a runtime-configurable namespace and added Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/nimble/nimble/host/store/config/src/ble_store_nvs.c`:
- Around line 65-69: The current branch treats a NULL ns the same as an overly
long string and logs "Namespace string is too long", which is misleading; update
the conditional in the setter so you first check if ns == NULL and in that case
quietly assign NIMBLE_NVS_NAMESPACE = NIMBLE_NVS_DEFAULT_NAMESPACE (or log at
debug/verbose level), otherwise validate strlen(ns) against
NIMBLE_NVS_STR_NAME_MAX_LEN and only log an ESP_LOGE via LOG_TAG when the length
check fails before assigning the default; reference the symbols ns,
NIMBLE_NVS_NAMESPACE, NIMBLE_NVS_DEFAULT_NAMESPACE, NIMBLE_NVS_STR_NAME_MAX_LEN
and LOG_TAG when making this change.
- Around line 62-71: set_nvs_namespace currently stores the caller's pointer
into NIMBLE_NVS_NAMESPACE which can lead to dangling pointers; change it to copy
the incoming string into a static buffer and point NIMBLE_NVS_NAMESPACE at that
buffer (ensure the buffer size uses NIMBLE_NVS_STR_NAME_MAX_LEN, always
null-terminate, and fall back to NIMBLE_NVS_DEFAULT_NAMESPACE on overflow);
validate ns != NULL and strlen(ns) < NIMBLE_NVS_STR_NAME_MAX_LEN before copying,
log via ESP_LOGE(LOG_TAG) on overflow and use the static buffer contents
thereafter so callers may pass stack or heap strings safely.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2bece196-cfc6-4b74-8f9b-673b941bd580
📒 Files selected for processing (2)
src/nimble/nimble/host/store/config/src/ble_store_nvs.csrc/nimconfig.h
9e9daac to
1e0f0f3
Compare
* Adds the function `set_nimble_nvs_namespace(const char*)` for users to switch bond data stores.
1e0f0f3 to
8e60f7c
Compare
Adds the function
set_nvs_namespace(const char*)for users to switch bond data stores.Fixes #959
Fixes #1102
Summary by CodeRabbit
New Features
Bug Fixes