Skip to content

Make NVS namespace adjustable #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: nimble-1.6.0-idf
Choose a base branch
from

Conversation

vodka-bears
Copy link

@vodka-bears vodka-bears commented May 24, 2025

  • Introduce static string nimble_nvs_namespace that is used instead of the old NIMBLE_NVS_NAMESPACE macro.
  • Add function int ble_store_set_namespace(const char * namespace_str) that allows for changing namespace string.
  • Rename NIMBLE_NVS_NAMESPACE to NIMBLE_NVS_NAMESPACE_DEFAULT.
  • Replace occurrences of macro NIMBLE_NVS_NAMESPACE with variable nimble_nvs_namespace.

Description

Developing a custom project I realized that I need to run several devices with different addresses on the same hardware. The purpose of the change is to make it possible.

I abstained from mentioning the new function in any headers. Users can make a forward declaration if they need to change the namespace string.

Related

Fixes #95

Testing

Works well in my project. Bonds separately to the same host or to multiple hosts and bonding remains consistent and isolated.


Checklist

Before submitting a Pull Request, please ensure the following:

  • 🚨 This PR does not introduce breaking changes.
  • All CI checks (GH Actions) pass.
  • Documentation is updated as needed.
  • Tests are updated or added as necessary.
  • Code is well-commented, especially in complex areas.
  • Git history is clean — commits are squashed to the minimum necessary.

Introduce static string nimble_nvs_namespace that is used instead of the old NIMBLE_NVS_NAMESPACE macro.

Add function int ble_store_set_namespace(const char * namespace_str) that allows for changing namespace string.

Rename NIMBLE_NVS_NAMESPACE to NIMBLE_NVS_NAMESPACE_DEFAULT.

Replace occurrences of macro NIMBLE_NVS_NAMESPACE with variable nimble_nvs_namespace.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace a hardcoded NVS namespace to a customizable one
1 participant