Add compact chunked client API payload - #980
Conversation
|
Warning Review limit reached
Next review available in: 29 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR introduces ChangesClient API chunked payload transport
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
|
Compatibility note for reviewers: this intentionally reuses and reshapes the existing |
90d0af5 to
fff560d
Compare
fff560d to
8bd7dda
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@meshtastic/mesh.proto`:
- Around line 2997-3001: Update ClientApiChunkedPayload.payload_size to an
optional uint32 field so presence distinguishes first chunks from continuation
chunks, including empty first payloads. Preserve the existing field number and
documentation.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 62d6cfc0-f153-45af-afd3-e34ec1fe35f2
📒 Files selected for processing (2)
meshtastic/mesh.optionsmeshtastic/mesh.proto
🚧 Files skipped from review as they are similar to previous changes (1)
- meshtastic/mesh.options
Summary
Add a compact, ordered
ClientApiChunkedPayloadwrapper for Meshtastic client API transports that must carry serializedToRadioandFromRadiomessages over small BLE characteristic reads and writes.The immediate use case is Garmin Connect IQ, where public BLE writes are limited to 20 bytes and ATT long reads are unavailable.
Related firmware implementation: meshtastic/firmware#10928
What changed
ClientApiChunkedPayload.payload_size = 1asuint32, with nanopbint_size:16.ClientApiChunkedPayload.payload_chunk = 2asbytes, with nanopbmax_size:228.ToRadio.chunked_payload = 8.FromRadio.chunked_payload = 20.Compatibility
This uses a new message type rather than repurposing the existing
ChunkedPayloadschema. The existing four-fieldChunkedPayload(payload_id,chunk_count,chunk_index, andpayload_chunk) andChunkedPayloadResponseremain unchanged for their current users.Existing clients ignore the new
ToRadioandFromRadiofields. Firmware emits chunked responses only after a client has successfully opted in by completing a chunked request.Transport behavior
The first chunk carries
payload_sizeandpayload_chunk. Continuation chunks carry onlypayload_chunk. The transport assumes ordered, reliable delivery on one connection, avoiding IDs, counts, and indices in every 20-byte packet.With the corresponding firmware implementation, a 20-byte transport frame carries 13 bytes in the first
ToRadiochunk and 16 thereafter, or 12 bytes in the firstFromRadiochunk and 15 thereafter.Validation
ChunkedPayloadserialization vector remains080110021803220104.nrf52_promicro_diy_tcxoandheltec-v4, then completed a live Heltec V4 to Garmin D2 Mach 2 BLE round trip.