Micro-XRCE-DDS-Client/examples/SubscribeHelloWorldP2P
G.A. vd. Hoorn 39eac9448d
examples: explicitly set language to C (#257)
CMake will default to enabling C and C++ if no languages are specified in the project(..) call.

Micro-XRCE-DDS-Client is a C-only project. Avoid enabling C++.

Signed-off-by: gavanderhoorn <g.a.vanderhoorn@tudelft.nl>
2021-07-06 07:56:21 +02:00
..
CMakeLists.txt examples: explicitly set language to C (#257) 2021-07-06 07:56:21 +02:00
HelloWorld.c Update Quality Level 1 (#210) 2021-03-23 12:16:24 +01:00
HelloWorld.h Update Quality Level 1 (#210) 2021-03-23 12:16:24 +01:00
HelloWorld.idl P2P examples. (#104) 2019-11-21 08:16:22 +01:00
README.md Add best effort examples and remove client.config references (#197) 2021-02-23 08:29:13 +01:00
main.c Update Quality Level 1 (#210) 2021-03-23 12:16:24 +01:00

README.md

SubscribeHelloWorldP2P example

This example will show how to subscribe to data creating a client subscriber. It is necessary to have the following profiles enabled to compile this example:

  • UCLIENT_PROFILE_UDP

Usage

  1. Run an agent in a certain port, for example, 2018: MicroXRCEAgent udp4 -p 2018.
  2. Run the PublisherHelloWorldP2P example or some publisher that can send the HelloWorld topic.
  3. Run the SubscriberHelloWorldP2P example. The example can be parameterized with the number of topics that will be listened to. If no number is given, the publisher will publish indefinitely.

Topic

The HelloWorld topic has the following IDL representation:

struct HelloWorld
{
	unsigned long index;
	string message;
};