45 template<
typename Callable>
91 template<typename Callable>
97 template<
typename Callable>
119 return mRpc.get<Sig>(name);
168 return mRpc.schema();
218#if FL_PLATFORM_HAS_LARGE_MEMORY
220 void scheduleFunction(u32 timestamp, u32 receivedAt,
const fl::json& jsonRpcRequest)
FL_NO_EXCEPT;
227#if FL_PLATFORM_HAS_LARGE_MEMORY
Remote(RequestSource source, ResponseSink sink) FL_NO_EXCEPT
Construct with I/O callbacks.
fl::size count() const FL_NO_EXCEPT
Get number of registered methods.
typename fl::Rpc::Config< Callable > Config
Configuration for method registration (forwards to Rpc::Config)
void bind(const char *name, Callable fn, fl::RpcMode mode=fl::RpcMode::SYNC) FL_NO_EXCEPT
Register method by name, function, and optional mode (default SYNC)
fl::json schema() const FL_NO_EXCEPT
Returns flat schema document Format: {"schema": [["methodName", "returnType", [["param1",...
fl::BindResult< Sig > get(const char *name) const FL_NO_EXCEPT
Get bound method by name for direct C++ invocation.
Remote(Remote &&) FL_NO_EXCEPT=delete
void bindAsync(const char *name, fl::function< void(fl::ResponseSend &, const fl::json &)> fn, fl::RpcMode mode=fl::RpcMode::ASYNC) FL_NO_EXCEPT
Register async method with ResponseSend& parameter (for ASYNC/ASYNC_STREAM modes) Signature: void(Res...
fl::json processRpc(const fl::json &request) FL_NO_EXCEPT
Process JSON-RPC request (with optional "timestamp" field for scheduling) Returns JSON-RPC response: ...
fl::MethodInfo MethodInfo
size_t pendingCount() const FL_NO_EXCEPT
Get number of pending scheduled calls.
bool has(const fl::string &name) const FL_NO_EXCEPT
Check if method is registered.
fl::RemoteClearFlags ClearFlags
bool unbind(const fl::string &name) FL_NO_EXCEPT
Unregister method by name.
fl::vector< MethodInfo > methods() const FL_NO_EXCEPT
Get method information for all registered methods.
void sendAsyncResponse(const char *method, const fl::json &result) FL_NO_EXCEPT
Send async response for a previously-called async method The request ID is automatically retrieved fr...
void sendStreamUpdate(const char *method, const fl::json &update) FL_NO_EXCEPT
Send stream update for a streaming async method (ASYNC_STREAM mode) The request ID is automatically r...
void sendStreamFinal(const char *method, const fl::json &result) FL_NO_EXCEPT
Send final stream response for a streaming async method (ASYNC_STREAM mode) The request ID is automat...
void bindStreaming(const char *name, fl::StreamingRpcHandler fn) FL_NO_EXCEPT
Register method that streams its JSON-RPC result directly to the transport.
void reportError(const fl::string &message) FL_NO_EXCEPT
Send an error notification to the remote peer.
Remote(const Remote &) FL_NO_EXCEPT=delete
size_t tick(u32 currentTimeMs) FL_NO_EXCEPT
Process scheduled calls (call regularly)
void bind(const Config< Callable > &config) FL_NO_EXCEPT
Register method with config (name, function, optional metadata)
Helper class for sending responses in async/streaming RPC methods.
fl::function< fl::optional< fl::json >()> RequestSource
size_t update() FL_NO_EXCEPT
Main update: pull + push.
Server() FL_NO_EXCEPT
Default constructor.
fl::function< void(const fl::json &)> ResponseSink
Generic time-based task scheduler.
ClearFlags
Flags for FastLED.clear() to control what state gets cleared/reset.
FastLED's Elegant JSON Library: fl::json
constexpr remove_reference< T >::type && move(T &&t) FL_NO_EXCEPT
u8 u8 fract8 blur_amount FL_NO_EXCEPT
void clear(CRGB(&arr)[N]) FL_NO_EXCEPT
fl::function< void(fl::JsonStreamWriter &, const fl::json &, const fl::json &)> StreamingRpcHandler
expected< T, E > result
Alias for expected (Rust-style naming)
RemoteClearFlags
Flags for clearing Remote state (can be OR'd together)
fl::function< void(fl::JsonStreamCallback)> ResponseStreamSink
Base definition for an LED controller.
Method parameter information.
Wraps the result of binding to a method by name.
Configuration for method registration with optional metadata.
Result metadata for executed RPC calls.