netmsgs  1.2.2
RoadNarrows Robotics Network Messaging Package
netmsgs_bnf.doxy
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // Package: netmsgs
4 //
5 // File: netmsgs_bnf.doxy
6 //
7 // Description:
8 // This file contains the doxygen directives to generate the packed message
9 // format in an Extended Backus-Naur Form.
10 //
11 ////////////////////////////////////////////////////////////////////////////////
12 
13 /*! \file */
14 
15 /*!
16  * \defgroup man_netmsgs_bnf Packed Message Backus-Naur Form
17  *
18 
19 \verbatim
20 
21 (* message body *)
22 msg_body ::=
23  flat_msg_body
24  | itv_msg_body
25 
26 (* flat message body: no field headers and all fields have fixed size *)
27 flat_msg_body ::=
28  flat_field_stream
29 
30 (* flat field byte stream *)
31 flat_field_stream ::=
32  flat_field
33  | flat_field flat_field_stream
34 
35 (* flat field *)
36 flat_field ::=
37  fval
38  | flat_string_field
39  | flat_struct_field
40  | flat_vector_field
41 
42 (* flat string fixed length field *)
43 flat_string_field ::=
44  char_count*{string_fval}, (MAX_DEFINED_LEN-char_count)*{0}
45 
46 (* flat structure field is essential an embedded stream *)
47 flat_struct_field ::=
48  flat_field_stream
49 
50 (* flat victor fixed length field *)
51 flat_vector_field ::=
52  vector_count*{fval}, (MAX_DEFINED_LEN-vector_count)*{zero_fval}
53 
54 (* Id-Type-Value message body: fields have headers and variable sizes *)
55 itv_msg_body ::=
56  msgid field_count itv_field_stream
57 
58 (* two-byte message id *)
59 msgid ::= uint16_fval
60 
61 (* ITV field byte stream *)
62 itv_field_stream ::=
63  itv_field
64  | itv_field itv_field_stream
65 
66 (* ITV field *)
67 itv_field ::=
68  pad_id
69  | simple_itv_field
70  | string_itv_field
71  | struct_itv_field
72  | vector_itv_field
73 
74 (* field id *)
75 pad_id ::= 0
76 fid ::= 1-255
77 
78 (* simple ITV field *)
79 simple_itv_field ::=
80  fid simple_ftype fval
81 
82 (* string compound ITV field *)
83 string_itv_field ::=
84  fid string_ftype char_count char_count*{char_fval}
85 
86 (* structure compound ITV field *)
87 struct_itv_field ::=
88  fid struct_ftype field_count field_count*{itv_field}
89 
90 (* vector compound ITV field *)
91 vector_itv_field ::=
92  fid vector_ftype vector_count simple_ftype vector_count*{fval}
93  | fid vector_ftype vector_count string_ftype vector_count*{string_itv_field}
94  | fid vector_ftype vector_count struct_ftype vector_count*{struct_itv_field}
95  | fid vector_ftype vector_count vector_ftype vector_count*{vector_itv_field}
96 
97 (* simple field type code enumeration *)
98 simple_ftype ::=
99  bool_ftype
100  | char_ftype
101  | s8_ftype
102  | u8_ftype
103  | s16_ftype
104  | u16_ftype
105  | s32_ftype
106  | u32_ftype
107  | s64_ftype
108  | u64_ftype
109  | f32_ftype
110  | f64_ftype
111  | p32_ftype
112  | p64_ftype
113 
114 (* compound field type code enumeration *)
115 compound_ftype ::=
116  string_ftype
117  | struct_ftype
118  | vector_ftype
119 
120 (* field type codes *)
121 bool_ftype ::= '?'
122 char_ftype ::= 'c'
123 s8_ftype ::= 'b'
124 u8_ftype ::= 'B'
125 s16_ftype ::= 'h'
126 u16_ftype ::= 'H'
127 s32_ftype ::= 'i'
128 u32_ftype ::= 'I'
129 s64_ftype ::= 'l'
130 u64_ftype ::= 'L'
131 f32_ftype ::= 'q'
132 f64_ftype ::= 'Q'
133 p32_ftype ::= 'p'
134 p64_ftype ::= 'P'
135 string_ftype ::= 's'
136 struct_ftype ::= '{'
137 vector_ftype ::= '['
138 
139 (* variable field count subheaders *)
140 char_count ::= 0-255
141 field_count ::= 0-255
142 vector_count ::= 1-255
143 
144 (* simple field value enumeration *)
145 fval ::=
146  bool_fval
147  | char_fval
148  | s8_fval
149  | u8_fval
150  | s16_fval
151  | u16_fval
152  | s32_fval
153  | u32_fval
154  | s64_fval
155  | u64_fval
156  | f32_fval
157  | f64_fval
158  | p32_fval
159  | p64_fval
160 
161 (* simple field values *)
162 bool_fval ::= BINARY_NUM_8BIT
163 char_fval ::= ASCII_8BIT
164 s8_fval ::= TWOS_COMP_NUM_8BIT
165 u8_fval ::= BINARY_NUM_8BIT
166 s16_fval ::= TWOS_COMP_NUM_16BIT
167 u16_fval ::= BINARY_NUM_16BIT
168 s32_fval ::= TWOS_COMP_NUM_32BIT
169 u64_fval ::= BINARY_NUM_32BIT
170 s64_fval ::= TWOS_COMP_NUM_64BIT
171 u32_fval ::= BINARY_NUM_64BIT
172 f32_fval ::= IEEE754_32BIT
173 f64_fval ::= IEEE754_64BIT
174 p32_fval ::= NATIVE_VOID_POINTER_32BIT
175 p64_fval ::= NATIVE_VOID_POINTER_64BIT
176 
177 (* field zero value enumeration *)
178 zero_fval ::=
179  0
180  | 0.0
181  | NULL
182 
183 \endverbatim
184 */