// Copyright (c) 2022 Boston Dynamics, Inc.  All rights reserved.
//
// Downloading, reproducing, distributing or otherwise using the SDK Software
// is subject to the terms and conditions of the Boston Dynamics Software
// Development Kit License (20191101-BDSDK-SL).

syntax = "proto3";

package bosdyn.api;

option java_outer_classname = "EstopServiceProto";

import "bosdyn/api/estop.proto";

// The software robot E-Stop system:
//  1. Uses challenge-style communication to enforce end user (aka "originators") connection
//     for Authority to Operate (ATO).
//  2. Offers the ability to issue a direct denial of  ATO.
// The EstopService provides a service interface for the robot EStop/Authority to operate the system.
service EstopService {
    // Register an Estop "originator" or "endpoint".
    // This may be a replacement for another active endpoint.
    rpc RegisterEstopEndpoint(RegisterEstopEndpointRequest)
        returns (RegisterEstopEndpointResponse) {}

    // Deregister the requested estop endpoint.
    rpc DeregisterEstopEndpoint(DeregisterEstopEndpointRequest)
        returns (DeregisterEstopEndpointResponse) {}

    // Answer challenge from previous response (unless this is the first call), and request
    // a stop level.
    rpc EstopCheckIn(EstopCheckInRequest) returns (EstopCheckInResponse) {}

    // Request the current EstopConfig, describing the expected set of endpoints.
    rpc GetEstopConfig(GetEstopConfigRequest) returns (GetEstopConfigResponse) {}

    // Set a new active EstopConfig.
    rpc SetEstopConfig(SetEstopConfigRequest) returns (SetEstopConfigResponse) {}

    // Ask for the current status of the estop system.
    rpc GetEstopSystemStatus(GetEstopSystemStatusRequest)
        returns (GetEstopSystemStatusResponse) {}
}
