Skip to content

Commit 87e6c07

Browse files
authored
Add missing docstrings (#369)
1 parent 49abbe7 commit 87e6c07

8 files changed

Lines changed: 60 additions & 36 deletions

File tree

protos/arm_authorizer_server/arm_authorizer_server.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import "mavsdk_options.proto";
77
option java_package = "io.mavsdk.arm_authorizer";
88
option java_outer_classname = "ArmAuthorizerServerProto";
99

10+
// Use arm authorization.
1011
service ArmAuthorizerServerService {
1112
// Subscribe to arm authorization request messages. Each request received should respond to using RespondArmAuthorization
1213
rpc SubscribeArmAuthorization(SubscribeArmAuthorizationRequest) returns(stream ArmAuthorizationResponse) { option (mavsdk.options.async_type) = ASYNC; }
@@ -47,6 +48,7 @@ message RejectArmAuthorizationResponse {
4748
}
4849

4950
message ArmAuthorizerServerResult {
51+
// The result
5052
enum Result {
5153
RESULT_UNKNOWN = 0; // Unknown result
5254
RESULT_SUCCESS = 1; // Command accepted
@@ -57,6 +59,7 @@ message ArmAuthorizerServerResult {
5759
string result_str = 2; // Human-readable English string describing the result
5860
}
5961

62+
// The rejection reason
6063
enum RejectionReason {
6164
REJECTION_REASON_GENERIC = 0; // Not a specific reason
6265
REJECTION_REASON_NONE = 1; // Authorizer will send the error as string to GCS

protos/camera/camera.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ message CameraListResponse {
307307
CameraList camera_list = 1; // Camera list
308308
}
309309

310+
// An update about the current mode
310311
message ModeUpdate {
311312
int32 component_id = 1; // Component ID
312313
Mode mode = 2; // Camera mode
@@ -317,6 +318,7 @@ message ModeResponse {
317318
ModeUpdate update = 1; // Mode update for camera
318319
}
319320

321+
// An update about a video stream
320322
message VideoStreamUpdate {
321323
int32 component_id = 1; // Component ID
322324
VideoStreamInfo video_stream_info = 2; // Video stream info
@@ -369,6 +371,7 @@ message Storage {
369371
StorageType storage_type = 11; // Storage type
370372
}
371373

374+
// An update about storage
372375
message StorageUpdate {
373376
int32 component_id = 1; // Component ID
374377
Storage storage = 2; // Storage
@@ -379,6 +382,7 @@ message StorageResponse {
379382
StorageUpdate update = 1; // Camera's storage status
380383
}
381384

385+
// An update about a current setting
382386
message CurrentSettingsUpdate {
383387
int32 component_id = 1; // Component ID
384388
repeated Setting current_settings = 2; // List of current settings
@@ -389,6 +393,7 @@ message CurrentSettingsResponse {
389393
CurrentSettingsUpdate update = 1; // Current setting update per camera
390394
}
391395

396+
// An update about possible setting options
392397
message PossibleSettingOptionsUpdate {
393398
int32 component_id = 1; // Component ID
394399
repeated SettingOptions setting_options = 2; // List of settings that can be changed

protos/camera_server/camera_server.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,13 +449,16 @@ message StorageInformation {
449449
float write_speed_mib_s = 8; // Write speed [MiB/s]
450450
}
451451

452+
// Capture status
452453
message CaptureStatus {
454+
// The image status
453455
enum ImageStatus {
454456
IMAGE_STATUS_IDLE = 0; // idle
455457
IMAGE_STATUS_CAPTURE_IN_PROGRESS = 1; // capture in progress
456458
IMAGE_STATUS_INTERVAL_IDLE = 2; // interval set but idle
457459
IMAGE_STATUS_INTERVAL_IN_PROGRESS = 3; // interval set and capture in progress)
458460
}
461+
// The video status
459462
enum VideoStatus {
460463
VIDEO_STATUS_IDLE = 0; // idle
461464
VIDEO_STATUS_CAPTURE_IN_PROGRESS = 1; // capture in progress

protos/component_metadata/component_metadata.proto

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,16 @@ message RequestComponentRequest {
3838
uint32 compid = 1; // The component ID to request
3939
}
4040

41+
message RequestComponentResponse {}
42+
4143
message GetMetadataRequest {
4244
uint32 compid = 1; // The component ID to request
4345
MetadataType metadata_type = 2; // The metadata type
4446
}
4547

4648
message GetMetadataResponse {
4749
ComponentMetadataResult component_metadata_result = 1;
48-
MetadataData response = 2;
50+
MetadataData response = 2; // The response
4951
}
5052

5153
// Metadata response
@@ -55,32 +57,31 @@ message MetadataData {
5557

5658
// Result type.
5759
message ComponentMetadataResult {
58-
// Possible results returned for GetMetadata
60+
// Possible results returned
5961
enum Result {
60-
RESULT_SUCCESS = 0;
61-
RESULT_NOT_AVAILABLE = 1;
62-
RESULT_CONNECTION_ERROR = 2;
63-
RESULT_UNSUPPORTED = 3;
64-
RESULT_DENIED = 4;
65-
RESULT_FAILED = 5;
66-
RESULT_TIMEOUT = 6;
67-
RESULT_NO_SYSTEM = 7;
68-
RESULT_NOT_REQUESTED = 8;
62+
RESULT_SUCCESS = 0; // Success
63+
RESULT_NOT_AVAILABLE = 1; // Not available
64+
RESULT_CONNECTION_ERROR = 2; // Connection error
65+
RESULT_UNSUPPORTED = 3; // Unsupported
66+
RESULT_DENIED = 4; // Denied
67+
RESULT_FAILED = 5; // Failed
68+
RESULT_TIMEOUT = 6; // Timeout
69+
RESULT_NO_SYSTEM = 7; // No system
70+
RESULT_NOT_REQUESTED = 8; // Not requested
6971
}
7072

7173
Result result = 1; // Result enum value
7274
string result_str = 2; // Human-readable English string describing the result
7375
}
7476

75-
message RequestComponentResponse {}
7677
message RequestAutopilotComponentRequest {}
7778
message RequestAutopilotComponentResponse {}
7879

7980
message SubscribeMetadataAvailableRequest {}
8081

81-
82+
// An update about available metadata
8283
message MetadataAvailableResponse {
83-
MetadataUpdate data = 1;
84+
MetadataUpdate data = 1; // The metadata data
8485
}
8586

8687
// Metadata for a given component and type
@@ -90,6 +91,7 @@ message MetadataUpdate {
9091
string json_metadata = 3; // The JSON metadata
9192
}
9293

94+
// The metadata type
9395
enum MetadataType {
9496
METADATA_TYPE_ALL_COMPLETED = 0; // This is set in the subscription callback when all metadata types completed for a given component ID
9597
METADATA_TYPE_PARAMETER = 1; // Parameter metadata

protos/component_metadata_server/component_metadata_server.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ message SetMetadataRequest {
2020
}
2121
message SetMetadataResponse {}
2222

23+
// The metadata type and content
2324
message Metadata {
2425
MetadataType type = 1; // The metadata type
2526
string json_metadata = 2; // The JSON metadata
2627
}
2728

29+
// The metadata type
2830
enum MetadataType {
2931
METADATA_TYPE_PARAMETER = 0; // Parameter metadata
3032
METADATA_TYPE_EVENTS = 1; // Event definitions

protos/events/events.proto

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -26,31 +26,34 @@ service EventsService {
2626
rpc GetHealthAndArmingChecksReport(GetHealthAndArmingChecksReportRequest) returns(GetHealthAndArmingChecksReportResponse) { option (mavsdk.options.async_type) = SYNC; }
2727
}
2828

29+
// Log level type
2930
enum LogLevel {
30-
LOG_LEVEL_EMERGENCY = 0;
31-
LOG_LEVEL_ALERT = 1;
32-
LOG_LEVEL_CRITICAL = 2;
33-
LOG_LEVEL_ERROR = 3;
34-
LOG_LEVEL_WARNING = 4;
35-
LOG_LEVEL_NOTICE = 5;
36-
LOG_LEVEL_INFO = 6;
37-
LOG_LEVEL_DEBUG = 7;
31+
LOG_LEVEL_EMERGENCY = 0; // Emergency
32+
LOG_LEVEL_ALERT = 1; // Alert
33+
LOG_LEVEL_CRITICAL = 2; // Critical
34+
LOG_LEVEL_ERROR = 3; // Error
35+
LOG_LEVEL_WARNING = 4; // Warning
36+
LOG_LEVEL_NOTICE = 5; // Notice
37+
LOG_LEVEL_INFO = 6; // Info
38+
LOG_LEVEL_DEBUG = 7; // Debug
3839
}
3940

41+
// Event type
4042
message Event {
4143
uint32 compid = 1; // The source component ID of the event
4244
string message = 2; // Short, single-line message
4345
string description = 3; // Detailed description (optional, might be multiple lines)
44-
LogLevel log_level = 4;
46+
LogLevel log_level = 4; // Log level of message
4547

4648
string event_namespace = 5; // Namespace, e.g. "px4"
4749
string event_name = 6; // Event name (unique within the namespace)
4850
}
4951

52+
// Health and arming check problem type
5053
message HealthAndArmingCheckProblem {
5154
string message = 1; // Short, single-line message
5255
string description = 2; // Detailed description (optional, might be multiple lines)
53-
LogLevel log_level = 3;
56+
LogLevel log_level = 3; // Log level of message
5457
string health_component = 4; // Associated health component, e.g. "gps"
5558
}
5659

@@ -61,6 +64,7 @@ message HealthAndArmingCheckMode {
6164
repeated HealthAndArmingCheckProblem problems = 3; // List of reported problems for the mode
6265
}
6366

67+
// Health component report type
6468
message HealthComponentReport {
6569
string name = 1; // Unique component name, e.g. "gps"
6670
string label = 2; // Human readable label of the component, e.g. "GPS" or "Accelerometer"
@@ -69,6 +73,7 @@ message HealthComponentReport {
6973
bool has_warning = 5; // If the component has warnings
7074
}
7175

76+
// Health and arming check report type
7277
message HealthAndArmingCheckReport {
7378
HealthAndArmingCheckMode current_mode_intention = 1; // Report for currently intended mode
7479
// TODO: we can add reports for different modes here too (e.g. Takeoff or Mission)
@@ -79,15 +84,17 @@ message HealthAndArmingCheckReport {
7984

8085
// Result type.
8186
message EventsResult {
87+
// Possible results returned
8288
enum Result {
83-
RESULT_SUCCESS = 0;
84-
RESULT_NOT_AVAILABLE = 1;
85-
RESULT_CONNECTION_ERROR = 2;
86-
RESULT_UNSUPPORTED = 3;
87-
RESULT_DENIED = 4;
88-
RESULT_FAILED = 5;
89-
RESULT_TIMEOUT = 6;
90-
RESULT_NO_SYSTEM = 7;
89+
RESULT_SUCCESS = 0; // Successful result
90+
RESULT_NOT_AVAILABLE = 1; // Not available
91+
RESULT_CONNECTION_ERROR = 2; // Connection error
92+
RESULT_UNSUPPORTED = 3; // Unsupported
93+
RESULT_DENIED = 4; // Denied
94+
RESULT_FAILED = 5; // Failed
95+
RESULT_TIMEOUT = 6; // Timeout
96+
RESULT_NO_SYSTEM = 7; // No system available
97+
RESULT_UNKNOWN = 8; // Unknown result
9198
}
9299

93100
Result result = 1; // Result enum value
@@ -98,17 +105,17 @@ message EventsResult {
98105
message SubscribeEventsRequest {}
99106

100107
message EventsResponse {
101-
Event event = 1;
108+
Event event = 1; // The event
102109
}
103110

104111
message SubscribeHealthAndArmingChecksRequest {}
105112

106113
message HealthAndArmingChecksResponse {
107-
HealthAndArmingCheckReport report = 1;
114+
HealthAndArmingCheckReport report = 1; // The report
108115
}
109116

110117
message GetHealthAndArmingChecksReportRequest {}
111118
message GetHealthAndArmingChecksReportResponse {
112-
EventsResult events_result = 1;
113-
HealthAndArmingCheckReport report = 2;
119+
EventsResult events_result = 1; // The events result
120+
HealthAndArmingCheckReport report = 2; // The report
114121
}

protos/ftp/ftp.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ message ListDirectoryRequest {
7878
string remote_dir = 1; // The remote directory to list the contents for.
7979
}
8080

81+
// The output of a directory list
8182
message ListDirectoryData {
8283
repeated string dirs = 1; // The found directories.
8384
repeated string files = 2; // The found files.

protos/gimbal/gimbal.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ enum ControlMode {
241241
CONTROL_MODE_SECONDARY = 2; // To take secondary control over the gimbal
242242
}
243243

244+
// The send mode type
244245
enum SendMode {
245246
SEND_MODE_ONCE = 0; // Send command exactly once with quality of service (use for sporadic commands slower than 1 Hz)
246247
SEND_MODE_STREAM = 1; // Stream setpoint without quality of service (use for setpoints faster than 1 Hz).

0 commit comments

Comments
 (0)