1.6. Callbacks¶
-
namespace participants¶
Typedefs
-
typedef void (*DdsLogFunc)(const char *file_name, int line_no, const char *func_name, int category, const char *msg)¶
DdsLogFunc - callback executed when consuming log messages
- Param file_name:
[in] Name of the file where the log was generated
- Param line_no:
[in] Line number in the file where the log was generated
- Param func_name:
[in] Name of the function where the log was generated
- Param category:
[in] Category of the log message
- Param msg:
[in] Log message content
-
typedef void (*DdsTypeNotification)(const char *type_name, const char *serialized_type, const unsigned char *serialized_type_internal, uint32_t serialized_type_internal_size, const char *data_placeholder)¶
DdsTypeNotification - callback for notifying the reception of DDS types
- Param type_name:
[in] Name of the received type
- Param serialized_type:
[in] Serialized type in IDL format
- Param serialized_type_internal:
[in] Serialized type in internal format
- Param serialized_type_internal_size:
[in] Size of the serialized type in internal format
- Param data_placeholder:
[in] JSON data placeholder
-
typedef void (*DdsTopicNotification)(const char *topic_name, const TopicInfo &topic_info)¶
DdsTopicNotification - callback for notifying the reception of DDS topics
- Param topic_name:
[in] Name of the received topic
- Param topic_info:
[in] Information about the topic, including type name and serialized QoS
-
typedef void (*DdsDataNotification)(const char *topic_name, const char *json, int64_t publish_time)¶
DdsDataNotification - callback for notifying the reception of DDS data
- Param topic_name:
[in] Name of the topic from which the data was received
- Param json:
[in] JSON representation of the data
- Param publish_time:
[in] Time (nanoseconds since epoch) when the data was published
-
typedef bool (*DdsTypeQuery)(const char *type_name, std::unique_ptr<const unsigned char[]> &serialized_type_internal, uint32_t &serialized_type_internal_size)¶
DdsTypeQuery - callback for requesting information (serialized description and size) of a DDS type
- Param type_name:
[in] Name of the type to query
- Param serialized_type_internal:
[out] Pointer to the serialized type in internal format
- Param serialized_type_internal_size:
[out] Size of the serialized type in internal format
- Return:
trueif the type was found and the information was retrieved successfully,falseotherwise
-
typedef bool (*DdsTopicQuery)(const char *topic_name, TopicInfo &topic_info)¶
DdsTopicQuery - callback for requesting information (type and QoS) of a DDS topic
- Param topic_name:
[in] Name of the topic to query
- Param topic_info:
[out] Information about the topic, including type name and serialized QoS
- Return:
trueif the topic was found and the information was retrieved successfully,falseotherwise
-
typedef void (*ServiceNotification)(const char *service_name, const ServiceInfo &service_info)¶
Callback for notification of service discovery and its request and reply types.
This callback is used to notify the discovery of a service and its associated request and reply types.
- Param service_name:
[in] The name of the service that was discovered.
- Param service_info:
[in] Information about the service, including request and reply types and their serialized QoS.
-
typedef void (*ServiceRequestNotification)(const char *service_name, const char *json, uint64_t request_id, int64_t publish_time)¶
Callback for reception of service request data.
This callback is used to notify the reception of a request for a specific service.
Note
The request_id is unique for each request and must be later used to identify the reply.
- Param service_name:
[in] The name of the service for which the request was received.
- Param json:
[in] The JSON data received in the request.
- Param request_id:
[in] The unique identifier of the request.
- Param publish_time:
[in] The time at which the request was published.
-
typedef void (*ServiceReplyNotification)(const char *service_name, const char *json, uint64_t request_id, int64_t publish_time)¶
Callback for reception of RPC reply data.
This callback is used to notify the reception of a reply for a specific service.
- Param service_name:
[in] The name of the service for which the reply was received.
- Param json:
[in] The JSON data received in the reply.
- Param request_id:
[in] The unique identifier of the request for which this is a reply.
- Param publish_time:
[in] The time at which the reply was published.
-
typedef bool (*ServiceQuery)(const char *service_name, ServiceInfo &service_info)¶
Callback requesting the information of a given service’s request and reply.
This callback is used to request the information for a service’s request and reply.
- Param service_name:
[in] The name of the service for which the information is requested.
- Param service_info:
[out] Information about the service, including request and reply types and their serialized QoS.
- Return:
trueif the service was found and the information was retrieved successfully,falseotherwise.
-
typedef void (*ActionNotification)(const char *action_name, const ActionInfo &action_info)¶
Callback for notification of action discovery and its associated types.
This callback is used to notify the discovery of an action and its associated types.
- Param action_name:
[in] The name of the action that was discovered.
- Param action_info:
[in] Information about the action, including goal, result, cancel, feedback, and status types and their serialized QoS.
-
typedef bool (*ActionGoalRequestNotification)(const char *action_name, const char *json, const UUID &goal_id, int64_t publish_time)¶
Callback for notification of an action goal request.
This callback is used to notify the request of an action goal.
- Param action_name:
[in] The name of the action for which the goal is being requested.
- Param json:
[in] The JSON data representing the goal request.
- Param goal_id:
[in] The unique identifier of the goal associated with the action.
- Param publish_time:
[in] The time at which the goal request was published.
- Return:
trueif the goal request has been accepted,falseotherwise.
-
typedef void (*ActionCancelRequestNotification)(const char *action_name, const UUID &goal_id, int64_t timestamp, uint64_t request_id, int64_t publish_time)¶
Callback for notification of an action cancel request.
This callback is used to notify the request to cancel an action goal:
If the goal ID is empty and timestamp is zero, cancel all goals If the goal ID is empty and timestamp is not zero, cancel all goals accepted at or before the timestamp If the goal ID is not empty and timestamp is zero, cancel the goal with the given ID regardless of the time it was accepted If the goal ID is not empty and timestamp is not zero, cancel the goal with the given ID and all goals accepted at or before the timestamp
- Param action_name:
[in] The name of the action for which the cancel request is being made.
- Param goal_id:
[in] The unique identifier of the goal associated with the action.
- Param timestamp:
[in] The timestamp used for discriminating which goals to cancel.
- Param request_id:
[in] The identifier of the cancel request used for dicriminating which goals to cancel.
- Param publish_time:
[in] The time at which the cancel request was published.
-
typedef void (*ActionFeedbackNotification)(const char *action_name, const char *json, const UUID &goal_id, int64_t publish_time)¶
Callback for notification of action feedback.
This callback is used to notify the feedback of an action.
- Param action_name:
[in] The name of the action for which the feedback is being notified.
- Param json:
[in] The JSON data representing the feedback of the action.
- Param goal_id:
[in] The unique identifier of the goal associated with the action.
- Param publish_time:
[in] The time at which the feedback was published.
-
typedef void (*ActionStatusNotification)(const char *action_name, const UUID &goal_id, StatusCode status_code, const char *status_message, int64_t publish_time)¶
Callback for notification of an update for an action status.
This callback is used to notify the update of the status of an action.
- Param action_name:
[in] The name of the action for which the status is being notified.
- Param goal_id:
[in] The unique identifier of the goal associated with the action.
- Param status_code:
[in] The status code representing the current state of the action.
- Param status_message:
[in] A message providing additional information about the status.
- Param publish_time:
[in] The time at which the status was published.
-
typedef void (*ActionResultNotification)(const char *action_name, const char *json, const UUID &goal_id, int64_t publish_time)¶
Callback for notification of action result.
This callback is used to notify the result of an action in case of success.
- Param action_name:
[in] The name of the action for which the result is being notified.
- Param json:
[in] The JSON data representing the result of the action.
- Param goal_id:
[in] The unique identifier of the goal associated with the action.
- Param publish_time:
[in] The time at which the result was published.
-
typedef bool (*ActionQuery)(const char *action_name, ActionInfo &action_info)¶
Callback for requesting action’s information.
This callback is used to request information about a specific action.
- Param action_name:
[in] The name of the action for which the information is being requested.
- Param action_info:
[out] Information about the action, including goal, result, cancel, feedback, and status types and their serialized QoS.
- Return:
trueif the action was found and the information was retrieved successfully,falseotherwise.
-
struct TopicInfo¶
- #include <ddsenabler/Callbacks.hpp>
Struct that contains information about a DDS topic.
This struct is used to encapsulate the type name and serialized QoS of a DDS topic.
-
struct ServiceInfo¶
- #include <ddsenabler/Callbacks.hpp>
Struct that contains information about a DDS service.
This struct is used to encapsulate the request and reply topics of a DDS service.
-
struct ActionInfo¶
- #include <ddsenabler/Callbacks.hpp>
Struct that contains information about a DDS action.
This struct is used to encapsulate the goal, result and cancel services as well as the feedback and status topics of a DDS action.
-
typedef void (*DdsLogFunc)(const char *file_name, int line_no, const char *func_name, int category, const char *msg)¶