-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
APP-7497: Add Button and Switch APIs
- Loading branch information
1 parent
e6bd6ba
commit 2d0a61d
Showing
2 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
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 viam.component.button.v1; | ||
|
||
import "common/v1/common.proto"; | ||
import "google/api/annotations.proto"; | ||
import "google/protobuf/struct.proto"; | ||
|
||
option go_package = "go.viam.com/api/component/button/v1"; | ||
option java_package = "com.viam.component.button.v1"; | ||
|
||
// A ButtonService services buttons associated with a machine | ||
service ButtonService { | ||
// Pushes a button | ||
rpc Push(PushRequest) returns (PushResponse) { | ||
option (common.v1.safety_heartbeat_monitored) = true; | ||
option (google.api.http) = {put: "/viam/api/v1/component/button/{name}/push"}; | ||
} | ||
|
||
// DoCommand sends/receives arbitrary commands | ||
rpc DoCommand(common.v1.DoCommandRequest) returns (common.v1.DoCommandResponse) { | ||
option (google.api.http) = {post: "/viam/api/v1/component/gripper/{name}/do_command"}; | ||
} | ||
} | ||
|
||
message PushRequest { | ||
string name = 1; | ||
google.protobuf.Struct extra = 99; | ||
} | ||
|
||
message PushResponse {} | ||
|
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,45 @@ | ||
syntax = "proto3"; | ||
|
||
package viam.component.switch.v1; | ||
|
||
import "common/v1/common.proto"; | ||
import "google/api/annotations.proto"; | ||
import "google/protobuf/struct.proto"; | ||
|
||
option go_package = "go.viam.com/api/component/switch/v1"; | ||
option java_package = "com.viam.component.switch.v1"; | ||
|
||
// A SwitchService services switches associated with a machine | ||
service SwitchService { | ||
// Turns on the switch | ||
rpc On(OnRequest) returns (OnResponse) { | ||
option (common.v1.safety_heartbeat_monitored) = true; | ||
option (google.api.http) = {put: "/viam/api/v1/component/switch/{name}/on"}; | ||
} | ||
|
||
// Turns off the switch | ||
rpc Off(OffRequest) returns (OffResponse) { | ||
option (common.v1.safety_heartbeat_monitored) = true; | ||
option (google.api.http) = {put: "/viam/api/v1/component/switch/{name}/off"}; | ||
} | ||
|
||
// DoCommand sends/receives arbitrary commands | ||
rpc DoCommand(common.v1.DoCommandRequest) returns (common.v1.DoCommandResponse) { | ||
option (google.api.http) = {post: "/viam/api/v1/component/gripper/{name}/do_command"}; | ||
} | ||
} | ||
|
||
message OnRequest { | ||
string name = 1; | ||
google.protobuf.Struct extra = 99; | ||
} | ||
|
||
message OnResponse {} | ||
|
||
message OffRequest { | ||
string name = 1; | ||
google.protobuf.Struct extra = 99; | ||
} | ||
|
||
message OffResponse {} | ||
|