Micro-XRCE-DDS-Client/examples/SubscribeHelloWorld
Pablo Garrido cdd4120757
Add BigHelloWorld example (#379)
* Add BigHelloWorld example

Signed-off-by: Pablo Garrido <pablogs9@gmail.com>

* Fix printf

Signed-off-by: Pablo Garrido <pablogs9@gmail.com>

* Fix windows

* Fix warning

Signed-off-by: Pablo Garrido <pablogs9@gmail.com>

---------

Signed-off-by: Pablo Garrido <pablogs9@gmail.com>
2024-01-26 08:02:46 +01: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 Refs #2768. Adapt examples to new API 2018-04-03 15:59:16 +02:00
README.md Add best effort examples and remove client.config references (#197) 2021-02-23 08:29:13 +01:00
main.c Add BigHelloWorld example (#379) 2024-01-26 08:02:46 +01:00

README.md

SubscribeHelloWorld example

This example will show how to receive data from the DDS World creating a client subscriber. In order to compile this example, the following profiles should be enabled:

  • UCLIENT_PROFILE_UDP

Usage

  1. Run an agent in a certain port, for example, 2018: MicroXRCEAgent udp4 -p 2018.
  2. Run the PublisherHelloWorld example or some publisher that can send the HelloWorld topic.
  3. Run the SubscriberHelloWorld example. The example expects first and second argument to be IP address and port where the Micro XRCE-DDS Agent is running. It can also be parameterized with the amount of times that the topic will be listened. 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;
};