summaryrefslogtreecommitdiffstats
path: root/src/can/can-signals.hpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-03-10 15:53:27 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-03-16 17:10:41 +0100
commit093d7a35c23c65ffef888ded40aea9e77f0e4975 (patch)
treee19ad22f612560f0000aa6076fd0d59226bc9323 /src/can/can-signals.hpp
parent127d46e303af839a2b160051722d38e6056dc10b (diff)
Manage prefix on CAN and OBD2 prefix. Searching signals
is made on generic_name (without prefix) and returned vector of string is filled with name with prefix. Then you can process on them based upon their name differently. OBD2 signals will generated recurring request on diagnostic manager and decoding will not be handled the same way too. Change-Id: I2c5239ef49661941a0a748debe0bd536b2954b3a Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/can/can-signals.hpp')
-rw-r--r--src/can/can-signals.hpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/can/can-signals.hpp b/src/can/can-signals.hpp
index e906d26..10403da 100644
--- a/src/can/can-signals.hpp
+++ b/src/can/can-signals.hpp
@@ -76,7 +76,9 @@ class can_signal_t
{
private:
can_message_definition_t message_; /*!< message_ - The message this signal is a part of. */
- std::string generic_name_; /*!< generic_name_ - The name of the signal to be output over USB.*/
+ std::string generic_name_; /*!< generic_name_ - The name of the signal to be output.*/
+ std::string prefix_ = "messages."; /*!< 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.*/
uint8_t bit_position_; /*!< bitPosition_ - The starting bit of the signal in its CAN message (assuming
* non-inverted bit numbering, i.e. the most significant bit of
* each byte is 0) */
@@ -109,6 +111,7 @@ private:
public:
can_message_definition_t& get_message();
std::string& get_generic_name();
+ std::string get_name();
uint8_t get_bit_position() const;
uint8_t get_bit_size() const;
float get_factor() const;
@@ -126,6 +129,7 @@ public:
bool get_received() const;
float get_last_value() const;
+ void set_prefix(std::string val);
void set_received(bool r);
void set_last_value(float val);
}; \ No newline at end of file