|
|
@@ -0,0 +1,639 @@
|
|
|
+syntax = "proto3";
|
|
|
+
|
|
|
+package hth.api.v1;
|
|
|
+
|
|
|
+option go_package = "hth/internal/gen/hth/api/v1;hthv1";
|
|
|
+
|
|
|
+import "google/protobuf/duration.proto";
|
|
|
+import "google/protobuf/timestamp.proto";
|
|
|
+
|
|
|
+// API, protocol, profile, firmware and capability versions are separate.
|
|
|
+// Do not reuse a single "version" field for all of them.
|
|
|
+
|
|
|
+enum DeviceLifecycleState {
|
|
|
+ DEVICE_LIFECYCLE_STATE_UNSPECIFIED = 0;
|
|
|
+ DEVICE_LIFECYCLE_STATE_STARTING = 1;
|
|
|
+ DEVICE_LIFECYCLE_STATE_CONNECTING = 2;
|
|
|
+ DEVICE_LIFECYCLE_STATE_PROBING = 3;
|
|
|
+ DEVICE_LIFECYCLE_STATE_READY = 4;
|
|
|
+ DEVICE_LIFECYCLE_STATE_DEGRADED = 5;
|
|
|
+ DEVICE_LIFECYCLE_STATE_SAFE = 6;
|
|
|
+ DEVICE_LIFECYCLE_STATE_UNAVAILABLE = 7;
|
|
|
+ DEVICE_LIFECYCLE_STATE_UNKNOWN = 8;
|
|
|
+}
|
|
|
+
|
|
|
+enum DataQuality {
|
|
|
+ DATA_QUALITY_UNSPECIFIED = 0;
|
|
|
+ DATA_QUALITY_VALID = 1;
|
|
|
+ DATA_QUALITY_STALE = 2;
|
|
|
+ DATA_QUALITY_MISSING = 3;
|
|
|
+ DATA_QUALITY_INVALID = 4;
|
|
|
+ DATA_QUALITY_ESTIMATED = 5;
|
|
|
+ DATA_QUALITY_NOT_SUPPORTED = 6;
|
|
|
+ DATA_QUALITY_UNKNOWN = 7;
|
|
|
+}
|
|
|
+
|
|
|
+enum ConfirmationStatus {
|
|
|
+ CONFIRMATION_STATUS_UNSPECIFIED = 0;
|
|
|
+ // Hardware returned a proven execution result. Never used for SET_ALL on the
|
|
|
+ // current Prod2U UART contract (no ACK).
|
|
|
+ CONFIRMATION_STATUS_CONFIRMED = 1;
|
|
|
+ // Host fully wrote the frame; device did not acknowledge.
|
|
|
+ CONFIRMATION_STATUS_UNCONFIRMED = 2;
|
|
|
+ // Short write, disconnect, or crash window; device may or may not have executed.
|
|
|
+ CONFIRMATION_STATUS_OUTCOME_UNKNOWN = 3;
|
|
|
+ CONFIRMATION_STATUS_REJECTED = 4;
|
|
|
+ CONFIRMATION_STATUS_NOT_SUPPORTED = 5;
|
|
|
+ // Write never started (no FD, cancelled before first byte).
|
|
|
+ CONFIRMATION_STATUS_NOT_DELIVERED = 6;
|
|
|
+}
|
|
|
+
|
|
|
+// Orthogonal to DeviceLifecycleState. Process may be SERVING while device is STARTING.
|
|
|
+enum TransportState {
|
|
|
+ TRANSPORT_STATE_UNSPECIFIED = 0;
|
|
|
+ TRANSPORT_STATE_DISCONNECTED = 1;
|
|
|
+ TRANSPORT_STATE_CONNECTING = 2;
|
|
|
+ TRANSPORT_STATE_CONNECTED = 3;
|
|
|
+}
|
|
|
+
|
|
|
+enum DeviceReadiness {
|
|
|
+ DEVICE_READINESS_UNSPECIFIED = 0;
|
|
|
+ DEVICE_READINESS_STARTING = 1;
|
|
|
+ DEVICE_READINESS_PROBING = 2;
|
|
|
+ DEVICE_READINESS_READY = 3;
|
|
|
+ DEVICE_READINESS_DEGRADED = 4;
|
|
|
+}
|
|
|
+
|
|
|
+// Latchable host control mode. Ordinary Apply cannot exit SAFE.
|
|
|
+enum SafetyControlMode {
|
|
|
+ SAFETY_CONTROL_MODE_UNSPECIFIED = 0;
|
|
|
+ SAFETY_CONTROL_MODE_NORMAL = 1;
|
|
|
+ SAFETY_CONTROL_MODE_SAFE_PENDING = 2;
|
|
|
+ SAFETY_CONTROL_MODE_SAFE = 3;
|
|
|
+ SAFETY_CONTROL_MODE_RESUME_PENDING = 4;
|
|
|
+}
|
|
|
+
|
|
|
+enum ActionDispatchState {
|
|
|
+ ACTION_DISPATCH_STATE_UNSPECIFIED = 0;
|
|
|
+ ACTION_DISPATCH_STATE_REQUESTED = 1;
|
|
|
+ ACTION_DISPATCH_STATE_ACCEPTED = 2;
|
|
|
+ ACTION_DISPATCH_STATE_QUEUED = 3;
|
|
|
+ ACTION_DISPATCH_STATE_DISPATCH_STARTED = 4;
|
|
|
+ ACTION_DISPATCH_STATE_DISPATCHED = 5;
|
|
|
+ ACTION_DISPATCH_STATE_UNCONFIRMED = 6;
|
|
|
+ ACTION_DISPATCH_STATE_CONFIRMED = 7;
|
|
|
+ ACTION_DISPATCH_STATE_OUTCOME_UNKNOWN = 8;
|
|
|
+ ACTION_DISPATCH_STATE_NOT_DELIVERED = 9;
|
|
|
+ ACTION_DISPATCH_STATE_REJECTED = 10;
|
|
|
+}
|
|
|
+
|
|
|
+enum ControlMode {
|
|
|
+ CONTROL_MODE_UNSPECIFIED = 0;
|
|
|
+ CONTROL_MODE_JOG_ONLY = 1;
|
|
|
+ CONTROL_MODE_PERCENT_CLOSE = 2;
|
|
|
+ CONTROL_MODE_CONTINUOUS_DUTY = 3;
|
|
|
+}
|
|
|
+
|
|
|
+enum FeedbackMode {
|
|
|
+ FEEDBACK_MODE_UNSPECIFIED = 0;
|
|
|
+ FEEDBACK_MODE_NONE = 1;
|
|
|
+ FEEDBACK_MODE_ESTIMATED_OPEN_LOOP = 2;
|
|
|
+ FEEDBACK_MODE_LIMIT_SWITCH = 3;
|
|
|
+ FEEDBACK_MODE_ENCODER = 4;
|
|
|
+}
|
|
|
+
|
|
|
+enum ActuatorKind {
|
|
|
+ ACTUATOR_KIND_UNSPECIFIED = 0;
|
|
|
+ ACTUATOR_KIND_FAN = 1;
|
|
|
+ ACTUATOR_KIND_HEATER = 2;
|
|
|
+ ACTUATOR_KIND_DOOR = 3;
|
|
|
+}
|
|
|
+
|
|
|
+enum SensorKind {
|
|
|
+ SENSOR_KIND_UNSPECIFIED = 0;
|
|
|
+ SENSOR_KIND_TEMPERATURE = 1;
|
|
|
+ SENSOR_KIND_LIMIT_SWITCH = 2;
|
|
|
+ SENSOR_KIND_ESTIMATED_POSITION = 3;
|
|
|
+}
|
|
|
+
|
|
|
+enum FaultSeverity {
|
|
|
+ FAULT_SEVERITY_UNSPECIFIED = 0;
|
|
|
+ FAULT_SEVERITY_INFO = 1;
|
|
|
+ FAULT_SEVERITY_WARNING = 2;
|
|
|
+ FAULT_SEVERITY_ERROR = 3;
|
|
|
+ FAULT_SEVERITY_CRITICAL = 4;
|
|
|
+}
|
|
|
+
|
|
|
+enum FaultClass {
|
|
|
+ FAULT_CLASS_UNSPECIFIED = 0;
|
|
|
+ FAULT_CLASS_DEVICE_REPORTED = 1;
|
|
|
+ FAULT_CLASS_HOST_INFERRED = 2;
|
|
|
+ FAULT_CLASS_CONFIG = 3;
|
|
|
+ FAULT_CLASS_COMMUNICATION = 4;
|
|
|
+ FAULT_CLASS_DATA_QUALITY = 5;
|
|
|
+}
|
|
|
+
|
|
|
+enum FaultType {
|
|
|
+ FAULT_TYPE_UNSPECIFIED = 0;
|
|
|
+ FAULT_TYPE_CONFIG_INVALID = 1;
|
|
|
+ FAULT_TYPE_PROFILE_INVALID = 2;
|
|
|
+ FAULT_TYPE_PROFILE_CONTRACT_MISMATCH = 3;
|
|
|
+ FAULT_TYPE_SERIAL_DEVICE_NOT_FOUND = 4;
|
|
|
+ FAULT_TYPE_SERIAL_PERMISSION_DENIED = 5;
|
|
|
+ FAULT_TYPE_SERIAL_DISCONNECTED = 6;
|
|
|
+ FAULT_TYPE_SERIAL_RECONNECTING = 7;
|
|
|
+ FAULT_TYPE_FRAME_LENGTH_INVALID = 8;
|
|
|
+ FAULT_TYPE_FRAME_CRC_INVALID = 9;
|
|
|
+ FAULT_TYPE_FRAME_TYPE_UNKNOWN = 10;
|
|
|
+ FAULT_TYPE_RESPONSE_TIMEOUT = 11;
|
|
|
+ FAULT_TYPE_TEMPERATURE_DATA_INVALID = 12;
|
|
|
+ FAULT_TYPE_TELEMETRY_STALE = 13;
|
|
|
+ FAULT_TYPE_CONTROL_LEASE_EXPIRED = 14;
|
|
|
+ FAULT_TYPE_CONTROL_COMMAND_REJECTED = 15;
|
|
|
+ FAULT_TYPE_CONTROL_OUTCOME_UNKNOWN = 16;
|
|
|
+ FAULT_TYPE_SAFE_ACTION_NOT_DELIVERED = 17;
|
|
|
+ FAULT_TYPE_SUBSCRIBER_DATA_GAP = 18;
|
|
|
+ FAULT_TYPE_DEVICE_AXIS_FAULT = 19;
|
|
|
+ FAULT_TYPE_WATCHDOG_TRIPPED = 20;
|
|
|
+}
|
|
|
+
|
|
|
+enum EventKind {
|
|
|
+ EVENT_KIND_UNSPECIFIED = 0;
|
|
|
+ EVENT_KIND_SNAPSHOT = 1;
|
|
|
+ EVENT_KIND_FAULT_RAISED = 2;
|
|
|
+ EVENT_KIND_FAULT_CLEARED = 3;
|
|
|
+ EVENT_KIND_LEASE_ACQUIRED = 4;
|
|
|
+ EVENT_KIND_LEASE_RENEWED = 5;
|
|
|
+ EVENT_KIND_LEASE_RELEASED = 6;
|
|
|
+ EVENT_KIND_LEASE_EXPIRED = 7;
|
|
|
+ EVENT_KIND_DEVICE_EPOCH_CHANGED = 8;
|
|
|
+ EVENT_KIND_DATA_GAP = 9;
|
|
|
+ EVENT_KIND_SAFE_MODE_ENTERED = 10;
|
|
|
+ EVENT_KIND_WATCHDOG_HEARTBEAT = 11;
|
|
|
+ EVENT_KIND_ACTION_RESULT = 12;
|
|
|
+ EVENT_KIND_BACKEND_STATE = 13;
|
|
|
+ EVENT_KIND_FAULT_UPDATED = 14;
|
|
|
+ EVENT_KIND_FAULT_ACKNOWLEDGED = 15;
|
|
|
+ EVENT_KIND_SAFETY_MODE_CHANGED = 16;
|
|
|
+ EVENT_KIND_RESUME_FROM_SAFE = 17;
|
|
|
+}
|
|
|
+
|
|
|
+enum HostHealth {
|
|
|
+ HOST_HEALTH_UNSPECIFIED = 0;
|
|
|
+ HOST_HEALTH_SERVING = 1;
|
|
|
+ HOST_HEALTH_NOT_SERVING = 2;
|
|
|
+ HOST_HEALTH_DEGRADED = 3;
|
|
|
+}
|
|
|
+
|
|
|
+enum ActionMode {
|
|
|
+ ACTION_MODE_UNSPECIFIED = 0;
|
|
|
+ ACTION_MODE_NORMAL = 1;
|
|
|
+ ACTION_MODE_SAFE = 2;
|
|
|
+ ACTION_MODE_HEARTBEAT = 3;
|
|
|
+}
|
|
|
+
|
|
|
+enum RejectReason {
|
|
|
+ REJECT_REASON_UNSPECIFIED = 0;
|
|
|
+ REJECT_REASON_INVALID_ARGUMENT = 1;
|
|
|
+ REJECT_REASON_UNKNOWN_ID = 2;
|
|
|
+ REJECT_REASON_NOT_SUPPORTED = 3;
|
|
|
+ REJECT_REASON_OUT_OF_RANGE = 4;
|
|
|
+ REJECT_REASON_CLAMP_REQUIRED = 5;
|
|
|
+ REJECT_REASON_LEASE_MISSING = 6;
|
|
|
+ REJECT_REASON_LEASE_MISMATCH = 7;
|
|
|
+ REJECT_REASON_LEASE_EXPIRED = 8;
|
|
|
+ REJECT_REASON_STALE_SNAPSHOT = 9;
|
|
|
+ REJECT_REASON_STALE_CONTROL_REVISION = 10;
|
|
|
+ REJECT_REASON_EXPIRED_DEADLINE = 11;
|
|
|
+ REJECT_REASON_IDEMPOTENCY_CONFLICT = 12;
|
|
|
+ REJECT_REASON_DEVICE_NOT_READY = 13;
|
|
|
+ REJECT_REASON_QUEUE_FULL = 14;
|
|
|
+ REJECT_REASON_ATOMIC_BATCH_FAILED = 15;
|
|
|
+ REJECT_REASON_SLEW_LIMITED = 16;
|
|
|
+ REJECT_REASON_SAFE_MODE_ACTIVE = 17;
|
|
|
+ REJECT_REASON_RESUME_REQUIRED = 18;
|
|
|
+ REJECT_REASON_PARTIAL_NOT_ALLOWED = 19;
|
|
|
+}
|
|
|
+
|
|
|
+message Measurement {
|
|
|
+ string id = 1;
|
|
|
+ double value = 2;
|
|
|
+ string unit = 3;
|
|
|
+ DataQuality quality = 4;
|
|
|
+ string quality_reason = 5;
|
|
|
+ google.protobuf.Duration age = 6;
|
|
|
+ google.protobuf.Timestamp host_time = 7;
|
|
|
+ bool source_timestamp_available = 8;
|
|
|
+ google.protobuf.Timestamp source_time = 9;
|
|
|
+ optional int32 raw_code = 10;
|
|
|
+}
|
|
|
+
|
|
|
+message TimeWindow {
|
|
|
+ google.protobuf.Timestamp request_sent = 1;
|
|
|
+ google.protobuf.Timestamp response_start = 2;
|
|
|
+ google.protobuf.Timestamp response_complete = 3;
|
|
|
+ google.protobuf.Timestamp host_receive = 4;
|
|
|
+ google.protobuf.Timestamp approx_acquire_start = 5;
|
|
|
+ google.protobuf.Timestamp approx_acquire_end = 6;
|
|
|
+ bool source_timestamp_available = 7;
|
|
|
+}
|
|
|
+
|
|
|
+message DeviceIdentity {
|
|
|
+ string device_id = 1;
|
|
|
+ string display_name = 2;
|
|
|
+ string profile_id = 3;
|
|
|
+ string profile_revision = 4;
|
|
|
+ string protocol_contract_hash = 5;
|
|
|
+ string backend_kind = 6;
|
|
|
+}
|
|
|
+
|
|
|
+message DeviceInfo {
|
|
|
+ DeviceIdentity identity = 1;
|
|
|
+ DeviceLifecycleState lifecycle = 2;
|
|
|
+ uint64 device_epoch = 3;
|
|
|
+}
|
|
|
+
|
|
|
+message Range {
|
|
|
+ double min = 1;
|
|
|
+ double max = 2;
|
|
|
+}
|
|
|
+
|
|
|
+message SensorCapability {
|
|
|
+ string id = 1;
|
|
|
+ repeated string aliases = 2;
|
|
|
+ string display_name = 3;
|
|
|
+ SensorKind kind = 4;
|
|
|
+ string unit = 5;
|
|
|
+ Range valid_range = 6;
|
|
|
+ double resolution = 7;
|
|
|
+ bool source_timestamp = 8;
|
|
|
+ string mapping_confidence = 9;
|
|
|
+ string hood_id = 10;
|
|
|
+ string chamber_id = 11;
|
|
|
+ string dimm_id = 12;
|
|
|
+ string connector = 13;
|
|
|
+ int32 source_index = 14;
|
|
|
+ google.protobuf.Duration update_period = 15;
|
|
|
+ string calibration_version = 16;
|
|
|
+ FeedbackMode feedback_mode = 17;
|
|
|
+}
|
|
|
+
|
|
|
+message ActuatorCapability {
|
|
|
+ string id = 1;
|
|
|
+ repeated string aliases = 2;
|
|
|
+ string display_name = 3;
|
|
|
+ ActuatorKind kind = 4;
|
|
|
+ string unit = 5;
|
|
|
+ Range command_range = 6;
|
|
|
+ double resolution = 7;
|
|
|
+ ControlMode control_mode = 8;
|
|
|
+ FeedbackMode feedback_mode = 9;
|
|
|
+ bool idempotent = 10;
|
|
|
+ bool one_shot = 11;
|
|
|
+ double safety_default = 12;
|
|
|
+ double max_slew_per_second = 13;
|
|
|
+ bool actual_feedback = 14;
|
|
|
+ string hood_id = 15;
|
|
|
+ string chamber_id = 16;
|
|
|
+ string connector = 17;
|
|
|
+ string notes = 18;
|
|
|
+}
|
|
|
+
|
|
|
+message Capabilities {
|
|
|
+ string device_id = 1;
|
|
|
+ string profile_id = 2;
|
|
|
+ string profile_revision = 3;
|
|
|
+ string protocol_contract_hash = 4;
|
|
|
+ string capability_hash = 5;
|
|
|
+ string api_version = 6;
|
|
|
+ string firmware_version = 7;
|
|
|
+ DataQuality firmware_version_quality = 8;
|
|
|
+ int32 hood_count = 9;
|
|
|
+ int32 chamber_count = 10;
|
|
|
+ repeated SensorCapability sensors = 11;
|
|
|
+ repeated ActuatorCapability actuators = 12;
|
|
|
+ google.protobuf.Duration recommended_sample_period = 13;
|
|
|
+ bool ack_supported = 14;
|
|
|
+ bool status_query_supported = 15;
|
|
|
+ bool position_feedback_supported = 16;
|
|
|
+ bool rpm_feedback_supported = 17;
|
|
|
+ bool device_fault_query_supported = 18;
|
|
|
+ bool limit_readback_supported = 19;
|
|
|
+ string readiness_probe = 20;
|
|
|
+ string notes = 21;
|
|
|
+ TimingCapabilities timing = 22;
|
|
|
+ bool host_fault_reporting_supported = 23;
|
|
|
+ bool device_native_fault_query_supported = 24;
|
|
|
+ string device_fault_source = 25;
|
|
|
+}
|
|
|
+
|
|
|
+message TimingCapabilities {
|
|
|
+ uint32 temperature_transaction_worst_case_ms = 1;
|
|
|
+ uint32 motor_status_worst_case_ms = 2;
|
|
|
+ uint32 control_dispatch_worst_case_ms = 3;
|
|
|
+ uint32 recommended_rpc_deadline_ms = 4;
|
|
|
+ uint32 recommended_action_ttl_ms = 5;
|
|
|
+ uint32 minimum_control_period_ms = 6;
|
|
|
+ uint32 recommended_sample_period_ms = 7;
|
|
|
+}
|
|
|
+
|
|
|
+message CommandedActuator {
|
|
|
+ string id = 1;
|
|
|
+ double commanded_target = 2;
|
|
|
+ DataQuality actual_quality = 3;
|
|
|
+ optional double actual_value = 4;
|
|
|
+ string actual_reason = 5;
|
|
|
+}
|
|
|
+
|
|
|
+message FieldAudit {
|
|
|
+ string id = 1;
|
|
|
+ bool explicit = 2;
|
|
|
+ double raw_value = 3;
|
|
|
+ double before_clamp = 4;
|
|
|
+ double after_clamp = 5;
|
|
|
+ bool clamped = 6;
|
|
|
+ string clamp_reason = 7;
|
|
|
+}
|
|
|
+
|
|
|
+message ActionRecord {
|
|
|
+ string command_id = 1;
|
|
|
+ string client_id = 2;
|
|
|
+ google.protobuf.Timestamp time = 3;
|
|
|
+ ConfirmationStatus confirmation = 4;
|
|
|
+ repeated CommandedActuator actuators = 5;
|
|
|
+ string origin = 6;
|
|
|
+ repeated FieldAudit field_audits = 7;
|
|
|
+ ActionMode action_mode = 8;
|
|
|
+ int32 peer_uid = 9;
|
|
|
+ int32 peer_gid = 10;
|
|
|
+ int32 peer_pid = 11;
|
|
|
+ ActionDispatchState dispatch_state = 12;
|
|
|
+}
|
|
|
+
|
|
|
+message LeaseSummary {
|
|
|
+ string lease_id = 1;
|
|
|
+ uint64 lease_epoch = 2;
|
|
|
+ string holder = 3;
|
|
|
+ google.protobuf.Timestamp expires_at = 4;
|
|
|
+ bool active = 5;
|
|
|
+}
|
|
|
+
|
|
|
+message Snapshot {
|
|
|
+ string device_id = 1;
|
|
|
+ string daemon_instance_id = 2;
|
|
|
+ uint64 device_epoch = 3;
|
|
|
+ uint64 snapshot_seq = 4;
|
|
|
+ uint64 control_revision = 5;
|
|
|
+ uint64 event_id = 6;
|
|
|
+ google.protobuf.Timestamp wall_time = 7;
|
|
|
+ uint64 monotonic_ns = 8;
|
|
|
+ TimeWindow capture_window = 9;
|
|
|
+ DeviceLifecycleState lifecycle = 10;
|
|
|
+ repeated Measurement measurements = 11;
|
|
|
+ repeated CommandedActuator continuous_targets = 12;
|
|
|
+ ActionRecord last_requested = 13;
|
|
|
+ ActionRecord last_accepted = 14;
|
|
|
+ ActionRecord last_dispatched = 15;
|
|
|
+ ConfirmationStatus device_confirmation = 16;
|
|
|
+ repeated Fault active_faults = 17;
|
|
|
+ LeaseSummary lease = 18;
|
|
|
+ uint64 dropped_telemetry_count = 19;
|
|
|
+ bool data_gap = 20;
|
|
|
+ TransportState transport_state = 21;
|
|
|
+ DeviceReadiness device_readiness = 22;
|
|
|
+ SafetyControlMode safety_control_mode = 23;
|
|
|
+}
|
|
|
+
|
|
|
+message Fault {
|
|
|
+ string fault_id = 1;
|
|
|
+ FaultType type = 2;
|
|
|
+ FaultSeverity severity = 3;
|
|
|
+ FaultClass class = 4;
|
|
|
+ google.protobuf.Timestamp first_time = 5;
|
|
|
+ google.protobuf.Timestamp last_time = 6;
|
|
|
+ bool active = 7;
|
|
|
+ bool latched = 8;
|
|
|
+ uint64 count = 9;
|
|
|
+ string device_id = 10;
|
|
|
+ string command_id = 11;
|
|
|
+ string human_reason = 12;
|
|
|
+ map<string, string> diagnostics = 13;
|
|
|
+}
|
|
|
+
|
|
|
+message Event {
|
|
|
+ uint64 event_id = 1;
|
|
|
+ EventKind kind = 2;
|
|
|
+ google.protobuf.Timestamp wall_time = 3;
|
|
|
+ uint64 monotonic_ns = 4;
|
|
|
+ string device_id = 5;
|
|
|
+ Snapshot snapshot = 6;
|
|
|
+ Fault fault = 7;
|
|
|
+ string message = 8;
|
|
|
+ uint64 resume_after_event_id = 9;
|
|
|
+ uint64 dropped_count = 10;
|
|
|
+ uint64 source_event_id = 11;
|
|
|
+ string source_capture_id = 12;
|
|
|
+ string source_device_id = 13;
|
|
|
+ string source_daemon_instance_id = 14;
|
|
|
+ uint64 last_contiguous_event_id = 15;
|
|
|
+}
|
|
|
+
|
|
|
+message ContinuousTarget {
|
|
|
+ string id = 1;
|
|
|
+ double value = 2;
|
|
|
+}
|
|
|
+
|
|
|
+message DiscreteCommand {
|
|
|
+ string id = 1;
|
|
|
+ string name = 2;
|
|
|
+ double value = 3;
|
|
|
+}
|
|
|
+
|
|
|
+message ClampRecord {
|
|
|
+ string id = 1;
|
|
|
+ double original = 2;
|
|
|
+ double limited = 3;
|
|
|
+ string reason = 4;
|
|
|
+}
|
|
|
+
|
|
|
+message ActionBatch {
|
|
|
+ string device_id = 1;
|
|
|
+ string command_id = 2;
|
|
|
+ string lease_id = 3;
|
|
|
+ uint64 lease_epoch = 4;
|
|
|
+ uint64 based_on_snapshot_seq = 5;
|
|
|
+ uint64 expected_control_revision = 6;
|
|
|
+ google.protobuf.Timestamp valid_until = 7;
|
|
|
+ repeated ContinuousTarget continuous_targets = 8;
|
|
|
+ repeated DiscreteCommand discrete_commands = 9;
|
|
|
+ bool allow_clamp = 10;
|
|
|
+ string client_id = 11;
|
|
|
+ string policy_version = 12;
|
|
|
+}
|
|
|
+
|
|
|
+message ActionResult {
|
|
|
+ string command_id = 1;
|
|
|
+ bool accepted = 2;
|
|
|
+ RejectReason reject_reason = 3;
|
|
|
+ string message = 4;
|
|
|
+ repeated ClampRecord clamps = 5;
|
|
|
+ // requested is the raw client fields (original floats, only explicit IDs).
|
|
|
+ ActionRecord requested = 6;
|
|
|
+ ActionRecord accepted_action = 7;
|
|
|
+ ActionRecord dispatched = 8;
|
|
|
+ ConfirmationStatus confirmation = 9;
|
|
|
+ uint64 control_revision = 10;
|
|
|
+ uint64 device_epoch = 11;
|
|
|
+ bool replayed_from_cache = 12;
|
|
|
+ ActionRecord raw_requested = 13;
|
|
|
+ ActionRecord normalized_requested = 14;
|
|
|
+ ActionDispatchState dispatch_state = 15;
|
|
|
+}
|
|
|
+
|
|
|
+message ControlLease {
|
|
|
+ string lease_id = 1;
|
|
|
+ uint64 lease_epoch = 2;
|
|
|
+ string device_id = 3;
|
|
|
+ string holder = 4;
|
|
|
+ google.protobuf.Timestamp created_at = 5;
|
|
|
+ google.protobuf.Timestamp expires_at = 6;
|
|
|
+ google.protobuf.Duration max_ttl = 7;
|
|
|
+ bool active = 8;
|
|
|
+}
|
|
|
+
|
|
|
+message ListDevicesRequest {}
|
|
|
+
|
|
|
+message ListDevicesResponse {
|
|
|
+ repeated DeviceInfo devices = 1;
|
|
|
+}
|
|
|
+
|
|
|
+message GetCapabilitiesRequest {
|
|
|
+ string device_id = 1;
|
|
|
+}
|
|
|
+
|
|
|
+message GetCapabilitiesResponse {
|
|
|
+ Capabilities capabilities = 1;
|
|
|
+}
|
|
|
+
|
|
|
+message GetSnapshotRequest {
|
|
|
+ string device_id = 1;
|
|
|
+}
|
|
|
+
|
|
|
+message GetSnapshotResponse {
|
|
|
+ Snapshot snapshot = 1;
|
|
|
+}
|
|
|
+
|
|
|
+message SubscribeTelemetryRequest {
|
|
|
+ string device_id = 1;
|
|
|
+ uint64 resume_after_event_id = 2;
|
|
|
+}
|
|
|
+
|
|
|
+message SubscribeEventsRequest {
|
|
|
+ string device_id = 1;
|
|
|
+ uint64 resume_after_event_id = 2;
|
|
|
+}
|
|
|
+
|
|
|
+message GetFaultsRequest {
|
|
|
+ string device_id = 1;
|
|
|
+ bool include_inactive = 2;
|
|
|
+}
|
|
|
+
|
|
|
+message GetFaultsResponse {
|
|
|
+ repeated Fault faults = 1;
|
|
|
+ bool device_fault_query_supported = 2;
|
|
|
+ bool host_fault_reporting_supported = 3;
|
|
|
+ bool device_native_fault_query_supported = 4;
|
|
|
+ string device_fault_source = 5;
|
|
|
+}
|
|
|
+
|
|
|
+message WatchHealthRequest {}
|
|
|
+
|
|
|
+message HealthStatus {
|
|
|
+ HostHealth host = 1;
|
|
|
+ repeated DeviceInfo devices = 2;
|
|
|
+ string message = 3;
|
|
|
+ HostHealth observe_service = 4;
|
|
|
+ HostHealth control_service = 5;
|
|
|
+ TransportState transport_state = 6;
|
|
|
+ DeviceReadiness device_readiness = 7;
|
|
|
+ SafetyControlMode safety_control_mode = 8;
|
|
|
+}
|
|
|
+
|
|
|
+message AcquireControlLeaseRequest {
|
|
|
+ string device_id = 1;
|
|
|
+ string holder = 2;
|
|
|
+ google.protobuf.Duration ttl = 3;
|
|
|
+}
|
|
|
+
|
|
|
+message RenewControlLeaseRequest {
|
|
|
+ string device_id = 1;
|
|
|
+ string lease_id = 2;
|
|
|
+ uint64 lease_epoch = 3;
|
|
|
+ google.protobuf.Duration ttl = 4;
|
|
|
+}
|
|
|
+
|
|
|
+message ReleaseControlLeaseRequest {
|
|
|
+ string device_id = 1;
|
|
|
+ string lease_id = 2;
|
|
|
+ uint64 lease_epoch = 3;
|
|
|
+}
|
|
|
+
|
|
|
+message LeaseResponse {
|
|
|
+ ControlLease lease = 1;
|
|
|
+}
|
|
|
+
|
|
|
+message ValidateActionRequest {
|
|
|
+ ActionBatch batch = 1;
|
|
|
+}
|
|
|
+
|
|
|
+message ApplyActionRequest {
|
|
|
+ ActionBatch batch = 1;
|
|
|
+}
|
|
|
+
|
|
|
+message EnterSafeModeRequest {
|
|
|
+ string device_id = 1;
|
|
|
+ string lease_id = 2;
|
|
|
+ uint64 lease_epoch = 3;
|
|
|
+ string reason = 4;
|
|
|
+}
|
|
|
+
|
|
|
+message ResumeFromSafeRequest {
|
|
|
+ string device_id = 1;
|
|
|
+ string lease_id = 2;
|
|
|
+ uint64 lease_epoch = 3;
|
|
|
+ ActionBatch batch = 4;
|
|
|
+}
|
|
|
+
|
|
|
+message StepReplayRequest {
|
|
|
+ string device_id = 1;
|
|
|
+}
|
|
|
+
|
|
|
+message StepReplayResponse {
|
|
|
+ bool advanced = 1;
|
|
|
+ Event event = 2;
|
|
|
+ Snapshot snapshot = 3;
|
|
|
+ string message = 4;
|
|
|
+}
|
|
|
+
|
|
|
+service ObserveService {
|
|
|
+ rpc ListDevices(ListDevicesRequest) returns (ListDevicesResponse);
|
|
|
+ rpc GetCapabilities(GetCapabilitiesRequest) returns (GetCapabilitiesResponse);
|
|
|
+ rpc GetSnapshot(GetSnapshotRequest) returns (GetSnapshotResponse);
|
|
|
+ rpc SubscribeTelemetry(SubscribeTelemetryRequest) returns (stream Snapshot);
|
|
|
+ rpc SubscribeEvents(SubscribeEventsRequest) returns (stream Event);
|
|
|
+ rpc GetFaults(GetFaultsRequest) returns (GetFaultsResponse);
|
|
|
+ rpc WatchHealth(WatchHealthRequest) returns (stream HealthStatus);
|
|
|
+ // StepReplay advances a replay backend by one capture record. It is a
|
|
|
+ // client-triggered single step, not a cancelled internal ticker wait.
|
|
|
+ rpc StepReplay(StepReplayRequest) returns (StepReplayResponse);
|
|
|
+}
|
|
|
+
|
|
|
+service ControlService {
|
|
|
+ rpc AcquireControlLease(AcquireControlLeaseRequest) returns (LeaseResponse);
|
|
|
+ rpc RenewControlLease(RenewControlLeaseRequest) returns (LeaseResponse);
|
|
|
+ rpc ReleaseControlLease(ReleaseControlLeaseRequest) returns (LeaseResponse);
|
|
|
+ rpc ValidateAction(ValidateActionRequest) returns (ActionResult);
|
|
|
+ rpc ApplyAction(ApplyActionRequest) returns (ActionResult);
|
|
|
+ rpc EnterSafeMode(EnterSafeModeRequest) returns (ActionResult);
|
|
|
+ rpc ResumeFromSafe(ResumeFromSafeRequest) returns (ActionResult);
|
|
|
+}
|