🚌 Adds eventbus with bluetooth adapter

This commit is contained in:
Rune Harlyk
2025-07-08 01:25:35 +02:00
parent 01d46f283b
commit 06b05b2dc1
12 changed files with 532 additions and 1 deletions
+17
View File
@@ -0,0 +1,17 @@
#pragma once
#include <ArduinoJson.h>
struct CommandMsg {
float x, y;
friend void toJson(JsonVariant v, CommandMsg const &c) {
JsonArray arr = v.to<JsonArray>();
arr.add(c.x);
arr.add(c.y);
}
void fromJson(JsonVariantConst o) {
JsonArrayConst arr = o.as<JsonArrayConst>();
x = arr[0].as<float>();
y = arr[1].as<float>();
}
};