syntax = "proto3"; package x0gp.v1; option go_package = "github.com/x0gp/server/proto/gen/serveragentpb"; // ============================================================ // Wire protocol between server (Edge / agent-linker) and the // on-board agent (ESP32-S3 in PoC). // ============================================================ // // The agent runs MicroPython (PoC) or ESP-IDF C (prod). It connects via // Wi-Fi to the gateway-агент (in MVP) or directly to this server (in PoC) // over WebSocket using the same envelope pattern as client_server.proto. // --- Server -> Agent --- message AgentHelloAck { string agent_id = 1; int32 fw_version_major = 2; int32 fw_version_minor = 3; ServerConfig config = 4; } message ServerConfig { int32 tick_rate_hz = 1; int32 telemetry_rate_hz = 2; } message AgentCommand { string car_id = 1; float steering = 2; // -1.0 .. 1.0 float throttle = 3; // 0.0 .. 1.0 float brake = 4; // 0.0 .. 1.0 int32 gear = 5; uint32 flags = 6; // bit0: E-stop, bit1: lights, ... int64 expires_at_ms = 7; // safety: drop if older than this } message AgentConfig { string car_id = 1; float max_steering_rate = 2; // per second float max_throttle_rate = 3; RampLimits ramp = 4; } message RampLimits { float throttle_up_per_s = 1; float throttle_down_per_s = 2; float brake_per_s = 3; } // --- Agent -> Server --- message AgentHello { string car_id = 1; string fw_version = 2; string hw_id = 3; int32 rssi = 4; // dBm } message AgentTelemetry { string car_id = 1; int64 ts_ms = 2; float steering_actual = 3; float throttle_actual = 4; int32 rpm = 5; float voltage_v = 6; float current_a = 7; float temp_esc_c = 8; float temp_motor_c = 9; Imu imu = 10; IrLine ir = 11; float battery_pct = 12; // 0..100 } message Imu { float ax = 1; float ay = 2; float az = 3; float gx = 4; float gy = 5; float gz = 6; } message IrLine { bool front = 1; bool rear = 2; } message AgentHeartbeat { int64 ts_ms = 1; int64 uptime_s = 2; repeated string errors = 3; } message AgentLog { string level = 1; // "debug" | "info" | "warn" | "error" string msg = 2; }