Add NimBLEServer::sendServiceChangedIndication#409
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 (4)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughArrr — Public Changes
Sequence Diagram(s)sequenceDiagram
participant Characteristic as Characteristic
participant Service as Service
participant Server as NimBLEServer
participant BLE as BLE_Stack
Note over Characteristic,Service: On add/remove descriptor/characteristic
Characteristic->>Server: setServiceChanged()
Service->>Server: setServiceChanged()
Server->>Server: set m_svcChanged = true
Note over Server,BLE: On server start
Server->>Server: if m_svcChanged then clear flag
Server->>BLE: sendServiceChangedIndication() \n(ble_svc_gatt_changed(0x0001,0xffff))
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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.
🧹 Nitpick comments (1)
src/NimBLEServer.h (1)
126-126: Ahoy: consider renamin’ the private helper for clearer intent.Now that the public API changed, a name like
markServiceChanged()would better signal that this one sets internal state, notifies none.🏴☠️ Optional refactor sketch
- void serviceChanged(); + void markServiceChanged();-void NimBLEServer::serviceChanged() { +void NimBLEServer::markServiceChanged() { if (m_gattsStarted) { m_svcChanged = true; } -} // serviceChanged +} // markServiceChanged- serviceChanged(); + markServiceChanged();🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/NimBLEServer.h` at line 126, The private helper currently named serviceChanged() should be renamed to markServiceChanged() to clarify it only sets internal state and does not notify; update the declaration in the NimBLEServer class (serviceChanged -> markServiceChanged), rename the corresponding definition/implementation to markServiceChanged, and update every call site that invokes serviceChanged() to call markServiceChanged() instead; ensure visibility (private) and any forward declarations or tests are updated to use the new name.
🤖 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/NimBLEServer.h`:
- Line 126: The private helper currently named serviceChanged() should be
renamed to markServiceChanged() to clarify it only sets internal state and does
not notify; update the declaration in the NimBLEServer class (serviceChanged ->
markServiceChanged), rename the corresponding definition/implementation to
markServiceChanged, and update every call site that invokes serviceChanged() to
call markServiceChanged() instead; ensure visibility (private) and any forward
declarations or tests are updated to use the new name.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 99c99f9d-828f-4878-84cc-b2273a56364b
📒 Files selected for processing (2)
src/NimBLEServer.cppsrc/NimBLEServer.h
602daf3 to
d5148d3
Compare
This reverts changing NimBLEServer::serviceChanged from private to public and adds a new function that is more user firendly to indicate to clients that the services should be re-discovered. * Renames serviceChanged to setServiceChanged to better indicate its function.
d5148d3 to
98b379d
Compare
chmorgan
left a comment
There was a problem hiding this comment.
sendServiceChangedIndication() looks good, and the flag for sending it at startup seems like the right approach although I'm not sure I have a good use case to test it.
This reverts changing NimBLEServer::serviceChanged from private to public and adds a new function that is more user firendly to indicate to clients that the services should be re-discovered.
Summary by CodeRabbit