Skip to content

Commit 967a780

Browse files
committed
Fixing code formatting in README files.
1 parent f87792e commit 967a780

File tree

8 files changed

+21
-13
lines changed

8 files changed

+21
-13
lines changed

howtos/howto11/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ the [tutorial27](../../tutorials/tutorial27) presented sub-protocols definition.
66
to define variant fields from the [tutorial4](../../tutorials/tutorial4) as sub-protocol messages.
77

88
The `KeyValueProp` `<variant>` field is replaced by the sub-protocol defined in the `var1` namespace.
9-
```
9+
```xml
1010
<ns name="var1">
1111
<fields>
1212
<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
4444
separate `<message>` with a single **Val** field.
4545

4646
Similarly the `TlvProp` `<variant>` field is replaced by the sub-protocol defined in the `var2` namespace.
47-
```
47+
```xml
4848
<ns name="var2">
4949
<fields>
5050
<enum name="PropKey" type="uint8" semanticType="messageId">
@@ -87,7 +87,7 @@ Similarly the `TlvProp` `<variant>` field is replaced by the sub-protocol define
8787
The frame in this case is implemented as `<id>`, `<size>` and `<payload>` triplet.
8888

8989
The original protocol definition was moved into the `prot` namespace.
90-
```
90+
```xml
9191
<ns name="prot">
9292
<fields>
9393
<string name="Msg1Name" defaultValue="Message 1" />
@@ -127,7 +127,7 @@ decode the sub-protocol messages, it just echoes back raw data.
127127

128128
The [client](ClientSession.cpp) on the other hand has to introduce some extra smarts. The
129129
original `Msg1` is defined having a count prefixed list of the `KeyValueProp` `<variant>` field.
130-
```
130+
```xml
131131
<message name="Msg1" id="MsgId.M1" displayName="^Msg1Name">
132132
<list name="F1" element="KeyValueProp">
133133
<countPrefix>
@@ -171,7 +171,7 @@ void ClientSession::handle(Msg2& msg)
171171
```
172172

173173
Another important aspect to notice is the way the protocol options are defined.
174-
```
174+
```cpp
175175
using ProtOpts =
176176
howto11::options::DataViewDefaultOptionsT<
177177
howto11::options::ClientDefaultOptions

tutorials/tutorial10/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ Note that passing multiple options are supported via bundling them in `std::tupl
127127

128128
**SIDE NOTE**: All the options inside [include/&lt;namespace&gt;/options](include/tutorial10/options)
129129
folder are implemented to allow their combinations. For example:
130-
```
130+
```cpp
131131
using BareMetalServerOptions =
132132
tutorial10::options::BareMetalDefaultOptionsT<
133133
tutorial10::options::ServerDefaultOptions
@@ -205,6 +205,7 @@ protected:
205205
{
206206
return comms::ErrorStatus::NotSupported;
207207
}
208+
};
208209
```
209210
In case `comms::option::app::NoWriteImpl` is passed to the
210211
[comms::MessageBase](https://commschamp.github.io/comms_doc/classcomms_1_1MessageBase.html) when

tutorials/tutorial12/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ struct BareMetalDefaultOptionsT : public TBase
102102
};
103103

104104
using BareMetalDefaultOptions = BareMetalDefaultOptionsT<>;
105+
106+
} // namespace options
107+
108+
} // namespace tutorial12
109+
105110
```
106111
As was explained earlier, the `comms::option::app::InPlaceAllocation` option passed to
107112
the `Id` framing layer results in placement rather than dynamic memory allocation.

tutorials/tutorial18/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,11 @@ struct DataViewDefaultOptionsT : public TBase
164164
struct frame : public TBase::frame
165165
{
166166
struct FrameLayers : public TBase::frame::FrameLayers
167+
{
167168
using Data = std::tuple<
168169
comms::option::app::OrigDataView,
169170
typename TBase::frame::FrameLayers::Data
171+
>;
170172
171173
}; // struct FrameLayers
172174
}; // struct frame

tutorials/tutorial2/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ public:
280280

281281
Just by using these member functions it is possible to access the fields while
282282
providing the index of the field.
283-
```
283+
```cpp
284284
auto& msgFields = msg.fields();
285285
auto& f1 = std::get<0>(msgFields);
286286
auto& f2 = std::get<1>(msgFields);
@@ -653,7 +653,7 @@ on the right side of the assignment operation to appropriate type and assigns it
653653
to the value specified on the left side. It eliminates the necessity to explicitly specify
654654
cast type. To use the `comms::cast_assign()` function it is necessary to
655655
include [comms/cast.h](https://commschamp.github.io/comms_doc/cast_8h.html) header file.
656-
```
656+
```cpp
657657
#include "comms/cast.h"
658658
```
659659

tutorials/tutorial24/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ can be used for messages, not only fields.
5959

6060
The generated [Msg1](include/tutorial24/message/Msg1.h) class uses **comms::option::def::FailOnInvalid** option in the
6161
message class definition.
62-
```
62+
```cpp
6363
template <typename TMsgBase, typename TOpt = tutorial24::options::DefaultOptions>
6464
class Msg1 : public
6565
comms::MessageBase<

tutorials/tutorial26/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ Stateful messages sequence.
33

44
There are protocols that don't differentiate messages by their IDs. Instead, the sequence of the messages is pre-determined.
55
In this particular tutorial (see [schema](dsl/schema.xml)) all the messages are the same, i.e. have the same ID and without any fields.
6-
```
6+
```xml
77
<message name="Msg1" id="0" order="0" displayName="^Msg1Name" />
88
<message name="Msg2" id="0" order="1" displayName="^Msg2Name" />
99
<message name="Msg3" id="0" order="2" displayName="^Msg3Name" />
1010
```
1111
Please note usage of the `nonUniqueMsgIdAllowed="true"` in the schema definition as well as **order** property for each `<message>`
1212

1313
The frame is defined like this:
14-
```
14+
```xml
1515
<frame name="Frame">
1616
<size name="Size">
1717
<int name="SizeField" type="uint16" />

tutorials/tutorial27/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Sub-protocols (using namespaces)
33

44
Some protocols can be divided to two or more sub-protocols with usually different framing and different messages.
55
It is recommended to use different namespaces (using `<ns>` XML node) in the schema definition (see [schema](dsl/schema.xml)).
6-
```
6+
```xml
77
<ns name="sub1">
88
...
99
</ns>
@@ -14,7 +14,7 @@ It is recommended to use different namespaces (using `<ns>` XML node) in the sch
1414
```
1515
When using namespaces in the schema definition, the [CommsDSL Specification](https://commschamp.github.io/commsdsl_spec) requires
1616
full path when referencing fields or other components even if the referenced element resides in the same namespace:
17-
```
17+
```xml
1818
<message name="Msg1" id="sub1.MsgId.M0" order="0" displayName="^Msg1Name" />
1919
...
2020
<message name="Msg4" id="sub2.MsgId.M4" displayName="^Msg4Name" />

0 commit comments

Comments
 (0)