Goby3  3.1.5a
2024.05.23
io.proto
Go to the documentation of this file.
1 syntax = "proto2";
2 import "goby/protobuf/option_extensions.proto";
3 import "dccl/option_extensions.proto";
4 
5 package goby.middleware.protobuf;
6 
7 message UDPEndPoint
8 {
9  required string addr = 1;
10  required uint32 port = 2;
11 }
12 
13 message TCPEndPoint
14 {
15  optional string addr = 1;
16  optional uint32 port = 2;
17  optional bool all_clients = 3 [default = false];
18 }
19 
20 message IOData
21 {
22  optional int32 index = 1 [default = -1];
23 
24  oneof src
25  {
26  UDPEndPoint udp_src = 10;
27  TCPEndPoint tcp_src = 11;
28  }
29 
30  oneof dest
31  {
32  UDPEndPoint udp_dest = 20;
33  TCPEndPoint tcp_dest = 21;
34  }
35 
36  optional bytes data = 30;
37 }
38 
39 message SerialCommand
40 {
41  optional int32 index = 1 [default = -1];
42 
43  enum Command
44  {
45  SEND_BREAK = 1;
46  RTS_HIGH = 2;
47  RTS_LOW = 3;
48  DTR_HIGH = 4;
49  DTR_LOW = 5;
50  }
51  required Command command = 2;
52 }
53 
54 message SerialStatus
55 {
56  optional int32 index = 1 [default = -1];
57  optional bool rts = 2;
58  optional bool dtr = 3;
59 }
60 
61 message TCPServerEvent
62 {
63  optional int32 index = 1 [default = -1];
64  enum Event
65  {
66  EVENT_BIND = 0;
67  EVENT_CONNECT = 1;
68  EVENT_DISCONNECT = 2;
69  }
70  required Event event = 2;
71  optional TCPEndPoint local_endpoint = 3;
72  optional TCPEndPoint remote_endpoint = 4;
73  optional int32 number_of_clients = 5;
74 }
75 
76 message TCPClientEvent
77 {
78  optional int32 index = 1 [default = -1];
79  enum Event
80  {
81  EVENT_CONNECT = 1;
82  EVENT_DISCONNECT = 2;
83  }
84  required Event event = 2;
85  optional TCPEndPoint local_endpoint = 3;
86  optional TCPEndPoint remote_endpoint = 4;
87 }
88 
89 enum IOState
90 {
91  IO__STATE_UNKNOWN = -1;
92  IO__LINK_OPEN = 1;
93  IO__LINK_CLOSED = 2;
94  IO__CRITICAL_FAILURE = 3;
95 }
96 
97 message IOError
98 {
99  enum ErrorCode
100  {
101  IO__INIT_FAILURE = 1;
102  IO__READ_FAILURE = 2;
103  IO__WRITE_FAILURE = 3;
104  IO__DATA_TIMEOUT = 4;
105  }
106  required ErrorCode code = 1;
107  optional string text = 2;
108 }
109 
110 message IOStatus
111 {
112  optional int32 index = 1 [default = -1];
113  required IOState state = 2;
114  optional IOError error = 3;
115 }