Added protoMetadata and trying to fix sub and unsub

This commit is contained in:
Niklas Jensen
2025-12-30 22:00:28 +01:00
committed by nikguin04
parent c90ebe5630
commit f5fc31ca5a
5 changed files with 852 additions and 106 deletions
+1
View File
@@ -40,6 +40,7 @@
"svelte-check": "^4.3.3",
"svelte-focus-trap": "^1.2.0",
"tailwindcss": "^4.1.14",
"ts-proto-descriptors": "^2.1.0",
"tslib": "^2.8.1",
"typescript": "^5.9.3",
"typescript-eslint": "^8.51.0",
+3
View File
@@ -132,6 +132,9 @@ importers:
tailwindcss:
specifier: ^4.1.14
version: 4.1.14
ts-proto-descriptors:
specifier: ^2.1.0
version: 2.1.0
tslib:
specifier: ^2.8.1
version: 2.8.1
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -3,7 +3,7 @@ This file is temporary, just to show how ot compile the proto files
Make sure to actually create the output directories before executing the commands
TS:
protoc --plugin="protoc-gen-ts_proto=$(Resolve-Path app\node_modules\.bin\protoc-gen-ts_proto.CMD)" --ts_proto_out="./app/src/lib" "platform_shared\example.proto"
rotoc --plugin="protoc-gen-ts_proto=$(Resolve-Path app\node_modules\.bin\protoc-gen-ts_proto.CMD)" --ts_proto_out="./app/src/lib" --ts_proto_opt=outputSchema=true ".\platform_shared\websocket_message.proto"
NEW TS (USING PROTOBUFJS):
cd app
+21 -16
View File
@@ -24,26 +24,31 @@ message WifiSettingsData {}
message SonarData {}
message RSSIData { int32 rssi = 1; }
message SubscribeNotification {}
message UnsubscribeNotification {}
// WebSocket message wrapper
// Only ONE field will be set at a time (oneof ensures this)
message WebsocketMessage {
oneof message {
IMUData imu = 10;
IMUCalibrateData imu_calibrate = 20;
ModeData mode = 30;
InputData input = 40;
AnalyticsData analytics = 50;
PositionData position = 60;
AnglesData angles = 70;
I2CScanData i2c_scan = 80;
PeripheralSettingsData peripheral_settings = 90;
OTAStatusData ota_status = 100;
GaitData gait = 110;
ServoStateData servo_state = 120;
ServoPWMData servo_pwm = 130;
WifiSettingsData wifi_settings = 140;
SonarData sonar = 150;
RSSIData rssi = 160;
SubscribeNotification sub_notif = 20;
UnsubscribeNotification unsub_notif = 21;
IMUData imu = 110;
IMUCalibrateData imu_calibrate = 120;
ModeData mode = 130;
InputData input = 140;
AnalyticsData analytics = 150;
PositionData position = 160;
AnglesData angles = 170;
I2CScanData i2c_scan = 180;
PeripheralSettingsData peripheral_settings = 190;
OTAStatusData ota_status = 200;
GaitData gait = 210;
ServoStateData servo_state = 220;
ServoPWMData servo_pwm = 230;
WifiSettingsData wifi_settings = 240;
SonarData sonar = 250;
RSSIData rssi = 260;
}
}