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
Copy file name to clipboardExpand all lines: README.md
+28-21Lines changed: 28 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,8 @@ In this repo it will be implemented an Arduino library wrapper for RPClite to be
5
5
Including Arduino_RouterBridge.h gives the user access to a Bridge object that can be used both as a RPC client and/or server to execute and serve RPCs to/from the CPU Host running a GOLANG router.
6
6
7
7
- The Bridge object is pre-defined on Serial1 and automatically initialized inside the main setup()
8
-
- The Bridge.call method is blocking and works the same as in RPClite
8
+
- The Bridge.call method is non-blocking and returns a RpcResult async object
9
+
- RpcResult class implements a blocking .result method that waits for the RPC response and returns true if the RPC returned with no errors
9
10
- The Bridge can provide callbacks to incoming RPC requests both in a thread-unsafe and thread-safe fashion (provide & provide_safe)
10
11
- Thread-safe methods execution is granted in the main loop thread where update_safe is called. By design users cannot access .update_safe() freely
11
12
- Thread-unsafe methods are served in an update callback, whose execution is granted in a separate thread. Nonetheless users can access .update() freely with caution
@@ -27,7 +28,7 @@ void setup() {
27
28
28
29
Bridge.begin();
29
30
Monitor.begin();
30
-
31
+
31
32
pinMode(LED_BUILTIN, OUTPUT);
32
33
33
34
if (!Bridge.provide("set_led", set_led)) {
@@ -41,27 +42,33 @@ void setup() {
41
42
}
42
43
43
44
void loop() {
44
-
float res;
45
-
if (!Bridge.call("multiply", 1.0, 2.0).result(res)) {
0 commit comments