1 #ifndef ApplicationSupport_h
2 #define ApplicationSupport_h
5 #include "netio/netio_udp.h"
6 #include "disc_dpde/disc_dpde_discovery_plugin.h"
18 #define APP_RETVAL_OK 0
23 #define APP_RETVAL_ERROR -1
29 #define APP_COUNT_UNLIMITED -1
32 typedef struct Application Application_t;
37 typedef int (*Application_take_data_fn)(Application_t *application);
49 typedef struct ApplicationConfig {
131 DDS_BUILTIN_TOPIC_KEY_TYPE_NATIVE entity_id_writer;
142 DDS_BUILTIN_TOPIC_KEY_TYPE_NATIVE entity_id_reader;
167 DDS_Char topic_name[RTPS_PATHNAME_LEN_MAX+1];
179 DDS_Char type_name[RTPS_PATHNAME_LEN_MAX+1];
284 Application_take_data_fn take_data;
293 } ApplicationConfig_t;
298 #define DEFAULT_DOMAIN_ID 0
303 #define DEFAULT_ENTITY_ID_WRITER 100
308 #define DEFAULT_ENTITY_ID_READER 200
313 #define DEFAULT_PART_NAME_WRITER "HelloWorldPublisher"
318 #define DEFAULT_PART_NAME_READER "HelloWorldSubscriber"
323 #define DEFAULT_TOPIC_NAME "HelloWorldTopic"
328 #define DEFAULT_TYPE_NAME "HelloWorldType"
334 #define DEFAULT_PEER "127.0.0.1"
336 #if defined(RTI_DARWIN)
340 #define DEFAULT_UDP_INTERFACE "en1"
341 #elif defined (RTI_LINUX)
342 #define DEFAULT_UDP_INTERFACE "eth0"
343 #elif defined (RTI_VXWORKS)
344 #define DEFAULT_UDP_INTERFACE "geisc0"
345 #elif defined(RTI_WIN32)
346 #define DEFAULT_UDP_INTERFACE "Local Area Connection"
348 #define DEFAULT_UDP_INTERFACE "ce0"
351 #if defined(RTI_DARWIN)
355 #define DEFAULT_LOOP_INTERFACE "lo0"
356 #elif defined (RTI_LINUX)
357 #define DEFAULT_LOOP_INTERFACE "lo"
358 #elif defined (RTI_VXWORKS)
359 #define DEFAULT_LOOP_INTERFACE "lo0"
360 #elif defined(RTI_WIN32)
361 #define DEFAULT_LOOP_INTERFACE "Loopback Pseudo-Interface 1"
363 #define DEFAULT_LOOP_INTERFACE "lo0"
369 #define DEFAULT_SLEEP_SEC 1
375 #define ApplicationConfig_INITIALIZER \
385 DEFAULT_ENTITY_ID_WRITER,\
386 DEFAULT_ENTITY_ID_READER,\
387 DEFAULT_PART_NAME_WRITER,\
388 DEFAULT_PART_NAME_READER,\
391 DEFAULT_LOOP_INTERFACE,\
392 DEFAULT_UDP_INTERFACE,\
395 APP_COUNT_UNLIMITED,\
396 DDS_DomainParticipantFactoryQos_INITIALIZER,\
397 DDS_DomainParticipantQos_INITIALIZER,\
398 DDS_DataReaderQos_INITIALIZER,\
399 DDS_DataWriterQos_INITIALIZER,\
400 DDS_DataReaderListener_INITIALIZER,\
401 DDS_DataWriterListener_INITIALIZER,\
402 DDS_STATUS_MASK_NONE,\
403 DDS_STATUS_MASK_NONE,\
404 DDS_STATUS_MASK_NONE,\
414 ApplicationConfig_initialize(ApplicationConfig_t *config);
421 ApplicationConfig_finalize(ApplicationConfig_t *config);
428 ApplicationConfig_parse_arguments(
429 ApplicationConfig_t *config,
int argc,
char** argv);
436 ApplicationConfig_print(ApplicationConfig_t *config);
446 typedef struct Application {
450 ApplicationConfig_t config;
454 struct UDP_InterfaceFactoryProperty property_udp;
467 struct DDS_PublicationBuiltinTopicData rem_publication_data;
472 struct DDS_SubscriptionBuiltinTopicData rem_subscription_data;
523 extern Application_t*
524 Application_create(ApplicationConfig_t *config);
531 Application_delete(Application_t *application);
537 Application_enable(Application_t *application);
543 Application_wait_for_data(Application_t *application);
549 Application_help(
char *appname);
555 Application_ListenerHelper_on_data_available(
563 Application_ListenerHelper_on_subscription_matched(
573 Application_ListenerHelper_on_publication_matched(