-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
protos: add component_metadata and component_metadata_server
- Loading branch information
Showing
4 changed files
with
107 additions
and
136 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
71 changes: 0 additions & 71 deletions
71
protos/component_information_server/component_information_server.proto
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
syntax = "proto3"; | ||
|
||
package mavsdk.rpc.component_metadata; | ||
|
||
import "mavsdk_options.proto"; | ||
|
||
option java_package = "io.mavsdk.component_metadata"; | ||
option java_outer_classname = "ComponentMetadataProto"; | ||
|
||
// Access component metadata json definitions, such as parameters. | ||
service ComponentMetadataService { | ||
|
||
/* | ||
* Request metadata from a specific component | ||
*/ | ||
rpc RequestComponent(RequestComponentRequest) returns(EmptyResponse) { option (mavsdk.options.async_type) = SYNC; } | ||
|
||
/* | ||
* Request metadata from the autopilot component | ||
*/ | ||
rpc RequestAutopilotComponent(EmptyRequest) returns(EmptyResponse) { option (mavsdk.options.async_type) = SYNC; } | ||
|
||
/* | ||
* Register a callback that gets called when metadata is available | ||
*/ | ||
rpc SubscribeMetadataAvailable(MetadataAvailableRequest) returns(stream MetadataUpdateResponse) { option (mavsdk.options.async_type) = ASYNC; } | ||
|
||
/* | ||
* Request metadata from the autopilot component | ||
*/ | ||
rpc GetMetadata(GetMetadataRequest) returns(GetMetadataResponse) { option (mavsdk.options.async_type) = SYNC; } | ||
} | ||
|
||
message RequestComponentRequest { | ||
uint32 compid = 1; // The component ID to request | ||
} | ||
|
||
message GetMetadataRequest { | ||
uint32 compid = 1; // The component ID to request | ||
MetadataType type = 2; // The metadata type | ||
} | ||
|
||
message GetMetadataResponse { | ||
MetadataData response = 1; | ||
} | ||
|
||
// Metadata response | ||
message MetadataData { | ||
bool success = 1; // true if the metadata is available | ||
string json_metadata = 2; // The JSON metadata | ||
} | ||
|
||
message EmptyRequest {} | ||
|
||
message EmptyResponse {} | ||
|
||
message MetadataAvailableRequest {} | ||
|
||
|
||
message MetadataUpdateResponse { | ||
MetadataUpdate data = 1; | ||
} | ||
|
||
// Metadata for a given component and type | ||
message MetadataUpdate { | ||
uint32 compid = 1; // The component ID | ||
MetadataType type = 2; // The metadata type | ||
string json_metadata = 3; // The JSON metadata | ||
} | ||
|
||
enum MetadataType { | ||
PARAMETER = 0; // Parameter metadata | ||
Events = 1; // Event definitions | ||
Actuators = 2; // Actuator definitions | ||
} |
32 changes: 32 additions & 0 deletions
32
protos/component_metadata_server/component_metadata_server.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
syntax = "proto3"; | ||
|
||
package mavsdk.rpc.component_metadata_server; | ||
|
||
import "mavsdk_options.proto"; | ||
|
||
option java_package = "io.mavsdk.component_metadata_server"; | ||
option java_outer_classname = "ComponentMetadataServerProto"; | ||
|
||
// Provide component metadata json definitions, such as parameters. | ||
service ComponentMetadataServerService { | ||
/* | ||
* Provide metadata (can only be called once) | ||
*/ | ||
rpc SetMetadata(RequestComponentRequest) returns(EmptyResponse) { option (mavsdk.options.async_type) = SYNC; } | ||
} | ||
|
||
message RequestComponentRequest { | ||
repeated Metadata metadata = 1; // List of metadata | ||
} | ||
message EmptyResponse {} | ||
|
||
message Metadata { | ||
MetadataType type = 1; // The metadata type | ||
string json_metadata = 2; // The JSON metadata | ||
} | ||
|
||
enum MetadataType { | ||
PARAMETER = 0; // Parameter metadata | ||
Events = 1; // Event definitions | ||
Actuators = 2; // Actuator definitions | ||
} |