跳转至

📦 cyclonedds

参考

cyclonedds-cxx

配置文件参考

发现配置



OMG DDS



编译安装

cyclonedds

Bash
1
2
cmake -B build -DCMAKE_INSTALL_PREFIX=./build/install
cmake --build build -j --target install

cyclonedds-cxx

Bash
1
2
cmake -B build -DCMAKE_INSTALL_PREFIX=./build/install -DCMAKE_PREFIX_PATH="../cyclonedds-0.10.5/build/install"
cmake --build build -j --target install



IDL

IDL 用于定义语言无关的接口和数据类型

IDL
1
2
3
4
5
6
module HelloWorldData{
    struct Msg{
        long userID;
        string message;
    };
};



cyclonedds.xml

XML
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
<?xml version="1.0" encoding="UTF-8"?>
<CycloneDDS>
  <Domain>
    <General>
      <AllowMulticast>false</AllowMulticast>
    </General>

    <Discovery>
      <ParticipantIndex>auto</ParticipantIndex>     
      <Peers>
        <Peer Address="10.0.0.xx"/>
      </Peers>
    </Discovery>
  </Domain>
</CycloneDDS>
Bash
1
export CYCLONEDDS_URI=file://$(pwd)/cyclonedds.xml