11.9. ExampleΒΆ
In this section, there is a full XML example with all possible configuration.
Warning
This example can be used as a quick reference, but it may not be correct due to incompatibility or exclusive properties. Do not take it as a working example.
1<?xml version="1.0" encoding="UTF-8" ?>
2<dds>
3 <profiles xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles" >
4 <transport_descriptors>
5 <transport_descriptor>
6 <transport_id>ExampleTransportId1</transport_id>
7 <type>TCPv4</type>
8 <sendBufferSize>8192</sendBufferSize>
9 <receiveBufferSize>8192</receiveBufferSize>
10 <TTL>250</TTL>
11 <maxMessageSize>16384</maxMessageSize>
12 <maxInitialPeersRange>100</maxInitialPeersRange>
13 <interfaceWhiteList>
14 <address>192.168.1.41</address>
15 <address>127.0.0.1</address>
16 </interfaceWhiteList>
17 <wan_addr>80.80.55.44</wan_addr>
18 <keep_alive_frequency_ms>5000</keep_alive_frequency_ms>
19 <keep_alive_timeout_ms>25000</keep_alive_timeout_ms>
20 <max_logical_port>200</max_logical_port>
21 <logical_port_range>20</logical_port_range>
22 <logical_port_increment>2</logical_port_increment>
23 <listening_ports>
24 <port>5100</port>
25 <port>5200</port>
26 </listening_ports>
27 </transport_descriptor>
28 <transport_descriptor>
29 <transport_id>ExampleTransportId2</transport_id>
30 <type>UDPv6</type>
31 </transport_descriptor>
32 <!-- SHM sample transport descriptor -->
33 <transport_descriptor>
34 <transport_id>SHM_SAMPLE_DESCRIPTOR</transport_id>
35 <type>SHM</type> <!-- REQUIRED -->
36 <maxMessageSize>524288</maxMessageSize> <!-- OPTIONAL uint32 valid of all transports-->
37 <segment_size>1048576</segment_size> <!-- OPTIONAL uint32 SHM only-->
38 <port_queue_capacity>1024</port_queue_capacity> <!-- OPTIONAL uint32 SHM only-->
39 <healthy_check_timeout_ms>250</healthy_check_timeout_ms> <!-- OPTIONAL uint32 SHM only-->
40 <rtps_dump_file>test_file.dump</rtps_dump_file> <!-- OPTIONAL string SHM only-->
41 </transport_descriptor>
42 </transport_descriptors>
43
44 <participant profile_name="participant_profile_example">
45 <domainId>4</domainId>
46 <rtps>
47 <name>Participant Name</name> <!-- String -->
48
49 <defaultUnicastLocatorList>
50 <locator>
51 <udpv4>
52 <!-- Access as physical, like UDP -->
53 <port>7400</port>
54 <address>192.168.1.41</address>
55 </udpv4>
56 </locator>
57 <locator>
58 <tcpv4>
59 <!-- Both physical and logical (port), like TCP -->
60 <physical_port>5100</physical_port>
61 <port>7400</port>
62 <unique_lan_id>192.168.1.1.1.1.2.55</unique_lan_id>
63 <wan_address>80.80.99.45</wan_address>
64 <address>192.168.1.55</address>
65 </tcpv4>
66 </locator>
67 <locator>
68 <udpv6>
69 <port>8844</port>
70 <address>::1</address>
71 </udpv6>
72 </locator>
73 </defaultUnicastLocatorList>
74
75 <defaultMulticastLocatorList>
76 <locator>
77 <udpv4>
78 <!-- Access as physical, like UDP -->
79 <port>7400</port>
80 <address>192.168.1.41</address>
81 </udpv4>
82 </locator>
83 <locator>
84 <tcpv4>
85 <!-- Both physical and logical (port), like TCP -->
86 <physical_port>5100</physical_port>
87 <port>7400</port>
88 <unique_lan_id>192.168.1.1.1.1.2.55</unique_lan_id>
89 <wan_address>80.80.99.45</wan_address>
90 <address>192.168.1.55</address>
91 </tcpv4>
92 </locator>
93 <locator>
94 <udpv6>
95 <port>8844</port>
96 <address>::1</address>
97 </udpv6>
98 </locator>
99 </defaultMulticastLocatorList>
100
101 <sendSocketBufferSize>8192</sendSocketBufferSize>
102
103 <listenSocketBufferSize>8192</listenSocketBufferSize>
104
105 <builtin>
106 <discovery_config>
107
108 <discoveryProtocol>NONE</discoveryProtocol>
109
110 <EDP>SIMPLE</EDP>
111
112 <leaseDuration>
113 <sec>DURATION_INFINITY</sec>
114 </leaseDuration>
115
116 <leaseAnnouncement>
117 <sec>1</sec>
118 <nanosec>856000</nanosec>
119 </leaseAnnouncement>
120
121 <simpleEDP>
122 <PUBWRITER_SUBREADER>true</PUBWRITER_SUBREADER>
123 <PUBREADER_SUBWRITER>true</PUBREADER_SUBWRITER>
124 </simpleEDP>
125
126 <staticEndpointXMLFilename>filename.xml</staticEndpointXMLFilename>
127
128 </discovery_config>
129
130 <use_WriterLivelinessProtocol>false</use_WriterLivelinessProtocol>
131
132 <metatrafficUnicastLocatorList>
133 <locator>
134 <udpv4>
135 <!-- Access as physical, like UDP -->
136 <port>7400</port>
137 <address>192.168.1.41</address>
138 </udpv4>
139 </locator>
140 <locator>
141 <tcpv4>
142 <!-- Both physical and logical (port), like TCP -->
143 <physical_port>5100</physical_port>
144 <port>7400</port>
145 <unique_lan_id>192.168.1.1.1.1.2.55</unique_lan_id>
146 <wan_address>80.80.99.45</wan_address>
147 <address>192.168.1.55</address>
148 </tcpv4>
149 </locator>
150 <locator>
151 <udpv6>
152 <port>8844</port>
153 <address>::1</address>
154 </udpv6>
155 </locator>
156 </metatrafficUnicastLocatorList>
157
158 <metatrafficMulticastLocatorList>
159 <locator>
160 <udpv4>
161 <!-- Access as physical, like UDP -->
162 <port>7400</port>
163 <address>192.168.1.41</address>
164 </udpv4>
165 </locator>
166 <locator>
167 <tcpv4>
168 <!-- Both physical and logical (port), like TCP -->
169 <physical_port>5100</physical_port>
170 <port>7400</port>
171 <unique_lan_id>192.168.1.1.1.1.2.55</unique_lan_id>
172 <wan_address>80.80.99.45</wan_address>
173 <address>192.168.1.55</address>
174 </tcpv4>
175 </locator>
176 <locator>
177 <udpv6>
178 <port>8844</port>
179 <address>::1</address>
180 </udpv6>
181 </locator>
182 </metatrafficMulticastLocatorList>
183
184 <initialPeersList>
185 <locator>
186 <udpv4>
187 <!-- Access as physical, like UDP -->
188 <port>7400</port>
189 <address>192.168.1.41</address>
190 </udpv4>
191 </locator>
192 <locator>
193 <tcpv4>
194 <!-- Both physical and logical (port), like TCP -->
195 <physical_port>5100</physical_port>
196 <port>7400</port>
197 <unique_lan_id>192.168.1.1.1.1.2.55</unique_lan_id>
198 <wan_address>80.80.99.45</wan_address>
199 <address>192.168.1.55</address>
200 </tcpv4>
201 </locator>
202 <locator>
203 <udpv6>
204 <port>8844</port>
205 <address>::1</address>
206 </udpv6>
207 </locator>
208 </initialPeersList>
209
210 <readerHistoryMemoryPolicy>PREALLOCATED_WITH_REALLOC</readerHistoryMemoryPolicy>
211
212 <writerHistoryMemoryPolicy>PREALLOCATED</writerHistoryMemoryPolicy>
213 </builtin>
214
215 <allocation>
216 <remote_locators>
217 <max_unicast_locators>4</max_unicast_locators> <!-- uint32 -->
218 <max_multicast_locators>1</max_multicast_locators> <!-- uint32 -->
219 </remote_locators>
220 <total_participants>
221 <initial>0</initial>
222 <maximum>0</maximum>
223 <increment>1</increment>
224 </total_participants>
225 <total_readers>
226 <initial>0</initial>
227 <maximum>0</maximum>
228 <increment>1</increment>
229 </total_readers>
230 <total_writers>
231 <initial>0</initial>
232 <maximum>0</maximum>
233 <increment>1</increment>
234 </total_writers>
235 <max_partitions>256</max_partitions>
236 <max_user_data>256</max_user_data>
237 <max_properties>512</max_properties>
238 </allocation>
239
240 <port>
241 <portBase>7400</portBase>
242 <domainIDGain>200</domainIDGain>
243 <participantIDGain>10</participantIDGain>
244 <offsetd0>0</offsetd0>
245 <offsetd1>1</offsetd1>
246 <offsetd2>2</offsetd2>
247 <offsetd3>3</offsetd3>
248 </port>
249
250 <participantID>99</participantID>
251
252 <throughputController>
253 <bytesPerPeriod>8192</bytesPerPeriod>
254 <periodMillisecs>1000</periodMillisecs>
255 </throughputController>
256
257 <userTransports>
258 <transport_id>ExampleTransportId1</transport_id>
259 <transport_id>ExampleTransportId1</transport_id>
260 </userTransports>
261
262 <useBuiltinTransports>false</useBuiltinTransports>
263
264 <builtinTransports>DEFAULT</builtinTransports>
265
266 <propertiesPolicy>
267 <properties>
268 <property>
269 <name>Property1Name</name>
270 <value>Property1Value</value>
271 <propagate>false</propagate>
272 </property>
273 <property>
274 <name>Property2Name</name>
275 <value>Property2Value</value>
276 <propagate>false</propagate>
277 </property>
278 </properties>
279 </propertiesPolicy>
280 <flow_controller_descriptor_list>
281 <flow_controller_descriptor>
282 <name>example_flow_controller</name>
283 <scheduler>FIFO</scheduler>
284 <max_bytes_per_period>4096</max_bytes_per_period>
285 <period_ms>500</period_ms>
286 </flow_controller_descriptor>
287 </flow_controller_descriptor_list>
288 </rtps>
289 </participant>
290
291 <data_writer profile_name="datawriter_profile_example">
292 <topic>
293 <kind>WITH_KEY</kind>
294 <name>TopicName</name>
295 <dataType>TopicDataTypeName</dataType>
296 <historyQos>
297 <kind>KEEP_LAST</kind>
298 <depth>20</depth>
299 </historyQos>
300 <resourceLimitsQos>
301 <max_samples>5</max_samples>
302 <max_instances>2</max_instances>
303 <max_samples_per_instance>1</max_samples_per_instance>
304 <allocated_samples>20</allocated_samples>
305 </resourceLimitsQos>
306 </topic>
307
308 <qos> <!-- dataWriterQosPoliciesType -->
309 <durability>
310 <kind>VOLATILE</kind>
311 </durability>
312 <liveliness>
313 <kind>AUTOMATIC</kind>
314 <lease_duration>
315 <sec>1</sec>
316 <nanosec>856000</nanosec>
317 </lease_duration>
318 <announcement_period>
319 <sec>1</sec>
320 <nanosec>856000</nanosec>
321 </announcement_period>
322 </liveliness>
323 <reliability>
324 <kind>BEST_EFFORT</kind>
325 <max_blocking_time>
326 <sec>1</sec>
327 <nanosec>856000</nanosec>
328 </max_blocking_time>
329 </reliability>
330 <lifespan>
331 <duration>
332 <sec>5</sec>
333 <nanosec>0</nanosec>
334 </duration>
335 </lifespan>
336 <partition>
337 <names>
338 <name>part1</name>
339 <name>part2</name>
340 </names>
341 </partition>
342 <publishMode>
343 <kind>ASYNCHRONOUS</kind>
344 <flow_controller_name>example_flow_controller</flow_controller_name>
345 </publishMode>
346 <disablePositiveAcks>
347 <enabled>true</enabled>
348 <duration>
349 <sec>1</sec>
350 </duration>
351 </disablePositiveAcks>
352 </qos>
353
354 <times>
355 <initialHeartbeatDelay>
356 <sec>1</sec>
357 <nanosec>856000</nanosec>
358 </initialHeartbeatDelay>
359 <heartbeatPeriod>
360 <sec>1</sec>
361 <nanosec>856000</nanosec>
362 </heartbeatPeriod>
363 <nackResponseDelay>
364 <sec>1</sec>
365 <nanosec>856000</nanosec>
366 </nackResponseDelay>
367 <nackSupressionDuration>
368 <sec>1</sec>
369 <nanosec>856000</nanosec>
370 </nackSupressionDuration>
371 </times>
372
373 <unicastLocatorList>
374 <locator>
375 <udpv4>
376 <!-- Access as physical, like UDP -->
377 <port>7400</port>
378 <address>192.168.1.41</address>
379 </udpv4>
380 </locator>
381 <locator>
382 <tcpv4>
383 <!-- Both physical and logical (port), like TCP -->
384 <physical_port>5100</physical_port>
385 <port>7400</port>
386 <unique_lan_id>192.168.1.1.1.1.2.55</unique_lan_id>
387 <wan_address>80.80.99.45</wan_address>
388 <address>192.168.1.55</address>
389 </tcpv4>
390 </locator>
391 <locator>
392 <udpv6>
393 <port>8844</port>
394 <address>::1</address>
395 </udpv6>
396 </locator>
397 </unicastLocatorList>
398
399 <multicastLocatorList>
400 <locator>
401 <udpv4>
402 <!-- Access as physical, like UDP -->
403 <port>7400</port>
404 <address>192.168.1.41</address>
405 </udpv4>
406 </locator>
407 <locator>
408 <tcpv4>
409 <!-- Both physical and logical (port), like TCP -->
410 <physical_port>5100</physical_port>
411 <port>7400</port>
412 <unique_lan_id>192.168.1.1.1.1.2.55</unique_lan_id>
413 <wan_address>80.80.99.45</wan_address>
414 <address>192.168.1.55</address>
415 </tcpv4>
416 </locator>
417 <locator>
418 <udpv6>
419 <port>8844</port>
420 <address>::1</address>
421 </udpv6>
422 </locator>
423 </multicastLocatorList>
424
425 <throughputController>
426 <bytesPerPeriod>8192</bytesPerPeriod>
427 <periodMillisecs>1000</periodMillisecs>
428 </throughputController>
429
430 <historyMemoryPolicy>DYNAMIC</historyMemoryPolicy>
431
432 <matchedSubscribersAllocation>
433 <initial>3</initial>
434 <maximum>3</maximum>
435 <increment>0</increment>
436 </matchedSubscribersAllocation>
437
438 <propertiesPolicy>
439 <properties>
440 <property>
441 <name>Property1Name</name>
442 <value>Property1Value</value>
443 <propagate>false</propagate>
444 </property>
445 <property>
446 <name>Property2Name</name>
447 <value>Property2Value</value>
448 <propagate>false</propagate>
449 </property>
450 </properties>
451 </propertiesPolicy>
452
453 <userDefinedID>45</userDefinedID>
454
455 <entityID>76</entityID>
456 </data_writer>
457
458 <data_reader profile_name="datareader_profile_example">
459 <topic>
460 <kind>WITH_KEY</kind>
461 <name>TopicName</name>
462 <dataType>TopicDataTypeName</dataType>
463 <historyQos>
464 <kind>KEEP_LAST</kind>
465 <depth>20</depth>
466 </historyQos>
467 <resourceLimitsQos>
468 <max_samples>5</max_samples>
469 <max_instances>2</max_instances>
470 <max_samples_per_instance>1</max_samples_per_instance>
471 <allocated_samples>20</allocated_samples>
472 </resourceLimitsQos>
473 </topic>
474
475 <qos> <!-- dataReaderQosPoliciesType -->
476 <durability>
477 <kind>PERSISTENT</kind>
478 </durability>
479 <liveliness>
480 <kind>MANUAL_BY_PARTICIPANT</kind>
481 <lease_duration>
482 <sec>1</sec>
483 <nanosec>856000</nanosec>
484 </lease_duration>
485 <announcement_period>
486 <sec>1</sec>
487 <nanosec>856000</nanosec>
488 </announcement_period>
489 </liveliness>
490 <reliability>
491 <kind>BEST_EFFORT</kind>
492 <max_blocking_time>
493 <sec>1</sec>
494 <nanosec>856000</nanosec>
495 </max_blocking_time>
496 </reliability>
497 <lifespan>
498 <duration>
499 <sec>5</sec>
500 <nanosec>0</nanosec>
501 </duration>
502 </lifespan>
503 <partition>
504 <names>
505 <name>part1</name>
506 <name>part2</name>
507 </names>
508 </partition>
509 </qos>
510
511 <times>
512 <initialAcknackDelay>
513 <sec>1</sec>
514 <nanosec>856000</nanosec>
515 </initialAcknackDelay>
516 <heartbeatResponseDelay>
517 <sec>1</sec>
518 <nanosec>856000</nanosec>
519 </heartbeatResponseDelay>
520 </times>
521
522 <unicastLocatorList>
523 <locator>
524 <udpv4>
525 <!-- Access as physical, like UDP -->
526 <port>7400</port>
527 <address>192.168.1.41</address>
528 </udpv4>
529 </locator>
530 <locator>
531 <tcpv4>
532 <!-- Both physical and logical (port), like TCP -->
533 <physical_port>5100</physical_port>
534 <port>7400</port>
535 <unique_lan_id>192.168.1.1.1.1.2.55</unique_lan_id>
536 <wan_address>80.80.99.45</wan_address>
537 <address>192.168.1.55</address>
538 </tcpv4>
539 </locator>
540 <locator>
541 <udpv6>
542 <port>8844</port>
543 <address>::1</address>
544 </udpv6>
545 </locator>
546 </unicastLocatorList>
547
548 <multicastLocatorList>
549 <locator>
550 <udpv4>
551 <!-- Access as physical, like UDP -->
552 <port>7400</port>
553 <address>192.168.1.41</address>
554 </udpv4>
555 </locator>
556 <locator>
557 <tcpv4>
558 <!-- Both physical and logical (port), like TCP -->
559 <physical_port>5100</physical_port>
560 <port>7400</port>
561 <unique_lan_id>192.168.1.1.1.1.2.55</unique_lan_id>
562 <wan_address>80.80.99.45</wan_address>
563 <address>192.168.1.55</address>
564 </tcpv4>
565 </locator>
566 <locator>
567 <udpv6>
568 <port>8844</port>
569 <address>::1</address>
570 </udpv6>
571 </locator>
572 </multicastLocatorList>
573
574 <expectsInlineQos>true</expectsInlineQos>
575
576 <historyMemoryPolicy>DYNAMIC</historyMemoryPolicy>
577
578 <matchedPublishersAllocation>
579 <initial>1</initial>
580 <maximum>1</maximum>
581 <increment>0</increment>
582 </matchedPublishersAllocation>
583
584 <propertiesPolicy>
585 <properties>
586 <property>
587 <name>Property1Name</name>
588 <value>Property1Value</value>
589 <propagate>false</propagate>
590 </property>
591 <property>
592 <name>Property2Name</name>
593 <value>Property2Value</value>
594 <propagate>false</propagate>
595 </property>
596 </properties>
597 </propertiesPolicy>
598
599 <userDefinedID>55</userDefinedID>
600
601 <entityID>66</entityID>
602 </data_reader>
603 </profiles>
604
605 <log>
606 <use_default>FALSE</use_default>
607
608 <consumer>
609 <class>StdoutConsumer</class>
610 </consumer>
611
612 <consumer>
613 <class>FileConsumer</class>
614 <property>
615 <name>filename</name>
616 <value>execution.log</value>
617 </property>
618 <property>
619 <name>append</name>
620 <value>TRUE</value>
621 </property>
622 </consumer>
623 </log>
624
625 <types>
626 <type> <!-- Types can be defined in its own type of tag or sharing the same tag -->
627 <enum name="MyAloneEnumType">
628 <enumerator name="A" value="0"/>
629 <enumerator name="B" value="1"/>
630 <enumerator name="C" value="2"/>
631 </enum>
632 </type>
633 <type>
634 <enum name="MyEnum">
635 <enumerator name="A" value="0"/>
636 <enumerator name="B" value="1"/>
637 <enumerator name="C" value="2"/>
638 </enum>
639
640 <typedef name="MyAlias1" type="nonBasic" nonBasicTypeName="MyEnum"/>
641
642 <typedef name="MyAlias2" type="int32" arrayDimensions="2,2"/>
643
644 <typedef name="my_map_inner" type="int32" key_type="int32" mapMaxLength="2"/>
645
646 <bitset name="MyBitSet">
647 <bitfield name="a" bit_bound="3"/>
648 <bitfield name="b" bit_bound="10"/>
649 <bitfield name="c" bit_bound="12" type="int16"/>
650 </bitset>
651
652 <bitmask name="MyBitMask" bit_bound="8">
653 <bit_value name="flag0" position="0"/>
654 <bit_value name="flag1"/>
655 </bitmask>
656
657 <struct name="MyStruct">
658 <member name="first" type="int32"/>
659 <member name="second" type="int64"/>
660 </struct>
661
662 <struct name="OtherStruct">
663 <member name="my_enum" type="nonBasic" nonBasicTypeName="MyEnum"/>
664 <member name="my_struct" type="nonBasic" nonBasicTypeName="MyStruct" arrayDimensions="5"/>
665 </struct>
666
667 <union name="MyUnion1">
668 <discriminator type="byte"/>
669 <case>
670 <caseDiscriminator value="0"/>
671 <caseDiscriminator value="1"/>
672 <member name="first" type="int32"/>
673 </case>
674 <case>
675 <caseDiscriminator value="2"/>
676 <member name="second" type="nonBasic" nonBasicTypeName="MyStruct"/>
677 </case>
678 <case>
679 <caseDiscriminator value="default"/>
680 <member name="third" type="int64"/>
681 </case>
682 </union>
683
684 <!-- All possible members struct type -->
685 <struct name="MyFullStruct">
686 <!-- Primitives & basic -->
687 <member name="my_bool" type="boolean"/>
688 <member name="my_byte" type="byte"/>
689 <member name="my_char" type="char8"/>
690 <member name="my_wchar" type="char16"/>
691 <member name="my_short" type="int16"/>
692 <member name="my_long" type="int32"/>
693 <member name="my_longlong" type="int64"/>
694 <member name="my_unsignedshort" type="uint16"/>
695 <member name="my_unsignedlong" type="uint32"/>
696 <member name="my_unsignedlonglong" type="uint64"/>
697 <member name="my_float" type="float32"/>
698 <member name="my_double" type="float64"/>
699 <member name="my_longdouble" type="float128"/>
700 <member name="my_string" type="string"/>
701 <member name="my_wstring" type="wstring"/>
702 <member name="my_boundedString" type="string" stringMaxLength="41925"/>
703 <member name="my_boundedWString" type="wstring" stringMaxLength="41925"/>
704
705 <!-- long long_array[2][3][4]; -->
706 <member name="long_array" arrayDimensions="2,3,4" type="int32"/>
707
708 <!-- map<long,map<long,long,2>,2> my_map_map; -->
709 <member name="my_map_map" type="nonBasic" nonBasicTypeName="my_map_inner" key_type="int32" mapMaxLength="2"/>
710
711 <!-- Complex types -->
712 <member name="my_other_struct" type="nonBasic" nonBasicTypeName="OtherStruct"/>
713 </struct>
714 </type>
715 </types>
716</dds>