You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-Main class managing RPC clients and servers. Provides methods to:
821
-
-Initialize the bridge (`begin()`)
822
-
-Call remote procedures (`call()`)
823
-
-Notify without waiting for a response (`notify()`)
824
-
-Expose local functions for remote execution (`provide()`, `provide_safe()`)
825
-
-Process incoming requests (`update()`)
819
+
`BridgeClass` The main class managing RPC clients and servers.
820
+
-`begin()`: Initializes the bridge and the internal serial transport.
821
+
-`call(method, args...)`: Invokes a function on the Linux side and waits for a result.
822
+
-`notify(method, args...)`: Invokes a function on the Linux side without waiting for a response (fire-and-forget).
823
+
-`provide(name, function)`: Exposes a local MCU function to Linux. Note: The function executes in the high-priority background RPC thread. Keep these functions short and thread-safe.
824
+
-`provide_safe(name, function)`: Exposes a local MCU function, but ensures it executes within the main `loop()` context. Use this if your function interacts with standard Arduino APIs (like `digitalWrite` or `Serial`) to avoid concurrency crashes.
825
+
-`update()`: Process incoming requests.
826
826
827
+
`RpcCall`
828
+
- Helper class representing an asynchronous RPC. If its `.result` method is invoked, it waits for the response, extracts the return value, and propagates error codes if needed.
827
829
828
-
`RpcResult`
829
-
-Helper class representing the result of a remote call. It waits for the response, extracts the return value, and propagates error codes if needed.
830
+
`Monitor`
831
+
-The library includes a pre-defined Monitor object. This allows the Linux side to send text streams to the MCU (acting like a virtual Serial Monitor) via the RPC method mon/write.
830
832
831
833
**Threading and Safety**
832
834
- The bridge uses Zephyr mutexes (`k_mutex`) to guarantee safe concurrent access when reading/writing over the transport. Updates are handled by a background thread that continuously polls for requests.
835
+
-**Incoming Updates**: Handled by a dedicated background thread (`updateEntryPoint`) that continuously polls for requests.
836
+
-**Safe Execution**: The provide_safe mechanism hooks into the main loop (`__loopHook`) to execute user callbacks safely when the processor is idle.
0 commit comments