零基础构建OpenDDS demo quick started

零基础构建OpenDDS demo

参考:OpenDDS Developer's Guide 第二章Getting Started

1.建立idl

内容:

零基础构建OpenDDS demo quick started_第1张图片

2. 生成工程文件

2.1 运行tao_idl(此步骤可以跳过)

~/Downloads/OpenDDS-3.13/DevGuideExamples/Messenger$ tao_idl Messenger.idl

processing Messenger.idl

零基础构建OpenDDS demo quick started_第2张图片

2.2 运行opendds_idl(此步骤可以跳过)

~/Downloads/OpenDDS-3.13/DevGuideExamples/Messenger$ opendds_idl Messenger.idl

processing Messenger.idl

零基础构建OpenDDS demo quick started_第3张图片

 

2.3 运行mpc

建立Message.mpc

零基础构建OpenDDS demo quick started_第4张图片

零基础构建OpenDDS demo quick started_第5张图片

~/Downloads/OpenDDS-3.13/DevGuideExamples/DCPS/Messenger$ mpc.pl Messenger.mpc -type gnuace

MPC_ROOT was set to /home/coolwaterld/Downloads/OpenDDS-3.13/ACE_wrappers/MPC.

Using .../OpenDDS-3.13/ACE_wrappers/bin/MakeProjectCreator/config/MPC.cfg

Generating 'gnuace' output using Messenger.mpc

Generation Time: 0s

零基础构建OpenDDS demo quick started_第6张图片

~/Downloads/OpenDDS-3.13/DevGuideExamples/DCPS/Messenger$ make -f GNUmakefile.Messenger_Idl

零基础构建OpenDDS demo quick started_第7张图片

 

3. 生成publisher

建立WritePublisher.cpp

~/Downloads/OpenDDS-3.13/DevGuideExamples/DCPS/Messenger$ make -f GNUmakefile.Messenger_Publisher

touch .depend.Messenger_Publisher_Idl2

touch .depend.Messenger_Publisher_Idl1

touch .depend.Messenger_Publisher

 

GNUmakefile: /home/coolwaterld/Downloads/OpenDDS-3.13/DevGuideExamples/DCPS/Messenger/GNUmakefile.Messenger_Publisher MAKEFLAGS=

零基础构建OpenDDS demo quick started_第8张图片

4. 生成Subscriber

Write DataReaderListenerImpl.cpp DataReaderListenerImpl.h and Subscriber.cpp

~/Downloads/OpenDDS-3.13/DevGuideExamples/DCPS/Messenger$ make -f GNUmakefile.Messenger_Subscriber

GNUmakefile: /home/coolwaterld/Downloads/OpenDDS-3.13/DevGuideExamples/DCPS/Messenger/GNUmakefile.Messenger_Subscriber MAKEFLAGS=

零基础构建OpenDDS demo quick started_第9张图片

5. 运行

5.1InfoRepo方式

~/Downloads/OpenDDS-3.13/DevGuideExamples/DCPS/Messenger$ $DDS_ROOT/bin/DCPSInfoRepo -o simple.ior

gedit simple.ior

IOR:010000001e00000049444c3a4f70656e4444532f444350532f44435053496e666f3a312e30000000010000000000000088000000010102000f0000003139322e3136382e31362e3133380000899700003400000014010f004e5550000000190000000001000000526f6f74504f4100496e666f5265706f000000000001000000496e666f5265706f02000000000000000800000001000000004f41540100000018000000010000000100010001000000010001050901010000000000

零基础构建OpenDDS demo quick started_第10张图片

5.2 rtps.ini方式

rtps.ini

[common]

DCPSGlobalTransportConfig=$file

DCPSDefaultDiscovery=DEFAULT_RTPS

[transport/the_rtps_transport]

transport_type=rtps_udp

~/Downloads/OpenDDS-3.13/DevGuideExamples/DCPS/Messenger$ ./publisher -DCPSConfigFile rtps.ini

~/Downloads/OpenDDS-3.13/DevGuideExamples/DCPS/Messenger$ ./subscriber -DCPSConfigFile rtps.ini

零基础构建OpenDDS demo quick started_第11张图片

你可能感兴趣的:(零基础构建OpenDDS demo quick started)