Goby v2
waveglider_sv2_frontseat_driver.proto
1 
2 import "dccl/option_extensions.proto";
3 
4 package goby.moos.protobuf;
5 
6 enum MessageTypes
7 {
8  MESSAGE_TYPE_NAK = 0x0000;
9  MESSAGE_TYPE_ACK = 0x0001;
10  MESSAGE_TYPE_REQUESTID_ENUMERATE = 0x0010;
11  MESSAGE_TYPE_TELEMETRY = 0x0015;
12  MESSAGE_TYPE_REQUEST_STATUS = 0x0022;
13  MESSAGE_TYPE_SEND_FORWARD_MESSAGE = 0x0024;
14  MESSAGE_TYPE_POWER_STATUS_AND_CONTROL = 0x0030;
15  MESSAGE_TYPE_REQUEST_QUEUED_MESSAGE = 0x0040;
16  MESSAGE_TYPE_ACK_NAK_QUEUED_MESSAGE = 0x0041;
17 }
18 
19 message SV2Header
20 {
21  required uint32 start_of_frame = 1
22  [(dccl.field).max = 0xFF]; // always 0x7e
23  required uint32 message_size = 2 [(dccl.field).max = 0xFFFF]; // (2 bytes)
24  required uint32 dest = 3
25  [(dccl.field).max =
26  0xFFFF]; // (2 bytes - LSB = Task ID, MSB = Board ID)
27  required uint32 src = 4
28  [(dccl.field).max =
29  0xFFFF]; // (2 bytes - LSB = Task ID, MSB = Board ID)
30  required uint32 transaction_id = 5
31  [(dccl.field).max = 0xFFFF]; // (2 bytes)
32  required uint32 message_type = 6 [
33  (dccl.field).max = 0xFFFF
34  ]; // (16 bits) - top bit is ack (if 0), no ack (if 1) requested
35 
36  enum BoardId
37  {
38  BOARD_ID_CC = 0x00;
39  BOARD_ID_BROADCAST = 0xFF;
40  }
41  enum CCTaskId
42  {
43  CCTASK_ID_MAIN = 0x00;
44  CCTASK_ID_COMMAND = 0x01;
45  CCTASK_ID_IRIDIUM = 0x02;
46  CCTASK_ID_DEBUG_CONSOLE = 0x03;
47  CCTASK_ID_XBEE = 0x04;
48  CCTASK_ID_FILE_TRANSFER = 0x05;
49  CCTASK_ID_DEFAULT_HOST = 0x06;
50  CCTASK_ID_FORWARD_FULL_MESSAGE = 0x20;
51  }
52 }
53 
54 message SV2Footer
55 {
56  required uint32 crc16 = 1 [(dccl.field).max = 0xFFFF]; // (2 bytes)
57 }
58 
59 message SV2RequestEnumerate
60 {
61  option (dccl.msg).id = 0x7E0010;
62  option (dccl.msg).max_bytes = 557;
63  option (dccl.msg).codec_version = 3;
64  option (dccl.msg).codec_group = "SV2";
65 
66  required SV2Header header = 1;
67  required uint32 protocols_supported = 2
68  [(dccl.field).max = 0xFFFF]; // (2 bytes - always 0x0001)
69  required uint32 commands_supported = 3
70  [(dccl.field).max = 0xFFFF]; // (2 bytes - always 0x0001)
71  required SV2Footer footer = 100;
72 }
73 
74 message SV2ReplyEnumerate
75 {
76  option (dccl.msg).id = 0x7E0101;
77  option (dccl.msg).max_bytes = 557;
78  option (dccl.msg).codec_version = 3;
79  option (dccl.msg).codec_group = "SV2";
80 
81  required SV2Header header = 1;
82 
83  required uint32 original_msg_type = 2
84  [(dccl.field).max = 0xFFFF]; // (2 bytes)
85  required uint32 number_of_devices_responding = 3
86  [(dccl.field).max = 0xFFFF]; // (2 bytes), always 1 for us
87  required uint32 number_of_devices_in_message = 4
88  [(dccl.field).max = 0xFFFF]; // (2 bytes), always 1 for us
89 
90  required uint32 version = 10
91  [(dccl.field).max = 0xFFFF]; // (2 bytes, 0x0001)
92  required uint32 device_type = 11
93  [(dccl.field).max =
94  0xFFFF]; // (2 bytes, 0x1001 to 0x7FFF for customer use)
95  required uint32 board_addr = 12 [(dccl.field).max = 0xFFFF]; // (2 bytes)
96  required bytes serial_number = 13
97  [(dccl.field).max_length = 6]; // (6 bytes - ASCII string)
98  required uint32 location = 14
99  [(dccl.field).max = 0xFF]; // (1 byte - always 0)
100  required uint32 polling_frequency = 15
101  [(dccl.field).max = 0xFFFFFFFF]; // (4 bytes - seconds between polls)
102  required uint32 extra_info = 16 [
103  (dccl.field).max = 0xFF
104  ]; // (1 byte - bit mask 0x01 = telemetry, 0x02 = power, 0x04 = event; 0x08
105  // = command ack/nak desired. Upper 4 bits should be zero)
106  required uint32 firmware_major = 17 [(dccl.field).max = 0xFF]; // (1 byte)
107  required uint32 firmware_minor = 18 [(dccl.field).max = 0xFF]; // (1 byte)
108  required uint32 firmware_revision = 19
109  [(dccl.field).max = 0xFFFF]; // (2 bytes)
110  required bytes description = 20
111  [(dccl.field).max_length = 20]; // (20 byte description of device)
112  required SV2Footer footer = 100;
113 }
114 
115 message SV2RequestStatus
116 {
117  option (dccl.msg).id = 0x7E0022;
118  option (dccl.msg).max_bytes = 557;
119  option (dccl.msg).codec_version = 3;
120  option (dccl.msg).codec_group = "SV2";
121 
122  required SV2Header header = 1;
123 
124  required bytes time = 2 [(dccl.field).max_length = 6];
125  required uint32 latitude = 3 [(dccl.field).max = 0xFFFFFFFF];
126  required uint32 longitude = 4 [(dccl.field).max = 0xFFFFFFFF];
127  required uint32 fix_valid = 5 [(dccl.field).max = 0xFF];
128 
129  required SV2Footer footer = 100;
130 }
131 
132 message SV2ReplyStatus
133 {
134  option (dccl.msg).id = 0x7E0201;
135  option (dccl.msg).max_bytes = 557;
136  option (dccl.msg).codec_version = 3;
137  option (dccl.msg).codec_group = "SV2";
138 
139  required SV2Header header = 1;
140 
141  required uint32 original_msg_type = 2
142  [(dccl.field).max = 0xFFFF]; // (2 bytes)
143  required uint32 number_of_devices_responding = 3
144  [(dccl.field).max = 0xFFFF]; // (2 bytes), always 1 for us
145  required uint32 number_of_devices_in_message = 4
146  [(dccl.field).max = 0xFFFF]; // (2 bytes), always 1 for us
147 
148  required uint32 version = 10
149  [(dccl.field).max = 0xFFFF]; // (2 bytes, 0x0001)
150  required uint32 board_addr = 11 [(dccl.field).max = 0xFFFF]; // (2 bytes)
151 
152  required uint32 alarms = 12 [(dccl.field).max = 0xFFFF];
153  required uint32 leak_sensor_1 = 13 [(dccl.field).max = 0xFF];
154  required uint32 leak_sensor_2 = 14 [(dccl.field).max = 0xFF];
155  required uint32 humid_temp = 15 [(dccl.field).max = 0xFF];
156  required uint32 relative_humidity = 16 [(dccl.field).max = 0xFF];
157  required uint32 pressure_temp = 17 [(dccl.field).max = 0xFF];
158  required uint32 pressure = 18 [(dccl.field).max = 0xFF];
159 
160  required SV2Footer footer = 100;
161 }
162 
163 message SV2RequestQueuedMessage
164 {
165  option (dccl.msg).id = 0x7E0040;
166  option (dccl.msg).max_bytes = 557;
167  option (dccl.msg).codec_version = 3;
168  option (dccl.msg).codec_group = "SV2";
169 
170  required SV2Header header = 1;
171  required SV2Footer footer = 100;
172 }
173 
174 message SV2ReplyQueuedMessage
175 {
176  option (dccl.msg).id = 0x7E0301;
177  option (dccl.msg).max_bytes = 557;
178  option (dccl.msg).codec_version = 3;
179  option (dccl.msg).codec_group = "SV2";
180 
181  required SV2Header header = 1;
182  required uint32 original_msg_type = 2
183  [(dccl.field).max = 0xFFFF]; // (2 bytes)
184  required SV2Footer footer = 100;
185 }
186 
187 message SV2ACKNAKQueuedMessage
188 {
189  option (dccl.msg).id = 0x7E0041;
190  option (dccl.msg).max_bytes = 557;
191  option (dccl.msg).codec_version = 3;
192  option (dccl.msg).codec_group = "SV2";
193 
194  required SV2Header header = 1;
195 
196  required uint32 command_format = 2
197  [(dccl.field).max = 0xFFFF]; // always 0x0001
198  required uint32 response_code = 3 [(dccl.field).max = 0xFF];
199  required uint32 response_message_length = 4 [(dccl.field).max = 0xFFFF];
200  // required bytes response_message = 5;
201 
202  required SV2Footer footer = 100;
203 }
204 
205 message SV2GenericNAK
206 {
207  option (dccl.msg).id = 0x7E0000;
208  option (dccl.msg).max_bytes = 557;
209  option (dccl.msg).codec_version = 3;
210  option (dccl.msg).codec_group = "SV2";
211 
212  required SV2Header header = 1;
213 
214  required uint32 original_msg_type = 2
215  [(dccl.field).max = 0xFFFF]; // always 0x0001
216  required uint32 response_code = 3 [(dccl.field).max = 0xFF];
217  // required bytes nak_details = 5;
218 
219  required SV2Footer footer = 100;
220 }
221 
222 message SV2GenericACK
223 {
224  option (dccl.msg).id = 0x7E0001;
225  option (dccl.msg).max_bytes = 557;
226  option (dccl.msg).codec_version = 3;
227  option (dccl.msg).codec_group = "SV2";
228 
229  required SV2Header header = 1;
230 
231  required uint32 original_msg_type = 2
232  [(dccl.field).max = 0xFFFF]; // always 0x0001
233  // required bytes ack_details = 5;
234 
235  required SV2Footer footer = 100;
236 }
237 
238 message SV2SendToConsole
239 {
240  option (dccl.msg).id = 0x7E0401;
241  option (dccl.msg).max_bytes = 557;
242  option (dccl.msg).codec_version = 3;
243  option (dccl.msg).codec_group = "SV2";
244 
245  required SV2Header header = 1;
246  required uint32 original_msg_type = 2
247  [(dccl.field).max = 0xFFFF]; // 0x0040
248  required bytes text = 5 [(dccl.field).max_length = 14];
249  required SV2Footer footer = 100;
250 }
251 
252 message SV2CommandFollowFixedHeading
253 {
254  option (dccl.msg).id = 0x7E0501;
255  option (dccl.msg).max_bytes = 557;
256  option (dccl.msg).codec_version = 3;
257  option (dccl.msg).codec_group = "SV2";
258 
259  required SV2Header header = 1;
260  required uint32 original_msg_type = 2
261  [(dccl.field).max = 0xFFFF]; // 0x0040
262 
263  required uint32 command_format = 3 [(dccl.field).max = 0xFFFF]; // 0x0001
264 
265  required CommandFollowFixedHeadingBody body = 4;
266  message CommandFollowFixedHeadingBody
267  {
268  option (dccl.msg).id = 0x7E01FF;
269  option (dccl.msg).max_bytes = 557;
270  option (dccl.msg).codec_version = 3;
271  option (dccl.msg).codec_group = "SV2";
272 
273  // level2
274  required uint32 level2id = 4 [(dccl.field).max = 0xFF]; // 0x0A
275  required uint32 wgmsid = 5
276  [(dccl.field).max = 0xFFFFFFFF]; // 0xFFFFFFFF
277  required uint32 data_size = 6 [(dccl.field).max = 0xFFFF];
278 
279  // level1
280  required uint32 structure_id = 7 [(dccl.field).max = 0xFF]; // 0x10
281  required uint32 command_value = 8
282  [(dccl.field).max = 0xFFFF]; // 0x0008
283  required uint32 reserved = 9 [(dccl.field).max = 0xFFFFFF]; // unused
284  required uint32 heading_degrees = 10
285  [(dccl.field).max = 0xFFFF]; // 0 to 359
286  required uint32 latitude = 11
287  [(dccl.field).max = 0xFFFFFFFF]; // unused (0)
288  required uint32 longitude = 12
289  [(dccl.field).max = 0xFFFFFFFF]; // unused (0)
290  required uint32 crc16 = 100 [(dccl.field).max = 0xFFFF]; // (2 bytes)
291  }
292 
293  required SV2Footer footer = 100;
294 }