messages to be processed.
For now, processing prefix is hardcoded but idea is to
process them dynamically if possible. To be studied.
Change-Id: Iac0c96228fc5f53e3c637e54350188ff3de6d57f
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
can_bus_t can_bus_manager_ = can_bus_t(afb_daemon_rootdir_open_locale(binder_interface->daemon, "can_buses.json", O_RDONLY, NULL));
diagnostic_manager_t diagnostic_manager_;
uint8_t active_message_set_ = 0;
can_bus_t can_bus_manager_ = can_bus_t(afb_daemon_rootdir_open_locale(binder_interface->daemon, "can_buses.json", O_RDONLY, NULL));
diagnostic_manager_t diagnostic_manager_;
uint8_t active_message_set_ = 0;
+ std::vector<std::string> signals_prefix_;
+
+ std::vector<can_message_set_t> can_message_set_;
+ std::vector<std::vector<can_signal_t>> can_signals_;
+ std::vector<std::vector<obd2_signal_t>> obd2_signals_;
+ std::vector<std::vector<can_message_definition_t>> can_message_definition_;
/// Private constructor with implementation generated by the AGL generator.
configuration_t();
/// Private constructor with implementation generated by the AGL generator.
configuration_t();
public:
static configuration_t& instance();
public:
static configuration_t& instance();
- std::vector<can_message_set_t> can_message_set_;
- std::vector<std::vector<can_signal_t>> can_signals_;
- std::vector<std::vector<obd2_signal_t>> obd2_signals_;
- std::vector<std::vector<can_message_definition_t>> can_message_definition_;
-
configuration_t& get_configuration() ;
can_bus_t& get_can_bus_manager();
configuration_t& get_configuration() ;
can_bus_t& get_can_bus_manager();
std::vector<obd2_signal_t>& get_obd2_signals();
std::vector<obd2_signal_t>& get_obd2_signals();
+ const std::vector<std::string>& get_signals_prefix() const;
uint32_t get_signal_id(obd2_signal_t& sig) const;
uint32_t get_signal_id(can_signal_t& sig) const;
uint32_t get_signal_id(obd2_signal_t& sig) const;
uint32_t get_signal_id(can_signal_t& sig) const;
static int subscribe_unsubscribe_signals(struct afb_req request, bool subscribe, const std::vector<std::string>& signals)
{
int rets = 0;
static int subscribe_unsubscribe_signals(struct afb_req request, bool subscribe, const std::vector<std::string>& signals)
{
int rets = 0;
+ //TODO: Implement way to dynamically call the right function no matter
+ // how much signals types we have.
+ const std::string& can_prefix = configuration_t::instance().get_can_signals().front().get_prefix();
+ const std::string& obd2_prefix = configuration_t::instance().get_obd2_signals().front().get_prefix();
for(auto& sig : signals)
{
for(auto& sig : signals)
{