Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New DDS example: Basic Configuration HelloWorld [12329] #2122

Merged
merged 31 commits into from
Dec 21, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
26c2e6c
Refs #12329: HelloWorldExample: OptionParser included and number of c…
juanlofer-eprosima Aug 13, 2021
c5ff671
Refs #12329: Minor changes
juanlofer-eprosima Sep 1, 2021
82eb657
Refs #12329: Uncrustify
juanlofer-eprosima Sep 1, 2021
9ac57b1
Fix windows warnings
juanlofer-eprosima Sep 2, 2021
6d9cce6
Refs #12329: Included PR #2122 requested changes
juanlofer-eprosima Sep 10, 2021
8108fc1
Refs #12329: Uncrustify
juanlofer-eprosima Sep 10, 2021
d03d9b5
Refs #12329: Added optionparser to example for standalone support
juanlofer-eprosima Sep 14, 2021
136d1c9
Refs #12329: Moved helloworld example to basic config example
juanlofer-eprosima Sep 14, 2021
1dcbd03
Refs #12329: Restored original HelloWorld example
juanlofer-eprosima Sep 14, 2021
8bf37e2
Refs #12329: Updated README
juanlofer-eprosima Sep 14, 2021
88f20d0
Refs #12329: Attempt to fix Windows tests
juanlofer-eprosima Sep 16, 2021
d94e2b1
Refs #12329: Included PR #2122 more requested changes
juanlofer-eprosima Sep 20, 2021
630a595
Refs #12329: Included PR #2122 more requested changes
juanlofer-eprosima Sep 20, 2021
ec0b2f7
Refs #12329: Fix uncrustify test
juanlofer-eprosima Sep 20, 2021
78d8b40
Refs #12329: Reordered includes
juanlofer-eprosima Sep 21, 2021
708906d
Refs #12519: Added More comments to headers and improved README
juanlofer-eprosima Sep 29, 2021
d5ee057
Refs #12329: Renamed files
juanlofer-eprosima Sep 29, 2021
8d246e3
Refs #12329: Reformatted comments
juanlofer-eprosima Sep 30, 2021
e31aab7
Refs #12329: Rerenamed files
juanlofer-eprosima Sep 30, 2021
0730209
Refs #12329: Transient_local fix and transient_local/reliable clarifi…
juanlofer-eprosima Oct 1, 2021
a0e0689
Refs #12329: uncrustify
juanlofer-eprosima Oct 1, 2021
8340e47
Refs #12329: uncrustify fix
juanlofer-eprosima Oct 1, 2021
0807449
Refs #12329: Removed --samples warning
juanlofer-eprosima Oct 4, 2021
f923898
Refs #12329: Tiny change
juanlofer-eprosima Oct 4, 2021
393c5d7
Refs #12329: Apply suggestions
Dec 17, 2021
a367c2f
Refs #12329: apply suggestions
Dec 20, 2021
96c3766
Refs #12329: update Readme
Dec 20, 2021
1b4f427
Refs #12329: fix shm not created
Dec 20, 2021
14d24cb
Refs #12329: remove windows warnings
Dec 21, 2021
7f1d938
Refs #12329: apply suggestions over comments
Dec 21, 2021
8bc41a9
Refs #12329: apply very important suggestion T.T
Dec 21, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,7 @@ bool HelloWorldPublisher::init(
{
pqos.transport().use_builtin_transports = false;

if (transport == SHM || transport == DATA_SHARING)
{
auto shm_transport = std::make_shared<SharedMemTransportDescriptor>();
pqos.transport().user_transports.push_back(shm_transport);
}
else if (transport == UDP)
if (transport == UDPv4)
{
auto udp_transport = std::make_shared<UDPv4TransportDescriptor>();
pqos.transport().user_transports.push_back(udp_transport);
Expand Down Expand Up @@ -129,8 +124,8 @@ bool HelloWorldPublisher::init(
// CREATE THE WRITER
DataWriterQos wqos = DATAWRITER_QOS_DEFAULT;

// Data sharing set in endpoint. If it is not default or datasharing, set it to off
if (transport != DEFAULT && transport != DATA_SHARING)
// Data sharing set in endpoint. If it is not default, set it to off
if (transport != DEFAULT)
{
wqos.data_sharing().off();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,7 @@ bool HelloWorldSubscriber::init(
{
pqos.transport().use_builtin_transports = false;

if (transport == SHM || transport == DATA_SHARING)
{
auto shm_transport = std::make_shared<SharedMemTransportDescriptor>();
pqos.transport().user_transports.push_back(shm_transport);
}
else if (transport == UDP)
if (transport == UDPv4)
{
auto udp_transport = std::make_shared<UDPv4TransportDescriptor>();
pqos.transport().user_transports.push_back(udp_transport);
Expand Down Expand Up @@ -130,8 +125,8 @@ bool HelloWorldSubscriber::init(
}
DataReaderQos rqos = DATAREADER_QOS_DEFAULT;

// Data sharing set in endpoint. If it is not default or datasharing, set it to off
if (transport != DEFAULT && transport != DATA_SHARING)
// Data sharing set in endpoint. If it is not default, set it to off
if (transport != DEFAULT)
{
rqos.data_sharing().off();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,17 +160,13 @@ int main(
break;

case optionIndex::TRANSPORT:
if (strcmp(opt.arg, "dsh") == 0)
{
transport = DATA_SHARING;
}
else if (strcmp(opt.arg, "shm") == 0)
if (strcmp(opt.arg, "shm") == 0)
{
transport = SHM;
}
else if (strcmp(opt.arg, "udp") == 0)
else if (strcmp(opt.arg, "udp") == 0 || (strcmp(opt.arg, "udpv4") == 0))
{
transport = UDP;
transport = UDPv4;
}
else if (strcmp(opt.arg, "udpv6") == 0)
{
Expand Down
12 changes: 6 additions & 6 deletions examples/C++/DDS/BasicConfigurationExample/arg_configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ struct Arg : public option::Arg
if (option.arg != 0)
{
std::string transport = std::string(option.arg);
if (transport != "dsh" && transport != "shm" && transport != "udp" && transport != "udpv6")
if (transport != "shm" && transport != "udp" && transport != "udpv4" && transport != "udpv6")
{
if (msg)
{
print_error("Option '", option, "' only accepts <dsh|shm|ud|udpv6p> values\n");
print_error("Option '", option, "' only accepts <shm|udp[v4]|udpv6> values\n");
}
return option::ARG_ILLEGAL;
}
Expand Down Expand Up @@ -160,8 +160,8 @@ const option::Descriptor usage[] = {
{ ASYNC, 0, "a", "async", Arg::None,
" -a \t--async \tAsynchronous publish mode (synchronous by default)." },
{ TRANSPORT, 0, "", "transport", Arg::Transport,
" \t--transport=<dsh|shm|udp|udpv6> \tUse only data-sharing, shared-memory, UDP, UDPv6 transport."
"If not set, use Fast DDS default transport (depending on the scenario it will use the most efficient one)." },
" \t--transport=<shm|udp|udpv6> \tUse only data-sharing, shared-memory, UDPv4, UDPv6 transport."
EduPonz marked this conversation as resolved.
Show resolved Hide resolved
"If not set, use Fast DDS default transports (depending on the scenario it will use the most efficient one)." },

{ UNKNOWN_OPT, 0, "", "", Arg::None, "\nSubscriber options:"},
{ TOPIC, 0, "t", "topic", Arg::String,
Expand All @@ -171,8 +171,8 @@ const option::Descriptor usage[] = {
{ SAMPLES, 0, "s", "samples", Arg::Numeric,
" -s <num> \t--samples=<num> \tNumber of samples to wait for (Default: 0 => infinite samples)." },
{ TRANSPORT, 0, "", "transport", Arg::Transport,
" \t--transport=<dsh|shm|udp|udpv6> \tUse only data-sharing, shared-memory, UDP, UDPv6 transport."
"If not set, use Fast DDS default transport (depending on the scenario it will use the most efficient one)." },
" \t--transport=<shm|udp|udpv6> \tUse only data-sharing, shared-memory, UDPv4, UDPv6 transport."
EduPonz marked this conversation as resolved.
Show resolved Hide resolved
"If not set, use Fast DDS default transports (depending on the scenario it will use the most efficient one)." },
juanlofer-eprosima marked this conversation as resolved.
Show resolved Hide resolved

{ UNKNOWN_OPT, 0, "", "", Arg::None, "\nQoS options:"},
{ RELIABLE, 0, "r", "reliable", Arg::None,
Expand Down
3 changes: 1 addition & 2 deletions examples/C++/DDS/BasicConfigurationExample/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@
enum TransportType
{
DEFAULT,
DATA_SHARING,
SHM,
UDP,
UDPv4,
UDPv6,
};

Expand Down