Goby3  3.1.5
2024.05.14
modem_message.proto
Go to the documentation of this file.
1 syntax = "proto2";
2 import "dccl/option_extensions.proto";
3 import "goby/protobuf/option_extensions.proto";
4 
5 package goby.acomms.protobuf;
6 
7 message ModemTransmission
8 {
9  option (dccl.msg).unit_system = "si";
10 
11  optional int32 src = 1 [
12  (dccl.field).min = -1,
13  (dccl.field).max = 30,
14  (goby.field).description =
15  "modem ID of message source. 0 indicates BROADCAST.",
16  default = -1
17  ]; // 0 (BROADCAST), 1-30
18 
19  optional int32 dest = 2 [
20  (dccl.field).min = -1,
21  (dccl.field).max = 30,
22  (goby.field).description =
23  "modem ID of message destination. 0 indicates BROADCAST, -1 "
24  "indicates QUERY_DESTINATION_ID (i.e., destination is set to the "
25  "destination of the next available packet",
26  default = -1
27  ]; // 0 (BROADCAST), 1-30, -1 (QUERY_DESTINATION_ID)
28  optional uint64 time = 3 [
29  (dccl.field) = {
30  omit: true,
31  units { prefix: "micro" base_dimensions: "T" }
32  },
33  (goby.field).description =
34  "timestamp (microseconds since UNIX (1970-01-01 00:00:00 UTC) of "
35  "this transmission",
36  (goby.field).cfg.action = NEVER
37  ];
38  enum TimeSource
39  {
40  MODEM_TIME = 1;
41  GOBY_TIME = 2;
42  }
43  optional TimeSource time_source = 5 [
44  (dccl.field).omit = true,
45  default = GOBY_TIME,
46  (goby.field).description = "source of the timestamp given",
47  (goby.field).cfg.action = NEVER
48  ];
49  optional int32 rate = 6 [
50  (dccl.field).min = -1,
51  (dccl.field).max = 14,
52  (goby.field).description =
53  "0 (lowest) - 14 (highest), -1 (QUERY_RATE). QUERY_RATE is "
54  "currently unsupported by Goby-Queue",
55  default = 0
56  ];
57 
58  enum TransmissionType
59  {
60  // General (DriverBase) types
61  DATA = 1;
62  ACK = 2;
63  DRIVER_SPECIFIC = 10;
64  }
65 
66  optional TransmissionType type = 7 [
67  default = DATA,
68  (goby.field).description =
69  "Type of this transmission. DRIVER_SPECIFIC types are "
70  "enumerated "
71  "in the extensions for the selected driver."
72  ];
73 
74  // for type == DATA
75  optional uint32 max_num_frames = 11 [
76  (dccl.field).omit = true,
77  default = 1
78  ]; // set by the modem driver for the given rate
79  optional uint32 max_frame_bytes = 12
80  [(dccl.field).omit = true]; // set by the modem driver for the
81  // given rate, omitted means no maximum
82  optional bool ack_requested = 13
83  [default = true]; // acoustic acknowledgment requested
84  repeated bytes frame = 14 [
85  (dccl.field).omit = true,
86  (goby.field).description =
87  "Data to transmit, represented as ASCII or octal bytes "
88  "preceeded "
89  "by a '\\' (e.g. \\000 is 0x00)"
90  ]; // if omitted, you will be queried for data on signal_data_request.
91  // You can also set some frames here and the rest will be filled by
92  // signalling a data request
93 
94  optional uint32 frame_start = 15 [(dccl.field).omit = true, default = 0];
95 
96  // for type == ACK
97  repeated int32 acked_frame = 20
98  [(dccl.field).omit = true, (goby.field).cfg.action = NEVER];
99 
100  // for AMAC
101  optional double slot_seconds = 30 [
102  (dccl.field) = {
103  min: 0
104  max: 3600
105  precision: 1
106  units { base_dimensions: "T" }
107  },
108  default = 10
109  ]; // length of slot (in seconds) if this transmission is part of a
110  // TDMA cycle
111  optional uint32 unique_id = 31 [
112  (dccl.field).min = 0,
113  (dccl.field).max = 100,
114  (goby.field).example = "0"
115  ]; // used to assign an ID to this slot
116  optional bool always_initiate = 32 [default = false];
117  optional int32 slot_index = 33 [(dccl.field).omit = true];
118 
119  // extensions 1000-1100 used by mm_driver.proto
120  // extensions 1201-1202 used by abc_driver.proto (example driver)
121  // extensions 1300-1320 used by ufield_sim_driver.proto
122  // extensions 1321-1340 used by pb_modem_driver.proto
123  // extensions 1341-1360 used by udp_driver.proto
124  // extensions 1361-1380 used by bluefin_driver.proto
125  // extensions 1381-1400 used by iridium_driver.proto
126  // extensions 1401-1420 used by benthos_atm900.proto
127  // extensions 1421-1440 used by mccs_driver.proto
128  // extension 1441 used by popoto_driver.proto
129  // extensions 1500-1509 used by Jaiabot:
130  // https://github.com/jaiarobotics/jaiabot/
131  // extensions 1510-1519 used by Blue Ocean Seismic Services
132  extensions 1000 to max;
133 }
134 
135 message ModemRaw
136 {
137  required bytes raw = 7; // "$CARXD,..."
138  optional string description = 8; // "Incoming hexadecimal data"
139 }
140 
141 message ModemReport
142 {
143  option (dccl.msg).unit_system = "si";
144 
145  optional int32 modem_id = 1 [default = -1];
146 
147  enum LinkState
148  {
149  LINK_NOT_AVAILABLE = 1;
150  LINK_AVAILABLE = 2;
151  }
152 
153  optional uint64 time = 2
154  [(dccl.field) = { units { prefix: "micro" base_dimensions: "T" } }];
155 
156  // default is LINK_AVAILABLE so drivers that do not implement this report
157  // will not be considered to always be unavailable
158  optional LinkState link_state = 3 [default = LINK_AVAILABLE];
159 
160  enum LinkQuality
161  {
162  QUALITY_VERY_LOW = 1;
163  QUALITY_LOW = 2;
164  QUALITY_UNKNOWN = 3; // treat unknown quality as just below medium
165  QUALITY_MEDIUM = 4;
166  QUALITY_HIGH = 5;
167  QUALITY_VERY_HIGH = 6;
168  }
169  optional LinkQuality link_quality = 4 [default = QUALITY_UNKNOWN];
170 
171  // same assignment as ModemTransmission
172  extensions 1000 to max;
173 }