Repository navigation
refactor(examples): AutoResearchRemote bind*Methods take fl::Remote& (non-null by type) - #3189
Conversation
…(non-null by type) Follow-up to #3188. mRemote is created in the AutoResearchRemoteControl constructor and never reassigned to null — the bind targets are non-nullable by construction. Express that in the type system by switching from fl::Remote* to fl::Remote&. Header signatures: void bindBasicMethods(fl::Remote& remote); // ... etc, 7 binders ... Caller (registerFunctions shell): bindBasicMethods(*mRemote); // was mRemote.get() bindFlexioMethods(*mRemote); ... Call sites inside each binder: remote.bind("status", ...); // was remote->bind(...) Mechanical sweep: 50 remote->bind sites rewritten to remote.bind across the 7 binder .cpp files; signatures updated in header + each .cpp; core shell now dereferences mRemote at the call site. Verified: bash compile wasm --examples AutoResearch — success (library 59.60 s, sketch 3.02 s, link 4.89 s, total 76.96 s). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
📝 WalkthroughWalkthroughAll seven private ChangesRemote bind*Methods pointer-to-reference refactor
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
✨ 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 |
…ey test (#3191) Follow-up to #3187/#3188/#3189. Old names were partly implementation-named (FlexIO is Teensy-only), partly vague (Basic, Coroutine). Renaming so each group describes WHAT the RPCs exercise. Rename map: bindBasicMethods → bindSystemMethods // status, ping, debug, help bindFlexioMethods → bindDriverMethods // LED driver tests (FlexIO today) bindGpioMethods → bindPinMethods // pin config (GPIO is impl) bindBenchmarkMethods → bindMathMethods // SIMD/animartrix/wave/parlio bindAsyncNetMethods → bindNetworkMethods // WiFi/OTA/BLE/codec/testAsync bindCoroutineMethods → bindAsyncMethods // coroutine + promise primitives bindPerfMethods → bindBenchmarkMethods // perfProbe* + wave2dPerf Files renamed (git mv preserves history): BasicMethods.cpp → SystemMethods.cpp FlexioMethods.cpp → DriverMethods.cpp GpioMethods.cpp → PinMethods.cpp BenchmarkMethods.cpp → MathMethods.cpp AsyncNetMethods.cpp → NetworkMethods.cpp CoroutineMethods.cpp → AsyncMethods.cpp PerfMethods.cpp → BenchmarkMethods.cpp (swap: was PerfMethods, takes BenchmarkMethods name now) Header file-comments rewritten to describe the *category* rather than enumerate every RPC — categories are stable, RPC lists drift. Driver bin's comment notes the platform-specificity intent: today it holds Teensy 4.x FlexIO RX validation; future platform-specific driver tests for other MCUs land in the same bin, gated by per-binding #if guards rather than file-level partitioning. Verified: bash compile wasm --examples AutoResearch — success (library 40.03 s, sketch 2.89 s, link 6.05 s, total 59.89 s). Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Follow-up to #3188.
mRemoteis non-null by construction (assigned in the ctor, never reset) — express that in the type system with a reference.Before:
void bindBasicMethods(fl::Remote* remote),remote->bind(...),bindBasicMethods(mRemote.get())After:
void bindBasicMethods(fl::Remote& remote),remote.bind(...),bindBasicMethods(*mRemote)Mechanical sweep: 50
remote->bindsites rewritten toremote.bindacross 7 binder files; signatures updated; core shell dereferencesmRemoteat each call.Verified:
bash compile wasm --examples AutoResearch— success (76.96 s total).Generated with Claude Code.
Summary by CodeRabbit