|
|
void | begin () |
| | Initializes the RPC with the specified stream. Defaults to Serial if no stream is provided.
|
| void | begin (Stream *target_stream) |
| | Initializes the RPC with the specified stream.
|
| void | begin (usb_serial_class *target_usb_serial) |
| | Initializes the RPC with the specified USB serial class.
|
| void | begin (HardwareSerialIMXRT *target_serial, uint32_t baud, uint16_t format=0) |
| | Initializes the RPC with the specified hardware serial.
|
|
template<typename Ret, typename... Args> |
| void | enroll (const String &name, Ret(*func)(Args...)) |
|
template<typename Obj, typename Ret, typename... Args> |
| void | enroll (const String &instance_name, const String &name, Obj &instance, Ret(Obj::*method)(Args...)) |
|
void | enroll (const String &name, Plugin &instance) |
|
template<typename T, typename = std::enable_if_t<!std::is_base_of_v<Plugin, T>>> |
| void | enroll (const String &name, T ¶meter) |
|
template<typename... Args, size_t... I> |
| void | call_and_respond (void(*func)(Args...), JsonArray args, std::index_sequence< I... >) |
|
template<typename Obj, typename... Args, size_t... I> |
| void | call_and_respond (Obj &instance, void(Obj::*method)(Args...), JsonArray args, std::index_sequence< I... >) |
|
template<typename Ret, typename... Args, size_t... I> |
| void | call_and_respond (Ret(*func)(Args...), JsonArray args, std::index_sequence< I... >) |
|
template<typename Obj, typename Ret, typename... Args, size_t... I> |
| void | call_and_respond (Obj &instance, Ret(Obj::*method)(Args...), JsonArray args, std::index_sequence< I... >) |
RPC class for handling remote procedure calls over serial streams.
The RPC class provides an interface for registering functions and parameters that can be called and accessed remotely via over serial streams. It supports enrolling functions with various signatures, as well as plugin instances and parameters. The class handles dispatching incoming RPC calls and sending responses back to the caller. Here's an example of how to instantiate and configure an RPC:
RPC Example.