Conversation
Copilot
AI
changed the title
[WIP] Add autodetection for NimBLE-Arduino v1 or v2
Add compile-time version macros and runtime version function to NimBLEVersions.h
Mar 17, 2026
h2zero
requested changes
Mar 17, 2026
Copilot
AI
changed the title
Add compile-time version macros and runtime version function to NimBLEVersions.h
Add compile-time version macros and NimBLEDevice::getNimbleVersion() to NimBLEVersion.h
Mar 17, 2026
h2zero
requested changes
Mar 17, 2026
Copilot
AI
changed the title
Add compile-time version macros and NimBLEDevice::getNimbleVersion() to NimBLEVersion.h
Add compile-time version macros and NimBLEDevice::getVersion() to NimBLEVersion.h
Mar 17, 2026
h2zero
requested changes
Mar 17, 2026
Copilot
AI
changed the title
Add compile-time version macros and NimBLEDevice::getVersion() to NimBLEVersion.h
Add compile-time version macros and NimBLEDevice::getVersion() to NimBLECppVersion.h
Mar 17, 2026
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
13422b2 to
58a7ebe
Compare
Co-authored-by: h2zero <32826625+h2zero@users.noreply.github.com>
58a7ebe to
fd55307
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No standard mechanism existed to detect NimBLE-Arduino version at compile-time (e.g. to differentiate v1 vs v2) or query it at runtime.
Changes
New
src/NimBLECppVersion.h— standalone header (no BLE stack dependency) providing:NIMBLE_CPP_VERSION_MAJOR/_MINOR/_PATCH— individual component macrosNIMBLE_CPP_VERSION_VAL(major, minor, patch)— constructs a comparable integerNIMBLE_CPP_VERSION— current version as a single integer for#ifguardsNIMBLE_CPP_VERSION_STR— version string derived via stringification from the component macros (no hardcoded duplicate)src/NimBLEDevice.h— includesNimBLECppVersion.houtside theCONFIG_BT_NIMBLE_ENABLEDguard so version info is always available regardless of BLE stack configuration, and declaresstatic const char* getVersion()src/NimBLEDevice.cpp— implementsNimBLEDevice::getVersion()returning the version string at runtimeUsage
Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.