Skip to content

Commit 88a64f3

Browse files
Merge branch 'release/7.3.0' into develop
2 parents 14825b3 + 597bfd5 commit 88a64f3

File tree

23 files changed

+329
-36
lines changed

23 files changed

+329
-36
lines changed

.github/workflows/lint_markdown.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ on:
99
branches:
1010
- master
1111
- develop
12+
- release/*
1213
paths:
1314
- '**/*.md'
1415

1516
pull_request:
1617
branches:
1718
- master
1819
- develop
20+
- release/*
1921
paths:
2022
- '**/*.md'
2123

.github/workflows/lint_python.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ on:
99
branches:
1010
- master
1111
- develop
12+
- release/*
1213
paths:
1314
- '**/*.py'
1415

1516
pull_request:
1617
branches:
1718
- master
1819
- develop
20+
- release/*
1921
paths:
2022
- '**/*.py'
2123

.github/workflows/lint_source.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
branches:
1010
- master
1111
- develop
12+
- release/*
1213
paths:
1314
- '**/*.[ch]x?x?'
1415
- '**/*.java'

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# rticonnextdds-examples
22

3-
[![Build and run static analysis](https://github.com/rticommunity/rticonnextdds-examples/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/rticommunity/rticonnextdds-examples/actions/workflows/build.yml)
4-
53
This repository includes examples on how to use specific features of RTI
64
Connext DDS.
75

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
latest
1+
7.3.0

examples/cloud_discovery_service/library_api/c++11/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,30 @@ you want to link against. For example:
112112
cmake -DCONNEXTDDS_ARCH=x64Linux3gcc5.4.0 ..
113113
```
114114

115+
### Cross-compilation
116+
117+
When you need to cross-compile the example, the above
118+
command will not work, the assigned compiler won't be the cross-compiler and
119+
errors may happen when linking against the cross-compiled Connext binaries.
120+
To fix this, you have to create a file with the architecture name and call
121+
CMake with a specific flag called ``-DCMAKE_TOOLCHAIN_FILE``.
122+
An example of the file to create with the toolchain settings (e.g. for an
123+
ARM architectures):
124+
125+
```cmake
126+
set(CMAKE_SYSTEM_NAME Linux)
127+
set(toolchain_path "<path to>/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian")
128+
set(CMAKE_C_COMPILER "${toolchain_path}/bin/arm-linux-gnueabihf-gcc")
129+
set(CMAKE_CXX_COMPILER "${toolchain_path}/bin/arm-linux-gnueabihf-g++")
130+
```
131+
132+
Then you can call CMake like this:
133+
134+
```bash
135+
cmake -DCONNEXTDDS_DIR=<connext dir> -DCMAKE_TOOLCHAIN_FILE=<toolchain file created above>
136+
-DCONNEXTDDS_ARCH=<connext architecture> ..
137+
```
138+
115139
### CMake Build Infrastructure
116140

117141
The `CMakeListst.txt` script that builds this example uses a generic CMake

examples/cloud_discovery_service/library_api/c/README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,33 @@ you want to link against. For example:
112112
cmake -DCONNEXTDDS_ARCH=x64Linux3gcc5.4.0 ..
113113
```
114114

115+
### Cross-compilation
116+
117+
When you need to cross-compile the example, the above
118+
command will not work, the assigned compiler won't be the cross-compiler and
119+
errors may happen when linking against the cross-compiled Connext binaries.
120+
To fix this, you have to create a file with the architecture name and call
121+
CMake with a specific flag called ``-DCMAKE_TOOLCHAIN_FILE``.
122+
An example of the file to create with the toolchain settings (e.g. for an
123+
ARM architectures):
124+
125+
```cmake
126+
set(CMAKE_SYSTEM_NAME Linux)
127+
set(toolchain_path "<path to>/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian")
128+
set(CMAKE_C_COMPILER "${toolchain_path}/bin/arm-linux-gnueabihf-gcc")
129+
set(CMAKE_CXX_COMPILER "${toolchain_path}/bin/arm-linux-gnueabihf-g++")
130+
```
131+
132+
Then you can call CMake like this:
133+
134+
```bash
135+
cmake -DCONNEXTDDS_DIR=<connext dir> -DCMAKE_TOOLCHAIN_FILE=<toolchain file created above>
136+
-DCONNEXTDDS_ARCH=<connext architecture> ..
137+
```
138+
115139
### CMake Build Infrastructure
116140

117-
The `CMakeListst.txt` script that builds this example uses a generic CMake
141+
The `CMakeLists.txt` script that builds this example uses a generic CMake
118142
function called `connextdds_add_example` that defines all the necessary constructs
119143
to:
120144

examples/connext_dds/keyed_data/c++11/keys_subscriber.cxx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,8 @@ int process_data(dds::sub::DataReader<keys> reader)
3535
<< ", x: " << sample.data().x()
3636
<< ", y: " << sample.data().y() << std::endl;
3737
} else {
38-
// Since there is not valid data, it may include metadata.
3938
keys sample;
4039
reader.key_value(sample, info.instance_handle());
41-
42-
// Here we print a message if the instance state is
43-
// 'not_alive_no_writers' or 'not_alive_disposed'.
4440
const dds::sub::status::InstanceState &state =
4541
info.state().instance_state();
4642
if (state
@@ -50,7 +46,10 @@ int process_data(dds::sub::DataReader<keys> reader)
5046
} else if (
5147
state
5248
== dds::sub::status::InstanceState::not_alive_disposed()) {
53-
std::cout << "Instance " << sample.code() << " disposed"
49+
std::cout << "Instance " << sample.code() << " is disposed"
50+
<< std::endl;
51+
} else {
52+
std::cout << "Instance " << sample.code() << " is alive"
5453
<< std::endl;
5554
}
5655
}

examples/connext_dds/keyed_data/c++98/keys_subscriber.cxx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ unsigned int process_data(keysDataReader *typed_reader)
5555

5656
samples_read++;
5757
} else {
58-
/* Since there is not valid data, it may include metadata */
58+
/* An invalid sample can be in any instance state. */
5959
keys dummy;
6060
retcode = typed_reader->get_key_value(
6161
dummy,
@@ -64,16 +64,18 @@ unsigned int process_data(keysDataReader *typed_reader)
6464
std::cout << "get_key_value error " << retcode << std::endl;
6565
continue;
6666
}
67-
68-
/* Here we print a message if the instance state is ALIVE_NO_WRITERS
69-
* or ALIVE_DISPOSED */
7067
if (info_seq[i].instance_state
7168
== DDS_NOT_ALIVE_NO_WRITERS_INSTANCE_STATE) {
72-
std::cout << "Instance " << dummy.code << " has no writers\n";
69+
std::cout << "Instance " << dummy.code << " has no writers"
70+
<< std::endl;
7371
} else if (
7472
info_seq[i].instance_state
7573
== DDS_NOT_ALIVE_DISPOSED_INSTANCE_STATE) {
76-
std::cout << "Instance " << dummy.code << " disposed\n";
74+
std::cout << "Instance " << dummy.code << " is disposed"
75+
<< std::endl;
76+
} else {
77+
std::cout << "Instance " << dummy.code << " is alive"
78+
<< std::endl;
7779
}
7880
}
7981
/* End changes for Keyed_Data */

examples/connext_dds/keyed_data/c/keys_subscriber.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,26 +148,25 @@ void keysListener_on_data_available(void *listener_data, DDS_DataReader *reader)
148148
printf("Instance %d: x: %d, y: %d\n", data->code, data->x, data->y);
149149

150150
} else {
151-
/* Since there is not valid data, it may include metadata */
152-
keys dummy;
151+
/* An invalid data sample can be in any instance state. */
152+
keys key_value;
153153
retcode = keysDataReader_get_key_value(
154154
keys_reader,
155-
&dummy,
155+
&key_value,
156156
&info->instance_handle);
157157
if (retcode != DDS_RETCODE_OK) {
158158
printf("get_key_value error %d\n", retcode);
159159
continue;
160160
}
161-
162-
/* Here we print a message if the instance state is ALIVE_NO_WRITERS
163-
* or ALIVE_DISPOSED */
164161
if (info->instance_state
165162
== DDS_NOT_ALIVE_NO_WRITERS_INSTANCE_STATE) {
166-
printf("Instance %d has no writers\n", dummy.code);
163+
printf("Instance %d has no writers\n", key_value.code);
167164
} else if (
168165
info->instance_state
169166
== DDS_NOT_ALIVE_DISPOSED_INSTANCE_STATE) {
170-
printf("Instance %d disposed\n", dummy.code);
167+
printf("Instance %d is disposed\n", key_value.code);
168+
} else {
169+
printf("Instance %d is alive\n", key_value.code);
171170
}
172171
}
173172
/* End changes for Keyed_Data */

0 commit comments

Comments
 (0)