powerpods/main/proto/uart_messages.proto
2026-05-10 17:08:11 +02:00

88 lines
1.4 KiB
Protocol Buffer

syntax = "proto3";
package alox;
enum MessageType {
UNKNOWN = 0;
ACK = 1;
ECHO = 2;
VERSION = 3;
CLIENT_INFO = 4;
CLIENT_INPUT = 5;
OTA_START = 16;
OTA_PAYLOAD = 17;
OTA_END = 18;
OTA_STATUS = 19;
OTA_START_ESPNOW = 20;
}
message UartMessage {
MessageType type = 1;
oneof payload {
Ack ack_payload = 2;
EchoPayload echo_payload = 3;
VersionResponse version_response = 4;
ClientInfoResponse client_info_response = 5;
ClientInputResponse client_input_response = 6;
OtaStartPayload ota_start = 7;
OtaPayload ota_payload = 8;
OtaEndPayload ota_end = 9;
OtaStatusPayload ota_status = 10;
}
}
message Ack {}
message EchoPayload {
bytes data = 1;
}
message VersionResponse {
uint32 version = 1;
string git_hash = 2;
}
message ClientInfo {
uint32 id = 1;
bool available = 2;
bool used = 3;
bytes mac = 4;
uint32 last_ping = 5;
uint32 last_success_ping = 6;
uint32 version = 7;
}
message ClientInfoResponse {
repeated ClientInfo clients = 1;
}
message ClientInput {
uint32 id = 1;
float lage_x = 2;
float lage_y = 3;
uint32 bitmask = 4;
}
message ClientInputResponse {
repeated ClientInput clients = 1;
}
message OtaStartPayload {
uint32 total_size = 1;
uint32 block_size = 2;
}
message OtaPayload {
uint32 block_id = 1;
uint32 chunk_id = 2;
bytes data = 3;
}
message OtaEndPayload {
uint32 status = 1;
}
message OtaStatusPayload {
uint32 status = 1;
}