@@ -6,7 +6,7 @@ the [tutorial27](../../tutorials/tutorial27) presented sub-protocols definition.
6
6
to define variant fields from the [ tutorial4] ( ../../tutorials/tutorial4 ) as sub-protocol messages.
7
7
8
8
The ` KeyValueProp ` ` <variant> ` field is replaced by the sub-protocol defined in the ` var1 ` namespace.
9
- ```
9
+ ``` xml
10
10
<ns name =" var1" >
11
11
<fields >
12
12
<enum name =" PropKey" type =" uint8" semanticType =" messageId" >
@@ -44,7 +44,7 @@ The frame is implemented as a pair of `<id>` and `<payload>` layers. Every prope
44
44
separate ` <message> ` with a single ** Val** field.
45
45
46
46
Similarly the ` TlvProp ` ` <variant> ` field is replaced by the sub-protocol defined in the ` var2 ` namespace.
47
- ```
47
+ ``` xml
48
48
<ns name =" var2" >
49
49
<fields >
50
50
<enum name =" PropKey" type =" uint8" semanticType =" messageId" >
@@ -87,7 +87,7 @@ Similarly the `TlvProp` `<variant>` field is replaced by the sub-protocol define
87
87
The frame in this case is implemented as ` <id> ` , ` <size> ` and ` <payload> ` triplet.
88
88
89
89
The original protocol definition was moved into the ` prot ` namespace.
90
- ```
90
+ ``` xml
91
91
<ns name =" prot" >
92
92
<fields >
93
93
<string name =" Msg1Name" defaultValue =" Message 1" />
@@ -127,7 +127,7 @@ decode the sub-protocol messages, it just echoes back raw data.
127
127
128
128
The [ client] ( ClientSession.cpp ) on the other hand has to introduce some extra smarts. The
129
129
original ` Msg1 ` is defined having a count prefixed list of the ` KeyValueProp ` ` <variant> ` field.
130
- ```
130
+ ``` xml
131
131
<message name =" Msg1" id =" MsgId.M1" displayName =" ^Msg1Name" >
132
132
<list name =" F1" element =" KeyValueProp" >
133
133
<countPrefix >
@@ -171,7 +171,7 @@ void ClientSession::handle(Msg2& msg)
171
171
```
172
172
173
173
Another important aspect to notice is the way the protocol options are defined.
174
- ```
174
+ ``` cpp
175
175
using ProtOpts =
176
176
howto11::options::DataViewDefaultOptionsT<
177
177
howto11::options::ClientDefaultOptions
0 commit comments