Conversation
📝 WalkthroughWalkthroughArr — Replaced many Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (4)
src/NimBLERemoteValueAttribute.h (1)
24-28: Arr, the logic be sound but the formattin' be a bit off-keel!The
#ifdefon line 24 be lackin' the space after#that the other nested directives in this PR be usin' (e.g.,# ifdefinsrc/NimBLEScan.h,src/NimBLEClient.h). 'Tis a minor cosmetic matter, but consistency across the fleet makes fer easier navigation, savvy?🧹 Optional: Align indentation with other files
-#ifdef USING_NIMBLE_ARDUINO_HEADERS -# include "nimble/nimble/host/include/host/ble_gatt.h" +# ifdef USING_NIMBLE_ARDUINO_HEADERS +# include "nimble/nimble/host/include/host/ble_gatt.h" # else # include "host/ble_gatt.h" # endif🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/NimBLERemoteValueAttribute.h` around lines 24 - 28, Update the preprocessor directive formatting for the conditional that checks USING_NIMBLE_ARDUINO_HEADERS so it matches the project's style (space after the # and consistent indentation for the nested # if/ # else/ # endif); locate the block that references the USING_NIMBLE_ARDUINO_HEADERS macro and the two include lines for "nimble/nimble/host/include/host/ble_gatt.h" and "host/ble_gatt.h" in NimBLERemoteValueAttribute.h and change the directives to use the same "# ifdef", "# else", and "# endif" spacing/indentation pattern used in other files like NimBLEScan.h and NimBLEClient.h.src/NimBLEAdvertising.h (1)
24-28: Same formattin' quirk as before, captain!Arr, the
#ifdefon line 24 be missin' that space after the#, just like insrc/NimBLERemoteValueAttribute.h. The functionality be correct, but ye might want to hoist the same flag fer consistency across yer fleet.🧹 Optional: Align indentation with other files
-#ifdef USING_NIMBLE_ARDUINO_HEADERS +# ifdef USING_NIMBLE_ARDUINO_HEADERS # include "nimble/nimble/host/include/host/ble_gap.h" # else # include "host/ble_gap.h" # endif🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/NimBLEAdvertising.h` around lines 24 - 28, The preprocessor directives in src/NimBLEAdvertising.h use inconsistent hashing spacing; update the directives to match the style used in src/NimBLERemoteValueAttribute.h by adding a space after the '#' in each directive (change "#ifdef USING_NIMBLE_ARDUINO_HEADERS" to "# ifdef USING_NIMBLE_ARDUINO_HEADERS", and similarly change "# else" and "# endif" to use consistent "# else" and "# endif" spacing), ensuring the include lines (e.g., the "include" lines that reference "nimble/nimble/host/include/host/ble_gap.h" and "host/ble_gap.h") keep their current indentation so the file's preprocessor formatting is consistent with the rest of the codebase.src/NimBLEAdvertising.cpp (1)
21-26: Arr, same barnacle as before, matey!The header path change be correct for the GAP service, but ye've got the same formatting inconsistency as
NimBLEAdvertisementData.cpp- line 21 uses#ifdefwhile lines 23-25 use# elseand# endifwith spaces after the#.🔧 Optional fix for consistent formatting
-#ifdef USING_NIMBLE_ARDUINO_HEADERS +# ifdef USING_NIMBLE_ARDUINO_HEADERS🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/NimBLEAdvertising.cpp` around lines 21 - 26, The preprocessor directives in NimBLEAdvertising.cpp are inconsistently formatted: change the spaced directives "# else" and "# endif" to match the style of "#ifdef" (use "#else" and "#endif" with no extra space) so the block that checks USING_NIMBLE_ARDUINO_HEADERS and includes "nimble/nimble/host/services/gap/include/services/gap/ble_svc_gap.h" or "services/gap/ble_svc_gap.h" uses consistent directive formatting (update the "# else" and "# endif" tokens to "#else" and "#endif").src/NimBLEAdvertisementData.cpp (1)
26-30: Arr, ye got a wee formatting barnacle on the hull here!The change be functionally correct, matey, but there be a small inconsistency in yer formatting. Line 26 uses
#ifdef(no space after#), while lines 28-30 use# elseand# endif(with space). Other files in this here PR likeNimBLEScan.cppuse# ifdefwith the space.🔧 Optional fix for consistent formatting
-#ifdef USING_NIMBLE_ARDUINO_HEADERS +# ifdef USING_NIMBLE_ARDUINO_HEADERS🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/NimBLEAdvertisementData.cpp` around lines 26 - 30, The preprocessor directives in NimBLEAdvertisementData.cpp are inconsistently spaced; change the block using `#ifdef USING_NIMBLE_ARDUINO_HEADERS` / `# else` / `# endif` to match the project's style (use the same spacing as other files such as `# ifdef` / `# else` / `# endif`), so update the directives around the includes for "nimble/nimble/host/include/host/ble_hs_adv.h" and "host/ble_hs_adv.h" to use the consistent `# ifdef` / `# else` / `# endif` spacing.
🤖 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/nimconfig.h`:
- Line 229: Update the inline comment that currently reads "theesp-nimble-cpp"
to correct the typo by inserting a space so it reads "the esp-nimble-cpp"
(locate the comment containing the string "theesp-nimble-cpp" in nimconfig.h and
replace it with "the esp-nimble-cpp").
---
Nitpick comments:
In `@src/NimBLEAdvertisementData.cpp`:
- Around line 26-30: The preprocessor directives in NimBLEAdvertisementData.cpp
are inconsistently spaced; change the block using `#ifdef
USING_NIMBLE_ARDUINO_HEADERS` / `# else` / `# endif` to match the project's
style (use the same spacing as other files such as `# ifdef` / `# else` / `#
endif`), so update the directives around the includes for
"nimble/nimble/host/include/host/ble_hs_adv.h" and "host/ble_hs_adv.h" to use
the consistent `# ifdef` / `# else` / `# endif` spacing.
In `@src/NimBLEAdvertising.cpp`:
- Around line 21-26: The preprocessor directives in NimBLEAdvertising.cpp are
inconsistently formatted: change the spaced directives "# else" and "# endif" to
match the style of "#ifdef" (use "#else" and "#endif" with no extra space) so
the block that checks USING_NIMBLE_ARDUINO_HEADERS and includes
"nimble/nimble/host/services/gap/include/services/gap/ble_svc_gap.h" or
"services/gap/ble_svc_gap.h" uses consistent directive formatting (update the "#
else" and "# endif" tokens to "#else" and "#endif").
In `@src/NimBLEAdvertising.h`:
- Around line 24-28: The preprocessor directives in src/NimBLEAdvertising.h use
inconsistent hashing spacing; update the directives to match the style used in
src/NimBLERemoteValueAttribute.h by adding a space after the '#' in each
directive (change "#ifdef USING_NIMBLE_ARDUINO_HEADERS" to "# ifdef
USING_NIMBLE_ARDUINO_HEADERS", and similarly change "# else" and "# endif" to
use consistent "# else" and "# endif" spacing), ensuring the include lines
(e.g., the "include" lines that reference
"nimble/nimble/host/include/host/ble_gap.h" and "host/ble_gap.h") keep their
current indentation so the file's preprocessor formatting is consistent with the
rest of the codebase.
In `@src/NimBLERemoteValueAttribute.h`:
- Around line 24-28: Update the preprocessor directive formatting for the
conditional that checks USING_NIMBLE_ARDUINO_HEADERS so it matches the project's
style (space after the # and consistent indentation for the nested # if/ # else/
# endif); locate the block that references the USING_NIMBLE_ARDUINO_HEADERS
macro and the two include lines for "nimble/nimble/host/include/host/ble_gatt.h"
and "host/ble_gatt.h" in NimBLERemoteValueAttribute.h and change the directives
to use the same "# ifdef", "# else", and "# endif" spacing/indentation pattern
used in other files like NimBLEScan.h and NimBLEClient.h.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b3bfda2f-6132-46fd-ba5e-d02bc4227383
📒 Files selected for processing (28)
src/NimBLEAddress.hsrc/NimBLEAdvertisedDevice.hsrc/NimBLEAdvertisementData.cppsrc/NimBLEAdvertising.cppsrc/NimBLEAdvertising.hsrc/NimBLEAttValue.cppsrc/NimBLECharacteristic.cppsrc/NimBLEClient.cppsrc/NimBLEClient.hsrc/NimBLEConnInfo.hsrc/NimBLEDevice.cppsrc/NimBLEDevice.hsrc/NimBLEExtAdvertising.cppsrc/NimBLEExtAdvertising.hsrc/NimBLEL2CAPChannel.cppsrc/NimBLEL2CAPChannel.hsrc/NimBLELocalValueAttribute.hsrc/NimBLELog.hsrc/NimBLERemoteValueAttribute.hsrc/NimBLEScan.cppsrc/NimBLEScan.hsrc/NimBLEServer.cppsrc/NimBLEServer.hsrc/NimBLEStream.cppsrc/NimBLEStream.hsrc/NimBLEUUID.hsrc/NimBLEUtils.cppsrc/nimconfig.h
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/NimBLEUUID.h (1)
24-28: Arr, the treasure map be correct, but the handwritin' be a wee bit wobbly!The logic be sound for selectin' the
ble_uuid.hheader path. However, me keen pirate eye spots a minor formattin' inconsistency: Line 26 uses#elsewhile Line 28 uses# endif(with a space). Other files in yer fleet use# elsewith a space.🏴☠️ Optional formatting fix for consistency
`#ifdef` USING_NIMBLE_ARDUINO_HEADERS # include "nimble/nimble/host/include/host/ble_uuid.h" -#else +# else # include "host/ble_uuid.h" # endif🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/NimBLEUUID.h` around lines 24 - 28, Preprocessor spacing is inconsistent around the USING_NIMBLE_ARDUINO_HEADERS conditional: change the directives so they match the project's style (use a space after '#' for conditional directives). Specifically, update the block that checks USING_NIMBLE_ARDUINO_HEADERS (the lines containing "#else" and "# endif") to use "# else" and "# endif" so both directives follow the same spacing convention as other files.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/NimBLEUUID.h`:
- Around line 24-28: Preprocessor spacing is inconsistent around the
USING_NIMBLE_ARDUINO_HEADERS conditional: change the directives so they match
the project's style (use a space after '#' for conditional directives).
Specifically, update the block that checks USING_NIMBLE_ARDUINO_HEADERS (the
lines containing "#else" and "# endif") to use "# else" and "# endif" so both
directives follow the same spacing convention as other files.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 69c65631-12fd-4994-9b91-f3b31ae0f7c3
📒 Files selected for processing (28)
src/NimBLEAddress.hsrc/NimBLEAdvertisedDevice.hsrc/NimBLEAdvertisementData.cppsrc/NimBLEAdvertising.cppsrc/NimBLEAdvertising.hsrc/NimBLEAttValue.cppsrc/NimBLECharacteristic.cppsrc/NimBLEClient.cppsrc/NimBLEClient.hsrc/NimBLEConnInfo.hsrc/NimBLEDevice.cppsrc/NimBLEDevice.hsrc/NimBLEExtAdvertising.cppsrc/NimBLEExtAdvertising.hsrc/NimBLEL2CAPChannel.cppsrc/NimBLEL2CAPChannel.hsrc/NimBLELocalValueAttribute.hsrc/NimBLELog.hsrc/NimBLERemoteValueAttribute.hsrc/NimBLEScan.cppsrc/NimBLEScan.hsrc/NimBLEServer.cppsrc/NimBLEServer.hsrc/NimBLEStream.cppsrc/NimBLEStream.hsrc/NimBLEUUID.hsrc/NimBLEUtils.cppsrc/nimconfig.h
✅ Files skipped from review due to trivial changes (9)
- src/NimBLEAdvertisementData.cpp
- src/nimconfig.h
- src/NimBLEScan.h
- src/NimBLEScan.cpp
- src/NimBLEAdvertising.cpp
- src/NimBLEStream.cpp
- src/NimBLEAdvertisedDevice.h
- src/NimBLEExtAdvertising.cpp
- src/NimBLEDevice.cpp
🚧 Files skipped from review as they are similar to previous changes (13)
- src/NimBLEAttValue.cpp
- src/NimBLEL2CAPChannel.cpp
- src/NimBLEServer.h
- src/NimBLEStream.h
- src/NimBLECharacteristic.cpp
- src/NimBLEDevice.h
- src/NimBLERemoteValueAttribute.h
- src/NimBLEAddress.h
- src/NimBLELog.h
- src/NimBLEClient.cpp
- src/NimBLEL2CAPChannel.h
- src/NimBLEExtAdvertising.h
- src/NimBLEServer.cpp
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/NimBLEConnInfo.h`:
- Around line 21-24: Add a direct include of nimconfig.h at the top of
NimBLEConnInfo.h so the USING_NIMBLE_ARDUINO_HEADERS macro is always defined
before the `#ifdef` branch; then fix the conditional include block that references
host/ble_gap.h by either removing the non-existent fallback or replacing it with
the correct repository include path so the include in NimBLEConnInfo.h is
self-contained (update the `#ifdef` USING_NIMBLE_ARDUINO_HEADERS ... `#else` ...
`#endif` block accordingly).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e9299496-30bb-4414-952a-5db09233540e
📒 Files selected for processing (28)
src/NimBLEAddress.hsrc/NimBLEAdvertisedDevice.hsrc/NimBLEAdvertisementData.cppsrc/NimBLEAdvertising.cppsrc/NimBLEAdvertising.hsrc/NimBLEAttValue.cppsrc/NimBLECharacteristic.cppsrc/NimBLEClient.cppsrc/NimBLEClient.hsrc/NimBLEConnInfo.hsrc/NimBLEDevice.cppsrc/NimBLEDevice.hsrc/NimBLEExtAdvertising.cppsrc/NimBLEExtAdvertising.hsrc/NimBLEL2CAPChannel.cppsrc/NimBLEL2CAPChannel.hsrc/NimBLELocalValueAttribute.hsrc/NimBLELog.hsrc/NimBLERemoteValueAttribute.hsrc/NimBLEScan.cppsrc/NimBLEScan.hsrc/NimBLEServer.cppsrc/NimBLEServer.hsrc/NimBLEStream.cppsrc/NimBLEStream.hsrc/NimBLEUUID.hsrc/NimBLEUtils.cppsrc/nimconfig.h
✅ Files skipped from review due to trivial changes (13)
- src/NimBLEAdvertising.h
- src/NimBLELocalValueAttribute.h
- src/NimBLEL2CAPChannel.cpp
- src/nimconfig.h
- src/NimBLEUtils.cpp
- src/NimBLEExtAdvertising.cpp
- src/NimBLEScan.h
- src/NimBLEScan.cpp
- src/NimBLEUUID.h
- src/NimBLEStream.cpp
- src/NimBLEAdvertisementData.cpp
- src/NimBLEClient.cpp
- src/NimBLEAdvertisedDevice.h
🚧 Files skipped from review as they are similar to previous changes (10)
- src/NimBLEClient.h
- src/NimBLEStream.h
- src/NimBLEServer.h
- src/NimBLERemoteValueAttribute.h
- src/NimBLECharacteristic.cpp
- src/NimBLEExtAdvertising.h
- src/NimBLELog.h
- src/NimBLEAddress.h
- src/NimBLEDevice.cpp
- src/NimBLEAttValue.cpp
| #ifdef USING_NIMBLE_ARDUINO_HEADERS | ||
| # include "nimble/nimble/host/include/host/ble_gap.h" | ||
| #else | ||
| # include "host/ble_gap.h" |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Macro definition =="
rg -n '^\s*#\s*define\s+USING_NIMBLE_ARDUINO_HEADERS\b' src/nimconfig.h
echo
echo "== Include gate location in src/NimBLEConnInfo.h =="
nl -ba src/NimBLEConnInfo.h | sed -n '1,40p'
echo
echo "== Candidate ble_gap.h paths in repo =="
fd -a 'ble_gap\.h$' | rg '/host/ble_gap\.h$|/nimble/nimble/host/include/host/ble_gap\.h$' || true
echo
echo "== Files including NimBLEConnInfo.h =="
rg -n '#\s*include\s*"NimBLEConnInfo\.h"'Repository: h2zero/NimBLE-Arduino
Length of output: 245
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== First 40 lines of src/NimBLEConnInfo.h =="
head -40 src/NimBLEConnInfo.h
echo
echo "== Check if nimconfig.h is included in src/NimBLEConnInfo.h =="
rg -n 'nimconfig\.h' src/NimBLEConnInfo.h || echo "(not found)"
echo
echo "== Check ble_gap.h paths =="
fd -a 'ble_gap\.h$'
echo
echo "== Files directly including NimBLEConnInfo.h =="
rg -l 'include.*NimBLEConnInfo\.h' src/ || echo "(none found)"
echo
echo "== Sample: first includer of NimBLEConnInfo.h =="
rg -B5 -A2 'include.*NimBLEConnInfo\.h' src/ | head -30 || trueRepository: h2zero/NimBLE-Arduino
Length of output: 2033
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== src/NimBLEDevice.h: lines around NimBLEConnInfo.h include =="
rg -B20 -A5 'include.*NimBLEConnInfo\.h' src/NimBLEDevice.h
echo
echo "== Check if nimconfig.h is included in src/NimBLEDevice.h =="
rg -n 'nimconfig\.h' src/NimBLEDevice.h | head -5
echo
echo "== Verify USING_NIMBLE_ARDUINO_HEADERS in nimconfig.h =="
grep -n 'USING_NIMBLE_ARDUINO_HEADERS' src/nimconfig.hRepository: h2zero/NimBLE-Arduino
Length of output: 834
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Files that include nimconfig.h =="
rg -l 'nimconfig\.h' src/ | head -10
echo
echo "== Check for Arduino/build system includes =="
rg -r -n '#\s*include.*nimconfig\.h' src/ | head -10 || echo "(pattern not found)"
echo
echo "== First 50 lines of src/NimBLEDevice.h =="
head -50 src/NimBLEDevice.h
echo
echo "== Check if Arduino.h or config brings in nimconfig =="
rg -l 'Arduino\.h|nimble_host_config\.h' src/ | head -5Repository: h2zero/NimBLE-Arduino
Length of output: 1727
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Contents of src/syscfg/syscfg.h =="
head -60 src/syscfg/syscfg.h
echo
echo "== Check if nimconfig.h defines USING_NIMBLE_ARDUINO_HEADERS =="
grep -A2 -B2 'USING_NIMBLE_ARDUINO_HEADERS' src/nimconfig.h
echo
echo "== Direct include pattern: does user code directly include NimBLEConnInfo.h? =="
rg 'include.*NimBLEConnInfo' --type cpp --type h . 2>/dev/null | grep -v src/NimBLEDevice.h || echo "(only from NimBLEDevice.h)"
echo
echo "== Verify fallback path really doesn't exist =="
find . -path "*/host/ble_gap.h" 2>/dev/null || echo "(confirmed: fallback path not in repo)"Repository: h2zero/NimBLE-Arduino
Length of output: 2286
Ensure header includes its config dependency before conditional path branching.
Arrr, src/NimBLEConnInfo.h be lacking a direct include o' nimconfig.h, so the USING_NIMBLE_ARDUINO_HEADERS macro may not be in scope at Lines 21–24. The fallback path host/ble_gap.h does not exist in the repo either, makin' the fallback liable to fail. While currently 'tis only included from src/NimBLEDevice.h (where the macro is visible through syscfg.h), proper header design requires each header to be self-contained.
⚙️ Proposed fix
+#include "nimconfig.h"
`#ifdef` USING_NIMBLE_ARDUINO_HEADERS
# include "nimble/nimble/host/include/host/ble_gap.h"
`#else`
# include "host/ble_gap.h"
`#endif`📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| #ifdef USING_NIMBLE_ARDUINO_HEADERS | |
| # include "nimble/nimble/host/include/host/ble_gap.h" | |
| #else | |
| # include "host/ble_gap.h" | |
| `#include` "nimconfig.h" | |
| `#ifdef` USING_NIMBLE_ARDUINO_HEADERS | |
| # include "nimble/nimble/host/include/host/ble_gap.h" | |
| `#else` | |
| # include "host/ble_gap.h" | |
| `#endif` |
🧰 Tools
🪛 Clang (14.0.6)
[error] 24-24: 'host/ble_gap.h' file not found
(clang-diagnostic-error)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/NimBLEConnInfo.h` around lines 21 - 24, Add a direct include of
nimconfig.h at the top of NimBLEConnInfo.h so the USING_NIMBLE_ARDUINO_HEADERS
macro is always defined before the `#ifdef` branch; then fix the conditional
include block that references host/ble_gap.h by either removing the non-existent
fallback or replacing it with the correct repository include path so the include
in NimBLEConnInfo.h is self-contained (update the `#ifdef`
USING_NIMBLE_ARDUINO_HEADERS ... `#else` ... `#endif` block accordingly).
Summary by CodeRabbit
Chores
Refactor