FastLED 3.9.15
Loading...
Searching...
No Matches

◆ registerAllMethods()

void AutoResearchRemoteControl::registerAllMethods ( fl::Remote * remote)
private

Register all RPC methods on a given Remote instance.

Definition at line 3635 of file AutoResearchRemote.cpp.

3635 {
3636 // Register the core methods that BLE remote needs.
3637 // This registers a subset of methods — enough for ping/pong PoC.
3638
3639 // Register "ping" function - health check with timestamp
3640 remote->bind("ping", [this](const fl::json& args) -> fl::json {
3641 uint32_t now = millis();
3642 fl::json response = fl::json::object();
3643 response.set("success", true);
3644 response.set("message", "pong");
3645 response.set("timestamp", static_cast<int64_t>(now));
3646 response.set("uptimeMs", static_cast<int64_t>(now));
3647 response.set("transport", "ble");
3648 return response;
3649 });
3650
3651 // Register "status" function - device readiness check
3652 remote->bind("status", [this](const fl::json& args) -> fl::json {
3653 fl::json status = fl::json::object();
3654 status.set("ready", true);
3655 status.set("pinTx", static_cast<int64_t>(mState->pin_tx));
3656 status.set("pinRx", static_cast<int64_t>(mState->pin_rx));
3657 status.set("transport", "ble");
3658 return status;
3659 });
3660}
fl::unique_ptr< fl::Remote > remote
Definition RpcClient.ino:43
fl::shared_ptr< AutoResearchState > mState
void bind(const Config< Callable > &config)
Register method with config (name, function, optional metadata)
Definition remote.h:85
void set(const fl::string &key, const json &value) FL_NOEXCEPT
Definition json.h:701
static json object() FL_NOEXCEPT
Definition json.h:692
fl::u32 uint32_t
Definition s16x16x4.h:219
fl::u32 millis()
Universal millisecond timer - returns milliseconds since system startup.
corkscrew_args args
Definition old.h:149

References args, mState, fl::json::object(), remote, and fl::json::set().

Referenced by startBleRemote().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: