Unverified Commit c2e1a259 authored by per1234's avatar per1234 Committed by GitHub

[skip changelog] Add documentation for gRPC Monitor service (#693)

Comments added to the .proto files are included in the generated gRPC interface documentation.
parent 147958b0
......@@ -135,8 +135,11 @@ func (*StreamingOpenReq) XXX_OneofWrappers() []interface{} {
// Tells the monitor which target to open and provides additional parameters
// that might be needed to configure the target or the monitor itself.
type MonitorConfig struct {
// The target name.
Target string `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"`
Type MonitorConfig_TargetType `protobuf:"varint,2,opt,name=type,proto3,enum=cc.arduino.cli.monitor.MonitorConfig_TargetType" json:"type,omitempty"`
// Additional parameters that might be needed to configure the target or the
// monitor itself.
AdditionalConfig *_struct.Struct `protobuf:"bytes,3,opt,name=additionalConfig,proto3" json:"additionalConfig,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
......@@ -191,6 +194,7 @@ func (m *MonitorConfig) GetAdditionalConfig() *_struct.Struct {
//
type StreamingOpenResp struct {
// The data received from the target.
Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
......@@ -276,6 +280,8 @@ const _ = grpc.SupportPackageIsVersion4
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type MonitorClient interface {
// Open a bidirectional monitor stream. This can be used to implement
// something similar to the Arduino IDE's Serial Monitor.
StreamingOpen(ctx context.Context, opts ...grpc.CallOption) (Monitor_StreamingOpenClient, error)
}
......@@ -320,6 +326,8 @@ func (x *monitorStreamingOpenClient) Recv() (*StreamingOpenResp, error) {
// MonitorServer is the server API for Monitor service.
type MonitorServer interface {
// Open a bidirectional monitor stream. This can be used to implement
// something similar to the Arduino IDE's Serial Monitor.
StreamingOpen(Monitor_StreamingOpenServer) error
}
......
......@@ -23,6 +23,8 @@ import "google/protobuf/struct.proto";
// Service that abstract a Monitor usage
service Monitor {
// Open a bidirectional monitor stream. This can be used to implement
// something similar to the Arduino IDE's Serial Monitor.
rpc StreamingOpen(stream StreamingOpenReq)
returns (stream StreamingOpenResp) {}
}
......@@ -50,12 +52,16 @@ message StreamingOpenReq {
message MonitorConfig {
enum TargetType { SERIAL = 0; }
// The target name.
string target = 1;
TargetType type = 2;
// Additional parameters that might be needed to configure the target or the
// monitor itself.
google.protobuf.Struct additionalConfig = 3;
}
//
message StreamingOpenResp {
// The data received from the target.
bytes data = 1;
}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment