DCCL v4
ccl.proto
1 // Copyright 2012-2023:
2 // GobySoft, LLC (2013-)
3 // Massachusetts Institute of Technology (2007-2014)
4 // Community contributors (see AUTHORS file)
5 // File authors:
6 // Toby Schneider <toby@gobysoft.org>
7 // Chris Murphy <cmurphy@aphysci.com>
8 //
9 //
10 // This file is part of the Dynamic Compact Control Language Library
11 // ("DCCL").
12 //
13 // DCCL is free software: you can redistribute it and/or modify
14 // it under the terms of the GNU Lesser General Public License as published by
15 // the Free Software Foundation, either version 2.1 of the License, or
16 // (at your option) any later version.
17 //
18 // DCCL is distributed in the hope that it will be useful,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU Lesser General Public License for more details.
22 //
23 // You should have received a copy of the GNU Lesser General Public License
24 // along with DCCL. If not, see <http://www.gnu.org/licenses/>.
25 syntax = "proto2";
26 
27 import "dccl/ccl/protobuf/ccl_extensions.proto";
28 import "dccl/option_extensions.proto";
29 
30 package dccl.legacyccl.protobuf;
31 
32 // typedef struct
33 // {
34 // unsigned char mode;
35 // char spare[31];
36 // }
37 // MODEM_MSG_DATA_EMPTY;
38 
39 message CCLMDATEmpty
40 {
41  // prefix CCL IDs with 0x0CC1 to get out of normal 0x0000 prefix
42  option (dccl.msg).id = 0x0CC10006;
43  option (dccl.msg).max_bytes = 32;
44  option (dccl.msg).codec_version = 2;
45 
46  required bytes spare = 1 [(dccl.field).max_length = 31];
47 }
48 
49 // typedef struct
50 // {
51 // unsigned char mode;
52 // // MDAT_REDIRECT
53 // unsigned char message_number;
54 // LATLON_COMPRESSED lat;
55 // // Center of search area
56 // LATLON_COMPRESSED lon;
57 // // Center of search area
58 // char speed_depth_flags;
59 // unsigned short depth_goal_encoded_transit;
60 // char speed_encoded_transit;
61 // unsigned char device_cmd_transit;
62 // // Sidescan, DIDSON range.
63 // unsigned short depth_goal_encoded_survey;
64 // char speed_encoded_survey;
65 // unsigned char device_cmd_survey;
66 // // Sidescan, DIDSON range.
67 // unsigned char num_rows;
68 // // 0 if not rows.
69 // unsigned short row_length;
70 // // in meters
71 // unsigned char spacing_0;
72 // // in meters
73 // unsigned char spacing_1;
74 // // in meters
75 // char heading_encoded;
76 // LATLON_COMPRESSED lat_start;
77 // // ack only, where redirect started
78 // LATLON_COMPRESSED lon_start;
79 // char spare[3];
80 // }
81 // MODEM_MSG_DATA_REDIRECT;
82 message CCLMDATRedirect
83 {
84  option (dccl.msg).id = 0x0CC10007;
85  option (dccl.msg).max_bytes = 32;
86  option (dccl.msg).codec_version = 2;
87 
88  required uint32 message_number = 1
89  [(dccl.field).min = 0, (dccl.field).max = 0xff];
90 
91  required double latitude = 2 [
92  (dccl.field).codec = "_ccl_latloncompressed",
93  (dccl.field).description = "Center of search area: latitude in degrees"
94  ];
95 
96  required double longitude = 3 [
97  (dccl.field).codec = "_ccl_latloncompressed",
98  (dccl.field).description = "Center of search area: longitude in degrees"
99  ];
100 
101  // replaces speed_depth_flags field
102  enum VerticalMode
103  {
104  DEPTH = 0;
105  ALTITUDE = 1;
106  RESERVED_2 = 2;
107  RESERVED_3 = 3;
108  RESERVED_4 = 4;
109  RESERVED_5 = 5;
110  RESERVED_6 = 6;
111  RESERVED_7 = 7;
112  }
113  enum ThrustMode
114  {
115  RPM = 0;
116  METERS_PER_SECOND = 1;
117  }
118 
119  required VerticalMode transit_vertical_mode = 4;
120  required ThrustMode transit_thrust_mode = 5;
121  required VerticalMode survey_vertical_mode = 6;
122  required ThrustMode survey_thrust_mode = 7;
123 
124  required float depth_goal_transit = 8
125  [(dccl.field).codec = "_ccl_depth", (dccl.field).(ccl).bit_size = 16];
126 
127  required float speed_transit = 9 [
128  (dccl.field).codec = "_ccl_speed",
129  (dccl.field).(ccl).thrust_mode_tag = 5
130  ];
131 
132  required uint32 device_cmd_transit = 10
133  [(dccl.field).min = 0, (dccl.field).max = 0xff];
134 
135  required float depth_goal_survey = 11
136  [(dccl.field).codec = "_ccl_depth", (dccl.field).(ccl).bit_size = 16];
137 
138  required float speed_survey = 12 [
139  (dccl.field).codec = "_ccl_speed",
140  (dccl.field).(ccl).thrust_mode_tag = 7
141  ];
142 
143  required uint32 device_cmd_survey = 13
144  [(dccl.field).min = 0, (dccl.field).max = 0xff];
145 
146  required uint32 num_rows = 14
147  [(dccl.field).min = 0, (dccl.field).max = 0xff];
148 
149  required uint32 row_length = 15
150  [(dccl.field).min = 0, (dccl.field).max = 0xffff];
151 
152  required uint32 spacing_0 = 16
153  [(dccl.field).min = 0, (dccl.field).max = 0xff];
154 
155  required uint32 spacing_1 = 17
156  [(dccl.field).min = 0, (dccl.field).max = 0xff];
157 
158  required float heading = 18 [
159  (dccl.field).codec = "_ccl_heading",
160  (dccl.field).description = "Heading in degrees"
161  ];
162 
163  required double lat_start = 19
164  [(dccl.field).codec = "_ccl_latloncompressed"];
165  required double lon_start = 20
166  [(dccl.field).codec = "_ccl_latloncompressed"];
167 
168  required bytes spare = 21 [(dccl.field).max_length = 3];
169 }
170 
171 // typedef struct
172 // {
173 // unsigned char mode;
174 // unsigned char spare;
175 // unsigned short depth[3];
176 // unsigned short altitude[3];
177 // LATLON_COMPRESSED latitude[3];
178 // LATLON_COMPRESSED longitude[3];
179 // }
180 // MODEM_MSG_DATA_BATHY;
181 message CCLMDATBathy
182 {
183  option (dccl.msg).id = 0x0CC10009;
184  option (dccl.msg).max_bytes = 32;
185  option (dccl.msg).codec_version = 2;
186 
187  required bytes spare = 1 [(dccl.field).max_length = 1];
188 
189  repeated float depth = 2 [
190  (dccl.field).codec = "_ccl_depth",
191  (dccl.field).(ccl).bit_size = 16,
192  (dccl.field).max_repeat = 3
193  ];
194 
195  repeated float altitude = 3 [
196  (dccl.field).codec = "_ccl_hires_altitude",
197  (dccl.field).max_repeat = 3
198  ];
199 
200  repeated double latitude = 4 [
201  (dccl.field).codec = "_ccl_latloncompressed",
202  (dccl.field).max_repeat = 3
203  ];
204 
205  repeated double longitude = 5 [
206  (dccl.field).codec = "_ccl_latloncompressed",
207  (dccl.field).max_repeat = 3
208  ];
209 }
210 
211 // typedef struct
212 // {
213 // unsigned char mode;
214 // // MDAT_CTD
215 // unsigned char spare;
216 // unsigned char salinity[2];
217 // unsigned char temperature[2];
218 // unsigned short depth[2];
219 // unsigned char sound_speed[2];
220 // LATLON_COMPRESSED latitude[2];
221 // LATLON_COMPRESSED longitude[2];
222 // char spare2[8];
223 // }
224 // MODEM_MSG_DATA_CTD;
225 
226 // untested, CCL spec does not give test case
227 message CCLMDATCTD
228 {
229  option (dccl.msg).id = 0x0CC1000A;
230  option (dccl.msg).max_bytes = 32;
231  option (dccl.msg).codec_version = 2;
232 
233  required bytes spare = 1 [(dccl.field).max_length = 1];
234 
235  repeated float salinity = 2
236  [(dccl.field).codec = "_ccl_salinity", (dccl.field).max_repeat = 2];
237 
238  repeated float temperature = 3
239  [(dccl.field).codec = "_ccl_temperature", (dccl.field).max_repeat = 2];
240 
241  repeated float depth = 4 [
242  (dccl.field).codec = "_ccl_depth",
243  (dccl.field).(ccl).bit_size = 16,
244  (dccl.field).max_repeat = 2
245  ];
246 
247  repeated float sound_speed = 5
248  [(dccl.field).codec = "_ccl_sound_speed", (dccl.field).max_repeat = 2];
249 
250  repeated double latitude = 6 [
251  (dccl.field).codec = "_ccl_latloncompressed",
252  (dccl.field).max_repeat = 2
253  ];
254 
255  repeated double longitude = 7 [
256  (dccl.field).codec = "_ccl_latloncompressed",
257  (dccl.field).max_repeat = 2
258  ];
259 
260  required bytes spare2 = 8 [(dccl.field).max_length = 8];
261 }
262 
263 // typedef struct
264 // {
265 // unsigned char mode;
266 // unsigned char spare;
267 // unsigned short command;
268 // char parameter[28];
269 // }
270 // MODEM_MSG_DATA_COMMAND;
271 message CCLMDATCommand
272 {
273  option (dccl.msg).id = 0x0CC1000B;
274  option (dccl.msg).max_bytes = 32;
275  option (dccl.msg).codec_version = 2;
276 
277  required bytes spare = 1 [(dccl.field).max_length = 1];
278 
279  enum Command
280  {
281  RESERVED_0 = 0;
282  ABORT_TO_END_POSITION_OF_MISSION = 1;
283  ABORT_IMMEDIATELY = 2;
284  START_MISSION = 3;
285  RELEASE_DESCENT_WEIGHT = 4;
286  RELEASE_ASCENT_WEIGHT = 5;
287  RELEASE_PICKUP_FLOAT = 6;
288  ENABLE_MODEM_RANGER_PING = 7;
289  DISABLE_MODEM_RANGER_PING = 8;
290  OBSOLETE_9 = 9;
291  OBSOLETE_10 = 10;
292  OBSOLETE_11 = 11;
293  OBSOLETE_12 = 12;
294  OBSOLETE_13 = 13;
295  ACCEPT_NEXT_FIX = 14;
296  DUMP_REDIRECT_COMMANDS = 15;
297  GET_GPS_FIX = 16;
298  ABORT_TO_MISSION_START_LOCATION = 17;
299  ABORT_TO_DESTINATION = 18;
300  DUMP_REDIRECT_COMMANDS_EXCEPT_CURRENT = 19;
301  ABORT_DROP_ASCENT_WEIGHT_AND_POWER_TO_SURFACE = 20;
302  RESERVED_21 = 21;
303  RESERVED_22 = 22;
304  RESERVED_23 = 23;
305  RESERVED_24 = 24;
306  RESERVED_25 = 25;
307  RESERVED_26 = 26;
308  RESERVED_27 = 27;
309  RESERVED_28 = 28;
310  RESERVED_29 = 29;
311  RESERVED_30 = 30;
312  RESERVED_31 = 31;
313  }
314  required Command command = 2;
315 
316  // placeholder for the unenumerated commands
317  required uint32 reserved_command = 3
318  [(dccl.field).min = 0, (dccl.field).max = 0x7ff];
319 
320  required bytes parameter = 4 [(dccl.field).max_length = 28];
321 }
322 
323 // typedef struct
324 // {
325 // unsigned char mode;
326 // // MDAT_STATE
327 // LATLON_COMPRESSED latitude;
328 // // 3 bytes
329 // LATLON_COMPRESSED longitude;
330 // unsigned char fix_age
331 // TIME_DATE time_date;
332 // // 3 bytes;
333 // unsigned char heading;
334 // // 1.5 degree resolution
335 // unsigned short mission_mode_depth;
336 // //
337 // unsigned long faults;
338 // unsigned char faults_2;
339 // unsigned char mission_leg;
340 // char est_velocity;
341 // char objective_index;
342 // unsigned char watts_encoded;
343 // LATLON_COMPRESSED lat_goal;
344 // // 3 bytes
345 // LATLON_COMPRESSED lon_goal;
346 // // 3 bytes
347 // unsigned char battery_percent;
348 // unsigned short gfi_pitch_oil_encoded;
349 // // 5 bits gfi,6 bits pitch,
350 // // 5 bits oil
351 // }
352 // MODEM_MSG_DATA_STATE;
353 
354 message CCLMDATState
355 {
356  option (dccl.msg).id = 0x0CC1000E;
357  option (dccl.msg).max_bytes = 32;
358  option (dccl.msg).codec_version = 2;
359 
360  required double latitude = 1 [
361  (dccl.field).codec = "_ccl_latloncompressed",
362  (dccl.field).description = "Latitude in degrees"
363  ];
364 
365  required double longitude = 2 [
366  (dccl.field).codec = "_ccl_latloncompressed",
367  (dccl.field).description = "Longitude in degrees"
368  ];
369 
370  required uint32 fix_age = 3 [
371  (dccl.field).codec = "_ccl_fix_age",
372  (dccl.field).description = "Fix age in seconds"
373  ];
374 
375  required uint64 time_date = 4 [
376  (dccl.field).codec = "_ccl_time_date",
377  (dccl.field).description =
378  "Microseconds since UNIX 1970/01/01 00:00:00 UTC"
379  ];
380  required float heading = 5 [
381  (dccl.field).codec = "_ccl_heading",
382  (dccl.field).description = "Heading in degrees"
383  ];
384  required float depth = 6 [
385  (dccl.field).codec = "_ccl_depth",
386  (dccl.field).description = "Depth in meters",
387  (dccl.field).(ccl).bit_size = 13
388  ]; // 13 since MissionMode is stuck in the top three bits
389 
390  enum MissionMode
391  {
392  MISSION_COMPLETED = 0;
393  MANUAL_MODE = 1;
394  TEST = 2;
395  FAULT = 3;
396  UNKNOWN_MODE_4 = 4;
397  REDIRECT_MISSION_IN_PROGRESS = 5;
398  NORMAL = 6;
399  UNKNOWN_MODE_7 = 7;
400  };
401 
402  required MissionMode mission_mode = 7;
403 
404  required bytes faults = 8 [(dccl.field).max_length = 4];
405  required bytes faults_2 = 9 [(dccl.field).max_length = 1];
406  required uint32 mission_leg = 10
407  [(dccl.field).max = 0xff, (dccl.field).min = 0];
408  required float est_velocity = 11 [
409  (dccl.field).codec = "_ccl_velocity",
410  (dccl.field).description = "Velocity from ADCP or prop turns in m/s"
411  ];
412  required bytes objective_index = 12 [(dccl.field).max_length = 1];
413  required float watts = 13 [(dccl.field).codec = "_ccl_watts"];
414  required double lat_goal = 14 [
415  (dccl.field).codec = "_ccl_latloncompressed",
416  (dccl.field).description = "Latitude goal in degrees"
417  ];
418  required double lon_goal = 15 [
419  (dccl.field).codec = "_ccl_latloncompressed",
420  (dccl.field).description = "Longitude goal in degrees"
421  ];
422  required uint32 battery_percent = 16
423  [(dccl.field).max = 0xff, (dccl.field).min = 0];
424 
425  message GFIPitchOil
426  {
427  required float gfi = 1
428  [(dccl.field).description = "Percentage ground fault (0-100)"];
429  required float pitch = 2
430  [(dccl.field).description = "Pitch of the vehicle in degrees"];
431  required float oil = 3 [
432  (dccl.field).description =
433  "Percentage of the available capacity remaining in the oil compensation system, or 0 if no such system"
434  ];
435  }
436  required GFIPitchOil gfi_pitch_oil = 17
437  [(dccl.field).codec = "_ccl_gfi_pitch_oil"];
438 }
439 
440 // typedef struct
441 // {
442 // unsigned char mode;
443 // char message[31];
444 // }
445 // MODEM_MSG_ERROR_MSG;
446 message CCLMDATError
447 {
448  // prefix CCL IDs with 0x0CC1 to get out of normal 0x0000 prefix
449  option (dccl.msg).id = 0x0CC1000F;
450  option (dccl.msg).max_bytes = 32;
451  option (dccl.msg).codec_version = 2;
452 
453  required bytes message = 1 [(dccl.field).max_length = 31];
454 }