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