syntax = "proto3"; package livefeed.v1; // C# namespace option csharp_namespace = "Grote.Grpc.LiveFeed"; // Java package name option java_package = "com.grote.grpc.livefeed"; option java_multiple_files = true; import "google/protobuf/timestamp.proto"; // --------------------------------------------------------- // LiveFeed Service // --------------------------------------------------------- // The LiveFeed service provides real-time updates about fleets, // trailers, and telemetry data. Clients subscribe once and // receive a continuous stream of LiveUpdateResponse messages as new // information becomes available or to keep the stream alive. service LiveFeed { // Opens a live data stream. The server will continuously // send LiveUpdateResponse messages until the client disconnects. rpc Subscribe(SubscribeRequest) returns (stream LiveUpdateResponse); } // --------------------------------------------------------- // Request & Response Messages // --------------------------------------------------------- // Subscription request (currently empty). // In the future, filters such as FleetID may be added. message SubscribeRequest {} // Wrapper for stream messages. This allows the server to send either // a real LiveUpdate or a lightweight heartbeat to keep the stream alive. message LiveUpdateResponse { bool is_heartbeat = 1; // True if this message is a heartbeat/ping optional LiveUpdate live_update = 2; // Optional actual update payload } // A single update in the live feed stream. // Each LiveUpdate contains fleet-level metadata and trailer data. message LiveUpdate { int32 fleet_id = 1; // Fleet identifier optional string fleet_name = 2; // Human-friendly fleet name google.protobuf.Timestamp ts = 3; // Time the update was created (UTC) Trailer trailer = 4; // Trailer data included in this update } // --------------------------------------------------------- // Trailer Details // --------------------------------------------------------- // Represents the trailer included in the update. Each trailer // may include its latest status, telemetry, and diagnostic info. message Trailer { string id = 1; // Trailer identifier optional string unit_id = 2; // Unit or asset tag, if available optional string vin = 3; // Vehicle Identification Number (VIN) optional Status status = 4; // Current operational status optional google.protobuf.Timestamp status_date = 5; // When the status changed int32 faulted_devices = 6; // Number of devices currently faulted int32 warning_devices = 7; // Number of devices reporting warnings optional Telemetry telemetry = 8; // Latest GPS and motion information } // --------------------------------------------------------- // Telemetry Data // --------------------------------------------------------- // Real-time telemetry readings reported by the trailer. message Telemetry { optional google.protobuf.Timestamp timestamp = 1; // When telemetry was recorded optional double lat = 2; // Latitude (decimal degrees) optional double long = 3; // Longitude (decimal degrees) optional double speed = 4; // Speed in mph optional string heading = 5; // Direction of travel (cardinal) } // --------------------------------------------------------- // Status // --------------------------------------------------------- // Represents the trailer’s current operational status, if any. message Status { optional string name = 1; // Status label (e.g., "OK", "Warning", "Faulted") optional bool is_warning = 2; // True if this is a warning condition optional bool is_fault = 3; // True if this is a fault condition }