Fix: typo, and dirty fix to get compiled ftm.
[apps/low-level-can-service.git] / src / diagnostic / diagnostic-message.cpp
index c358aae..15fe094 100644 (file)
@@ -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
@@ -95,22 +105,9 @@ void obd2_signals_t::find_obd2_signals(const openxc_DynamicField &key, std::vect
        DEBUG(binder_interface, "Found %d signal(s)", (int)found_signals.size());
 }
 
-uint32_t get_signal_id(const Obd2Pid& sig)
-{
-       return (uint32_t)sig.pid;
-}
-
-void shims_logger(const char* m, const struct afb_binding_interface *interface)
-{
-       DEBUG(interface, "%s", m);
-}
-
-void shims_timer()
-{
-}
-
 bool obd2_signals_t::is_obd2_response(can_message_t can_message)
 {
+       /*
        if(can_message.get_id() >= 0x7E8 && can_message.get_id() <= 0x7EF)
        {
                openxc_VehicleMessage message = {0};
@@ -148,13 +145,14 @@ bool obd2_signals_t::is_obd2_response(can_message_t can_message)
                status=false;
        }
        return false;
+       */
 }
 
 void obd2_signals_t::add_request(int pid)
 {
        DiagnosticRequest request = {
        arbitration_id: OBD2_FUNCTIONAL_BROADCAST_ID,
-       mode: 0x1, has_true, pid};
+       mode: 0x1, has_pid: true, pid_ };
 }
 
 /**