X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fcan-signals.hpp;h=e0fe2230908eb185b6f9141ed7f9bcb8a3a85b4f;hb=836feaecd602e86ea6d954ae018a2d7bbc04aa7a;hp=37724867a1ebf5b016c7406461ab836e432e555f;hpb=cfd941effb1b2183f6d3f693496aadd45762523f;p=apps%2Fagl-service-can-low-level.git 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> SIGNALS { - {}// message set: example -}; +static std::map 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] return found CanSignal generic name vector. + * @return std::vector return found CanSignal generic name vector. */ std::vector 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 - map of subscribed signals. + */ +const std::map get_subscribed_signals(); \ No newline at end of file