X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fcan-signals.hpp;h=374afeeae556a881c8f4f440471d53ea145d1dc5;hb=b0975e4bfa534153657a7ee8acaee0f950056e97;hp=d6ec171adeaf72d54084504b2c8b54e18904e762;hpb=cddc9c28e3e1a242e55f68c9971d0710ada30e9f;p=apps%2Fagl-service-can-low-level.git diff --git a/src/can-signals.hpp b/src/can-signals.hpp index d6ec171a..374afeea 100644 --- a/src/can-signals.hpp +++ b/src/can-signals.hpp @@ -17,27 +17,30 @@ #pragma once +#include #include #include #include #include -#include #include "can-utils.hpp" -#include "low-can-binding.hpp" extern "C" { #include } -/** - * @brief Dumb SIGNALS array. It is composed by CanMessageSet - * SIGNALS[MESSAGE_SET_ID][CanSignal] +#define MESSAGE_SET_ID 0 + +/** + * @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(); @@ -93,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 openxc_DynamicField &key); +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