Fix: typo, and dirty fix to get compiled ftm.
authorRomain Forlot <romain.forlot@iot.bzh>
Tue, 7 Mar 2017 14:36:18 +0000 (15:36 +0100)
committerRomain Forlot <romain.forlot@iot.bzh>
Thu, 16 Mar 2017 16:09:03 +0000 (17:09 +0100)
Change-Id: I74042051346a0f0f4de7152e2a668c041edaebde
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
src/diagnostic/diagnostic-message.cpp
src/diagnostic/diagnostic-message.hpp
src/low-can-binding.cpp

index 707b314..15fe094 100644 (file)
@@ -145,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_ };
 }
 
 /**
index cd4afd5..5adbde5 100644 (file)
@@ -67,13 +67,13 @@ typedef struct _Obd2Pid {
  */
 class obd2_signals_t {
        private:
-               uint8_t pid_;
-               const char* generic_name_;
-               const int min_;
-               const int max_;
-               enum UNIT unit_;
-               int frequency_;
-               bool supported_;
+               uint8_t pid_; /*!< pid - The 1 byte PID.*/
+               const char* generic_name_; /*!< generic_name_ - A human readable name to use for this PID when published.*/
+               const int min_; /*!< min_ - Minimum value that can take this pid */
+               const int max_; /*!< max_ - Maximum value that can take this pid */
+               enum UNIT unit_; /*!< unit_ : Which unit system is used by that pid. See enum UNIT above.*/
+               int frequency_; /*!< frequency - The frequency to request this PID if supported by the vehicle when automatic, recurring OBD-II requests are enabled.*/
+               bool supported_; /*!< supported_ - boolean indicating whether this pid is supported by the vehicle or not.*/
 
        public:
                const char* generic_name = generic_name_;
index 13452a4..41a6ab6 100644 (file)
@@ -82,7 +82,7 @@ static int subscribe_unsubscribe_signal(struct afb_req request, bool subscribe,
 
        std::lock_guard<std::mutex> subscribed_signals_lock(get_subscribed_signals_mutex());
        std::map<std::string, struct afb_event>& s = get_subscribed_signals();
-       if (s.find(sig) != s.end() && !afb_event_is_valid(s[std::string(sig)]))
+       if (s.find(sig) != s.end() && !afb_event_is_valid(s[sig]))
        {
                if(!subscribe)
                {
@@ -90,12 +90,14 @@ static int subscribe_unsubscribe_signal(struct afb_req request, bool subscribe,
                        ret = -1;
                }
                else
+               {
                        /* Event it isn't valid annymore, recreate it */
                        ret = create_event_handle(sig, s);
+               }
        }
        else
        {
-               /* Event don't exist , so let's create it */
+               /* Event doesn't exist , so let's create it */
                struct afb_event empty_event = {nullptr, nullptr};
                subscribed_signals[sig] = empty_event;
                ret = create_event_handle(sig, s);