Skip to content

Commit

Permalink
Added arm authorization server functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
ddatsko committed Apr 1, 2024
1 parent 736bc2a commit 091b894
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions protos/arm_authorizer_server/arm_authorizer_server.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
syntax = "proto3";

package mavsdk.rpc.arm_authorizer;

import "mavsdk_options.proto";

option java_package = "io.mavsdk.arm_authorizer";
option java_outer_classname = "ArmAuthorizerProto";

service ArmAuthorizerServerService {
// Subscribe to arm authorization request messages. Each request received should respond to using RespondArmAuthorization
rpc SubscribeArmAuthorization(SubscribeArmAuthorizationRequest) returns(stream SubscribeArmAuthorizationResponse) { option (mavsdk.options.async_type) = ASYNC; }

// Authorize arm for the specific time
rpc AcceptArmAuthorization(AcceptArmAuthorizationRequest) returns(AcceptArmAuthorizationResponse) { option (mavsdk.options.async_type) = SYNC; }

// Reject arm authorization request
rpc RejectArmAuthorization(RejectArmAuthorizationRequest) returns(RejectArmAuthorizationResponse) { option (mavsdk.options.async_type) = SYNC; }
}

// Messages for SubscribeArmAuthorization
message SubscribeArmAuthorizationRequest {}
message SubscribeArmAuthorizationResponse {
uint32 system_id = 1; // vehicle system id
}

// Messages for RespondArmAuthorization
message AcceptArmAuthorizationRequest {
int32 valid_time = 1; // Time in seconds for which this authorization is valid
}

// Result type
message AcceptArmAuthorizationResponse {
CommandAnswer command_answer = 1; // Result enum value
}

// Messages for RespondArmAuthorization
message RejectArmAuthorizationRequest {
bool temporarily = 1; // True if the answer should be TEMPORARILY_REJECTED, false for DENIED
RejectionReason reason = 2; // Reason for the arm to be rejected
int32 extra_info = 3; // Extra information specific to the rejection reason (see https://mavlink.io/en/services/arm_authorization.html)
}

// Result type
message RejectArmAuthorizationResponse {
CommandAnswer command_answer = 1; // Result enum value
}

enum CommandAnswer {
COMMAND_ANSWER_ACCEPTED = 0; // Command accepted
COMMAND_ANSWER_FAILED = 1; // Command failed
}

enum RejectionReason {
REASON_GENERIC = 0; // Not a specific reason
REASON_NONE = 1; // Authorizer will send the error as string to GCS
REASON_INVALID_WAYPOINT = 2; // At least one waypoint have a invalid value
REASON_TIMEOUT = 3; // Timeout in the authorizer process(in case it depends on network)
REASON_AIRSPACE_IN_USE = 4; // Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied.
REASON_BAD_WEATHER = 5; // Weather is not good to fly
}

0 comments on commit 091b894

Please sign in to comment.