DataWritersΒΆ

DataWriters write data to a topic using a publisher, and take as a template parameter the data type being exchanged. The settings for the writer are either inherited from the publisher, or explicitly set in its own Qos policies and listener.

Inherited from the publisher:

dds_entity_t writer = dds_create_writer (publisher, topic, NULL, NULL);

Explicitly set in its own QoS policies and listener:

dds_qos_t *qos = dds_create_qos ();
dds_listener_t *listener = dds_create_listener(NULL);
dds_lset_publication_matched(listener, publication_matched);
dds_entity_t writer = dds_create_writer (participant, topic, qos, listener);

A writer can write a sample:

DataType sample;
dds_write (writer, &sample);

A sample with a specific timestamp:

DataType sample;
dds_write_ts(writer, &sample, dds_time());

A range of samples:

C code sample TBD