forked from swift-nav/libsbp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.yaml
116 lines (101 loc) · 3.73 KB
/
example.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# Packages define a logical collection of SBP messages. Packages can
# in turn include other packages in the directory hierarchy. A package
# identifier specifies a directory path for the generated code,
# followed by an optional description used for documentation. By
# convention, packages marked as "stable" are unlikely to change much
# in the future, whereas unstable messages may change with future
# firmware development. Some packages are purely informative and are
# omitted from code generation using "render_source".
package: example
description: Geodetic navigation messages and friends.
render_source: True
stable: True
include:
# types.yaml defines common primitives used in the spec.
- types.yaml
# The definitions in a package can contain both SBP messages and
# struct definitions.
definitions:
# A definition contains a series of named keys, many of which are
# optional, such as "short_desc", "id", etc. By default, any
# definition containing the 'id' field is considered an SBP message;
# the 'id' field uniquely identifies the message type of the payload
# contents. Defined fields layout the structure of an SBP payload.
#
# For example, an SBP message with a message type_id 0x0203 is a
# MSG_BASELINE_NED instance, with a payload containing 'tow', 'n',
# 'e', 'd', etc. data fields consumed by the user.
- MSG_BASELINE_NED:
id: 0x0203
short_desc: Baseline in NED
desc: |
Baseline in local North East Down (NED) coordinates.
# Each message definition has a series of fields, not unlike a C
# struct. Each field has a type, which is either a primitive (e.g.,
# u32 for 32-bit unsigned integer) or a more complex, predefined
# type. You can optionally include units or a description.
fields:
- tow:
type: u32
units: ms
desc: GPS Time of Week
- n:
type: s32
units: mm
desc: Baseline North coordinate
- e:
type: s32
units: mm
desc: Baseline East coordinate
- d:
type: s32
units: mm
desc: Baseline Down coordinate
- n_sats:
type: u8
desc: Number of satellites used in solution
# Fields that contain fields themselves denote bitfields.
- flags:
type: u8
desc: Status flags
fields:
- 3-7:
desc: Reserved
- 0-2:
desc: Fix mode
values:
- 0: Float RTK
- 1: Fixed RTK
# Defitions lacking an id are not treated as SBP messages, but are
# structured types that can be embedded into SBP definitions. Here,
# UARTChannel is a struct composed of primitive types...
- UARTChannel:
desc: State of the UART channel.
fields:
- tx_throughput:
type: float
desc: UART transmit throughput.
- crc_error_count:
type: u16
desc: UART CRC error count.
- tx_buffer_level:
type: u8
desc: UART transmit usage percentage.
# ... that can be used as a field in an actual SBP message...
- MSG_UART_STATE:
id: 0x0018
desc: Piksi message about the state of UART0.
fields:
- uart0:
type: UARTChannel
desc: State of the UART0 channel.
# You can also define fixed-size strings and
# fixed/variable-size arrays!
- info:
type: string
size: 20
desc: Info string of length 20 (bytes).
- remaining_uart_array:
type: array
fill: UARTChannel
desc: Array of UART channels.