summaryrefslogtreecommitdiff
path: root/interface
diff options
context:
space:
mode:
authorJuergen Gehring <juergen.gehring@bmw.de>2018-01-25 00:40:03 -0800
committerJuergen Gehring <juergen.gehring@bmw.de>2018-01-25 00:40:03 -0800
commit686cb94032c12be4981eac46efe5f62c2ba4d0e8 (patch)
tree2ef421866a7e7db6d598a7c3b14da58d5dc6e767 /interface
parente9c35d34fb58c4a68d2c2fdbd78b69a0ad0ac320 (diff)
downloadvSomeIP-686cb94032c12be4981eac46efe5f62c2ba4d0e8.tar.gz
vsomeip 2.9.02.9.0
Diffstat (limited to 'interface')
-rw-r--r--interface/vsomeip/application.hpp44
-rw-r--r--interface/vsomeip/enumeration_types.hpp6
-rw-r--r--interface/vsomeip/handler.hpp4
3 files changed, 53 insertions, 1 deletions
diff --git a/interface/vsomeip/application.hpp b/interface/vsomeip/application.hpp
index 280957c..fdf007e 100644
--- a/interface/vsomeip/application.hpp
+++ b/interface/vsomeip/application.hpp
@@ -10,6 +10,7 @@
#include <memory>
#include <set>
#include <map>
+#include <vector>
#include <vsomeip/primitive_types.hpp>
#include <vsomeip/enumeration_types.hpp>
@@ -312,7 +313,7 @@ public:
*/
virtual void subscribe(service_t _service, instance_t _instance,
eventgroup_t _eventgroup, major_version_t _major = DEFAULT_MAJOR,
- subscription_type_e _subscription_type = subscription_type_e::SU_PREFER_RELIABLE,
+ subscription_type_e _subscription_type = subscription_type_e::SU_RELIABLE_AND_UNRELIABLE,
event_t _event = ANY_EVENT) = 0;
/**
@@ -884,6 +885,47 @@ public:
virtual void register_subscription_status_handler(service_t _service,
instance_t _instance, eventgroup_t _eventgroup, event_t _event,
subscription_status_handler_t _handler, bool _is_selective) = 0;
+
+ /**
+ *
+ * \brief Returns all registered services / instances on this node in an async callback.
+ *
+ * When called with a handler of type offered_services_handler_t,
+ * all at the routing manager registered services on this node get returned in a vector of
+ * service / instance pairs depending on the given _offer_type.
+ *
+ * \param _offer_type type of offered services to be returned (OT_LOCAL = 0x00, OT_REMOTE = 0x01, OT_ALL = 0x02)
+ * \param offered_services_handler_t handler which gets called with a vector of service instance pairs that are currently offered
+ */
+ virtual void get_offered_services_async(offer_type_e _offer_type, offered_services_handler_t _handler) = 0;
+
+ /**
+ *
+ * \brief Sets a handler to be called cyclically for watchdog monitoring.
+ *
+ * The handler shall be called in the given interval, but not before start()
+ * has been called, and not after call to stop() returned.
+ *
+ * In case the application is running, i.e. start() succeeded, but the
+ * handler will not be invoke within the (approximate) interval it may
+ * be assumed that I/O or internal dispatcher threads are non-functional.
+ *
+ * \remark Accuracy of call interval is limited by clock/timer granularity
+ * or scheduling effects, thus it may underrun or overrun by small
+ * amount.
+ *
+ * \note Only one handler can be active at the time, thus last handler set
+ * by calling this function will be invoked.
+ *
+ * \note To disable calling an active handler, invoke this method again,
+ * passing nullptr as _handler and/or std::chrono::seconds::zero()
+ * as _interval.
+ *
+ * \param _handler A watchdog handler, pass nullptr to deactivate.
+ * \param _interval Call interval in seconds, pass std::chrono::seconds::zero() to deactivate.
+ */
+ virtual void set_watchdog_handler(watchdog_handler_t _handler, std::chrono::seconds _interval) = 0;
+
};
/** @} */
diff --git a/interface/vsomeip/enumeration_types.hpp b/interface/vsomeip/enumeration_types.hpp
index 74358c6..1f83b81 100644
--- a/interface/vsomeip/enumeration_types.hpp
+++ b/interface/vsomeip/enumeration_types.hpp
@@ -63,6 +63,12 @@ enum class routing_state_e : uint8_t {
RS_UNKNOWN = 0xFF
};
+enum class offer_type_e : uint8_t {
+ OT_LOCAL = 0x00,
+ OT_REMOTE = 0x01,
+ OT_ALL = 0x02,
+};
+
} // namespace vsomeip
#endif // VSOMEIP_ENUMERATION_TYPES_HPP
diff --git a/interface/vsomeip/handler.hpp b/interface/vsomeip/handler.hpp
index 507ac3c..ab4f118 100644
--- a/interface/vsomeip/handler.hpp
+++ b/interface/vsomeip/handler.hpp
@@ -23,6 +23,10 @@ typedef std::function< void (const uint16_t) > error_handler_t;
typedef std::function< void (const service_t, const instance_t, const eventgroup_t,
const event_t, const uint16_t) > subscription_status_handler_t;
+typedef std::function< void (const std::vector<std::pair<service_t, instance_t>> &_services) > offered_services_handler_t;
+typedef std::function< void () > watchdog_handler_t;
+
+
} // namespace vsomeip
#endif // VSOMEIP_HANDLER_HPP