I get the following errors when trying to change the batch settings:
[D0300|Writer(80002002)|SET_QOS]PRESPsService_setLocalEndpointProperty:!copyToWriterRW
[D0300|Writer(80002002)|SET_QOS]DDS_DataWriter_set_qos:ERROR: Failed to set writer QoS
It runs without errors until I add the (3) commented out lines.
m_locals.Entity_Position_Writer->get_qos(q);
q.deadline.period = DDS_Duration_t::from_millis(100);
//DDS_Duration_t res = {0, 0};
//q.batch.enable = true;
//q.batch.source_timestamp_resolution = res;
m_locals.Entity_Position_Writer->set_qos(q);
What is causing these errors? It looks like batch is already enabled by default, so it looks like it has to do with the timestamp resolution.
Hello Dave,
This is because the BATCH policy is immutable. It cannot be changed after the DataWriter is enabled. If you look at the documentation for the BatchQosPolicy you will see that "changeable" is specied to be
UNTIL_ENABLE
which means precisely this.Gerardo