aboutsummaryrefslogtreecommitdiffstats
path: root/src/diagnostic/diagnostic-manager.hpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-03-12 19:48:21 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-03-16 17:10:41 +0100
commit7617950b0ab386949b43c6f221b02826e18548d6 (patch)
treebd695ba29cbf87550288734690556af9df6615f7 /src/diagnostic/diagnostic-manager.hpp
parent6c40a7192cd6ddf89e625b53dd489b7a91a423e1 (diff)
Implemente way to send diagnostic request when subscribed.
When subscribed, the signal is added to recurring request list of diagnostic manager and an event is added to the systemd event loop with timer set using frequency parameter from the requested signal. Change-Id: I4d604c498047d7744c090b7f03fce0f2b427fd01 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/diagnostic/diagnostic-manager.hpp')
-rw-r--r--src/diagnostic/diagnostic-manager.hpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/diagnostic/diagnostic-manager.hpp b/src/diagnostic/diagnostic-manager.hpp
index 39aae321..aa98c0b7 100644
--- a/src/diagnostic/diagnostic-manager.hpp
+++ b/src/diagnostic/diagnostic-manager.hpp
@@ -17,6 +17,7 @@
#pragma once
+#include <systemd/sd-event.h>
#include <queue>
#include <vector>
@@ -94,4 +95,8 @@ public:
bool add_recurring_request(DiagnosticRequest* request, const char* name,
bool waitForMultipleResponses, const DiagnosticResponseDecoder decoder,
const DiagnosticResponseCallback callback, float frequencyHz);
+
+ bool conflicting(active_diagnostic_request_t* request, active_diagnostic_request_t* candidate) const;
+ bool clear_to_send(active_diagnostic_request_t* request) const;
+ static int send_request(sd_event_source *s, uint64_t usec, void *userdata);
};