summaryrefslogtreecommitdiffstats
path: root/src/can-signals.hpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-02-22 11:44:27 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-02-22 12:15:13 +0100
commit747d58ad84d230f6cf11ac818bab65019df83611 (patch)
treea7a6f84cac521fd181b8aec490260fda676f08cc /src/can-signals.hpp
parentcfd941effb1b2183f6d3f693496aadd45762523f (diff)
No more warning about not defined functions
because of wrong header files inclusion. Some variables are now accessible using functions rather than using global variables that can not be accessed through separated files. Also fix timer returning function type. Change-Id: I36138ff671c2537f595235273abaa34783be18e1 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/can-signals.hpp')
-rw-r--r--src/can-signals.hpp37
1 files changed, 25 insertions, 12 deletions
diff --git a/src/can-signals.hpp b/src/can-signals.hpp
index 37724867..e0fe2230 100644
--- a/src/can-signals.hpp
+++ b/src/can-signals.hpp
@@ -32,13 +32,15 @@ extern "C"
#define MESSAGE_SET_ID 0
-/**
- * @brief Dumb SIGNALS array. It is composed by CanMessageSet
- * SIGNALS[MESSAGE_SET_ID][CanSignal]
+/**
+ * @brief Can signal event map making access to afb_event
+ * externaly to an openxc existing structure.
+ *
+ * @desc Event map is making relation between CanSignal generic name
+ * and the afb_event struct used by application framework to pushed
+ * to the subscriber.
*/
-std::vector<std::vector<CanSignal>> SIGNALS {
- {}// message set: example
-};
+static std::map<std::string, struct afb_event> subscribed_signals;
/** Public: Return the currently active CAN configuration. */
CanMessageSet* getActiveMessageSet();
@@ -94,14 +96,25 @@ CanBus* getCanBuses();
* @brief Find one or many signals based on its name or id
* passed through openxc_DynamicField.
*
- * params[openxc_DynamicField&] - a const reference with the key to search into signal.
+ * @param[in] openxc_DynamicField& - a const reference with the key to search into signal.
* Key is either a signal name or its CAN arbitration id.
*
- * return[std::vector<std::string>] return found CanSignal generic name vector.
+ * @return std::vector<std::string> return found CanSignal generic name vector.
*/
std::vector<CanSignal> find_can_signals(const struct afb_binding_interface* interface, const openxc_DynamicField &key);
-uint32_t get_CanSignal_id(const CanSignal& sig)
-{
- return sig.message->id;
-} \ No newline at end of file
+/**
+ * @brief Retrieve can arbitration id of a given CanSignal
+ *
+ * @param[in] CanSignal& - a const reference to a CanSignal
+ *
+ * @return uint32_t - unsigned integer representing the arbitration id.
+ */
+inline uint32_t get_CanSignal_id(const CanSignal& sig);
+
+/**
+ * @brief return the subscribed_signals map.
+ *
+ * return std::map<std::string, struct afb_event> - map of subscribed signals.
+ */
+const std::map<std::string, struct afb_event> get_subscribed_signals(); \ No newline at end of file