aboutsummaryrefslogtreecommitdiffstats
path: root/src/diagnostic/diagnostic-message.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/diagnostic/diagnostic-message.cpp')
-rw-r--r--src/diagnostic/diagnostic-message.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/diagnostic/diagnostic-message.cpp b/src/diagnostic/diagnostic-message.cpp
index 0b1a9339..71b0f7d7 100644
--- a/src/diagnostic/diagnostic-message.cpp
+++ b/src/diagnostic/diagnostic-message.cpp
@@ -59,9 +59,9 @@ const char *UNIT_NAMES[10] = {
{ 0x63, "obd2.engine.torque", 0, 65535, NM, 1, false}
};
-obd2_signals_t::obd2_signals_t(uint8_t pid, const char* generic_name, const int min, const int max, enum UNIT unit, int frequency, bool supported)
- : pid_{pid}, generic_name_{generic_name}, min_{min}, max_{max}, unit_{unit}, frequency_{frequency}, supported_{supported}
+uint32_t get_signal_id(obd2_signals_t& sig)
{
+ return sig.get_pid();
}
std::vector<obd2_signals_t>& get_obd2_signals()
@@ -69,6 +69,16 @@ std::vector<obd2_signals_t>& get_obd2_signals()
return OBD2_PIDS;
}
+obd2_signals_t::obd2_signals_t(uint8_t pid, const char* generic_name, const int min, const int max, enum UNIT unit, int frequency, bool supported)
+ : pid_{pid}, generic_name_{generic_name}, min_{min}, max_{max}, unit_{unit}, frequency_{frequency}, supported_{supported}
+{
+}
+
+uint32_t obd2_signals_t::get_pid()
+{
+ return (uint32_t)pid_;
+}
+
/**
* @fn std::vector<std::string> find_signals(const openxc_DynamicField &key)
* @brief return signals name found searching through CAN_signals and OBD2 pid