Change the way to check signal type making prefix_
[apps/agl-service-can-low-level.git] / src / diagnostic / diagnostic-message.hpp
index 534b9a5..ec4521f 100644 (file)
@@ -46,7 +46,7 @@ class obd2_signal_t {
        private:
                uint8_t pid_; /*!< pid - The 1 byte PID.*/
                std::string generic_name_; /*!< generic_name_ - A human readable name to use for this PID when published.*/
-               std::string prefix_ = "diagnostic_messages."; /*!< prefix_ - generic_name_ will be prefixed with it. It has to reflect the used protocol.
+               static std::string prefix_; /*!< prefix_ - generic_name_ will be prefixed with it. It has to reflect the used protocol.
                                                  * which make easier to sort message when the come in.*/
                int min_; /*!< min_ - Minimum value that can take this pid */
                int max_; /*!< max_ - Maximum value that can take this pid */
@@ -59,15 +59,18 @@ class obd2_signal_t {
                obd2_signal_t(uint8_t pid, const char* generic_name, const int min_, const int max_, enum UNIT unit, int frequency, bool supported);
 
                uint32_t get_pid();
-               std::string& get_generic_name();
-               std::string get_name();
+               const std::string& get_generic_name() const;
+               const std::string get_name() const;
+               static const std::string& get_prefix();
+               int get_frequency() const;
 
-               void set_prefix(std::string val);
-               void add_request(int pid);
+               static void set_prefix(const std::string& val);
+
+               const DiagnosticRequest build_diagnostic_request();
 
                bool is_obd2_response(can_message_t can_message);
                bool is_obd2_request(DiagnosticRequest *request);
-               bool is_obd2_signal(const char *name);
+               static bool is_obd2_signal(const std::string& name);
 
-               float decode_obd2_response(const DiagnosticResponse* response, float parsedPayload);
+               static float decode_obd2_response(const DiagnosticResponse* response, float parsedPayload);
 };
\ No newline at end of file