Skip to content

Latest commit

 

History

History
689 lines (543 loc) · 36.2 KB

File metadata and controls

689 lines (543 loc) · 36.2 KB

Status

Each :ref:`dds_layer_core_entity` is associated with a set of :class:`Status` objects whose values represent the communication status of that Entity. Changes on the status values occur due to communication events related to each of the entities, e.g., when new data arrives, a new participant is discovered, or a remote endpoint is lost. The status is decomposed into several status objects, each concerning a different aspect of the communication, so that each of these status objects can vary independently of the others.

Changes on a status object trigger the corresponding :ref:`dds_layer_core_entity_commonchars_listener` callbacks that allow the Entity to inform the application about the event. For a given status object with name :class:`fooStatus`, the entity listener interface defines a callback function :func:`on_foo` that will be called when the status changes. Beware that some statuses have data members that are reset every time the corresponding listener is called. The only exception to this rule is when the entity has no listener attached, so the callback cannot be called. See the documentation of each status for details.

:ref:`dds_layer_core_waitsets` provide the application with an alternative mechanism to make it aware of changes on status objects, by means of a :ref:`dds_layer_core_entity_commonchars_statuscondition`. The advantage of this mechanism is that the application can wait for changes on several entities at the same time. It will also help the determinism of your system, as the notification is not processed on an internal thread, as it is done when using listeners.

The entities expose functions to access the value of its statuses. For a given status with name :class:`fooStatus`, the entity exposes a member function :func:`get_foo` to access the data in its :class:`fooStatus`. The only exceptions are :ref:`dds_layer_core_status_dataOnReaders` and :ref:`dds_layer_core_status_dataAvailable`. These getter functions return a read-only struct where all data members are public and accessible to the application. Beware that some statuses have data members that are reset every time the getter function is called by the application. See the documentation of each status for details.

The following subsections describe each of the status objects, their data members, and to which Entity type they concern. The next table offers a quick reference as well as the corresponding bit for each status in the |StatusMask-api|.

Status Name Entity Listener callback Accessor Bit
|InconsistentTopicStatus| |Topic| |TopicListener::on_inconsistent_topic-api| |Topic::get_inconsistent_topic_status-api| 0
|OfferedDeadlineMissedStatus| |DataWriter| |DataWriterListener::on_offered_deadline_missed-api| |DataWriter::get_offered_deadline_missed_status-api| 1
|RequestedDeadlineMissedStatus| |DataReader| |DataReaderListener::on_requested_deadline_missed-api| |DataReader::get_requested_deadline_missed_status-api| 2
|OfferedIncompatibleQosStatus| |DataWriter| |DataWriterListener::on_offered_incompatible_qos-api| |DataWriter::get_offered_incompatible_qos_status-api| 5
|RequestedIncompatibleQosStatus| |DataReader| |DataReaderListener::on_requested_incompatible_qos-api| |DataReader::get_requested_incompatible_qos_status-api| 6
|SampleLostStatus| |DataReader| |DataReaderListener::on_sample_lost-api| |DataReader::get_sample_lost_status-api| 7
|SampleRejectedStatus| |DataReader| |DataReaderListener::on_sample_rejected-api| |DataReader::get_sample_rejected_status-api| 8
|DataOnReaders| |Subscriber| |SubscriberListener::on_data_on_readers-api| N/A 9
|DataAvailable| |DataReader| |DataReaderListener::on_data_available-api| N/A 10
|LivelinessLostStatus| |DataWriter| |DataWriterListener::on_liveliness_lost-api| |DataWriter::get_liveliness_lost_status-api| 11
|LivelinessChangedStatus| |DataReader| |DataReaderListener::on_liveliness_changed-api| |DataReader::get_liveliness_changed_status-api| 12
|PublicationMatchedStatus| |DataWriter| |DataWriterListener::on_publication_matched-api| |DataWriter::get_publication_matched_status-api| 13
|SubscriptionMatchedStatus| |DataReader| |DataReaderListener::on_subscription_matched-api| |DataReader::get_subscription_matched_status-api| 14

InconsistentTopicStatus

This status changes every time an inconsistent remote Topic is discovered, that is, one with the same name but different characteristics than the current Topic. See |InconsistentTopicStatus-api|.

List of status data members:

Data Member Name Type
|BaseStatus::total_count-api| int32_t
|BaseStatus::total_count_change-api| int32_t

Warning

Currently this status is not supported and will be implemented in future releases. As a result, trying to access this status will return NOT_SUPPORTED and the corresponding listener will never be called.

DataOnReaders

This status becomes active every time there is new data available for the application on any DataReader belonging to the current Subscriber. There is no getter function to access this status, as it does not keep track of any information related to the data itself. Its only purpose is to trigger the |SubscriberListener::on_data_on_readers-api| callback on the listener attached to the DataReader.

DataAvailable

This status becomes active every time there is new data available for the application on the DataReader. There is no getter function to access this status, as it does not keep track of any information related to the data itself. Its only purpose is to trigger the |DataReaderListener::on_data_available-api| callback on the listener attached to the DataReader.

LivelinessChangedStatus

This status changes every time the liveliness status of a matched DataWriter has changed. Either because a DataWriter that was inactive has become active or the other way around. See |LivelinessChangedStatus-api|.

List of status data members:

Data Member Name Type
|LivelinessChangedStatus::alive_count-api| int32_t
|LivelinessChangedStatus::not_alive_count-api| int32_t
|LivelinessChangedStatus::alive_count_change-api| int32_t
|LivelinessChangedStatus::not_alive_count_change-api| int32_t
|LivelinessChangedStatus::last_publication_handle-api| |InstanceHandle_t-api|

RequestedDeadlineMissedStatus

This status changes every time the DataReader does not receive data within the deadline period configured on its :ref:`dds_layer_subscriber_dataReaderQos`. See |RequestedDeadlineMissedStatus-api|.

List of status data members:

Data Member Name Type
|DeadlineMissedStatus::total_count-api| int32_t
|DeadlineMissedStatus::total_count_change-api| int32_t
|DeadlineMissedStatus::last_instance_handle-api| |InstanceHandle_t-api|

RequestedIncompatibleQosStatus

This status changes every time the DataReader finds a DataWriter that matches the Topic and has a common partition, but with a QoS configuration incompatible with the one defined on the DataReader. See |RequestedIncompatibleQosStatus-api|.

List of status data members:

Data Member Name Type
|IncompatibleQosStatus::total_count-api| int32_t
|IncompatibleQosStatus::total_count_change-api| int32_t
|IncompatibleQosStatus::last_policy_id-api| |QosPolicyId_t-api|
|IncompatibleQosStatus::policies-api| |QosPolicyCountSeq-api|

QosPolicyCountSeq

Holds a :ref:`dds_layer_core_status_qosPolicyCount` for each :ref:`dds_layer_core_policy`, indexed by its |QosPolicyId_t-api|. Therefore, the Qos Policy with ID N will be at position N in the sequence. See |QosPolicyCountSeq-api|.

.. literalinclude:: /../code/DDSCodeTester.cpp
   :language: c++
   :dedent: 8
   :start-after: //DDS_QOS_POLICY_COUNT_SEQ
   :end-before: //!


QosPolicyCount

This structure holds a counter for a policy. See |QosPolicyCount-api|.

List of data members:

Data Member Name Type
|QosPolicyCount::policy_id-api| |QosPolicyId_t-api|
|QosPolicyCount::count-api| int32_t

SampleLostStatus

This status changes every time a new data sample is lost and will never be received. See |SampleLostStatus-api|.

There are two different criteria for considering a sample as lost depending on the |DataReaderQos::reliability-api|:

List of status data members:

Data Member Name Type
|BaseStatus::total_count-api| int32_t
|BaseStatus::total_count_change-api| int32_t

SampleRejectedStatus

This status changes every time an incoming data sample is rejected by the DataReader. The reason for the rejection is defined by :ref:`dds_layer_core_status_sampleRejectedStatusKind`. For further information see |SampleRejectedStatus-api|.

List of status data members:

Data Member Name Type
|SampleRejectedStatus::total_count-api| int32_t
|SampleRejectedStatus::total_count_change-api| int32_t
|SampleRejectedStatus::last_reason-api| |SampleRejectedStatusKind-api|
|SampleRejectedStatus::last_instance_handle-api| |InstanceHandle_t-api|

SampleRejectedStatusKind

In Fast DDS, samples can be rejected due to resource limit reasons. However, the fact that the samples are rejected does not imply that they are lost, i.e. a rejected sample may be accepted in the future.

|SampleRejectedStatusKind-api| specifies the reason of the rejection:

  • |NOT_REJECTED| specifies that the samples were not rejected.
  • |REJECTED_BY_SAMPLES_LIMIT| specifies that the samples were rejected because there were not enough resources to stored them. This can happen even when there are free resources if those resources must be guaranteed to be available for other samples. This situation, which arises in the RTPS layer, occurs when there are yet to be received samples with lower sequence number and there is not enough resources for all of them (because |max_samples-api| has been reached).
  • |REJECTED_BY_INSTANCES_LIMIT| specifies that the samples were rejected because there were not enough resources to allocate the samples' instances. This situation, which arises in the DDS layer, more precisely in the in the :class:`DataReader`'s history, occurs when the sample corresponds to a new instance for which the middleware should reserve resources but the history's number of instances has already reached |max_instances-api|.
  • |REJECTED_BY_SAMPLES_PER_INSTANCE_LIMIT| specifies that the samples were rejected because there were not enough resources within their instance to stored them. This situation, which arises in the DDS layer, more precisely in the :class:`DataReader`'s history, occurs when the :class:`DataReader` is configured with |KEEP_ALL_HISTORY_QOS-api| and the instance's number of samples has reached |max_samples_per_instance-api|.

SubscriptionMatchedStatus

This status changes every time the DataReader finds a DataWriter that matches the Topic and has a common partition and a compatible QoS, or has ceased to be matched with a DataWriter that was previously considered to be matched. See |SubscriptionMatchedStatus-api|.

List of status data members:

Data Member Name Type
|MatchedStatus::total_count-api| int32_t
|MatchedStatus::total_count_change-api| int32_t
|MatchedStatus::current_count-api| int32_t
|MatchedStatus::current_count_change-api| int32_t
|SubscriptionMatchedStatus::last_publication_handle-api| |InstanceHandle_t-api|

LivelinessLostStatus

This status changes every time the DataWriter failed to assert its liveliness during the period configured on its :ref:`dds_layer_publisher_dataWriterQos`. This means that matched DataReader entities will consider the DataWriter as no longer alive. See |LivelinessLostStatus-api|.

List of status data members:

Data Member Name Type
|BaseStatus::total_count-api| int32_t
|BaseStatus::total_count_change-api| int32_t

OfferedDeadlineMissedStatus

This status changes every time the DataWriter fails to provide data within the deadline period configured on its :ref:`dds_layer_publisher_dataWriterQos`. See |OfferedDeadlineMissedStatus-api|.

List of status data members:

Data Member Name Type
|DeadlineMissedStatus::total_count-api| int32_t
|DeadlineMissedStatus::total_count_change-api| int32_t
|DeadlineMissedStatus::last_instance_handle-api| |InstanceHandle_t-api|

OfferedIncompatibleQosStatus

This status changes every time the DataWriter finds a DataReader that matches the Topic and has a common partition, but with a QoS configuration that is incompatible with the one defined on the DataWriter. See |OfferedIncompatibleQosStatus-api|.

List of status data members:

Data Member Name Type
|IncompatibleQosStatus::total_count-api| int32_t
|IncompatibleQosStatus::total_count_change-api| int32_t
|IncompatibleQosStatus::last_policy_id-api| |QosPolicyId_t-api|
|IncompatibleQosStatus::policies-api| |QosPolicyCountSeq-api|

PublicationMatchedStatus

This status changes every time the DataWriter finds a DataReader that matches the Topic and has a common partition and a compatible QoS, or has ceased to be matched with a DataReader that was previously considered to be matched. See |PublicationMatchedStatus-api|.

List of status data members:

Data Member Name Type
|MatchedStatus::total_count-api| int32_t
|MatchedStatus::total_count_change-api| int32_t
|MatchedStatus::current_count-api| int32_t
|MatchedStatus::current_count_change-api| int32_t
|PublicationMatchedStatus::last_subscription_handle-api| |InstanceHandle_t-api|