diff options
author | Hiroki Koga <hiroki@witz-inc.co.jp> | 2019-06-05 17:37:11 +0900 |
---|---|---|
committer | Jan-Simon Moeller <jsmoeller@linuxfoundation.org> | 2019-06-19 14:15:05 +0000 |
commit | 2eda264a201385f5073362207b7de84bf71f9ec1 (patch) | |
tree | 8b4f55f56bffc58b01a99875aebbaab879ec8fab /low-can-binding/can/can-signals.cpp | |
parent | 087a7c0e7de28bb1c16895ef9d414666d37a35ea (diff) |
Modify to receive signal with bigger value than the number of states
Fix the bug about a part of decode_state in can-signals.cpp.
If a state of signal is allocated not in order, the signal
which is bigger value than the number of states cannot be received,
because can_signal_t::get_states compares signal value with
the number of states.
By this modification, get_states is changed to judges
whether a signal value exists in states or not.
Bug AGL: SPEC-2504
Change-Id: Ia67413507950654567808f7a08d0b0b3b47cbd23
Signed-off-by: Hiroki Koga <hiroki@witz-inc.co.jp>
Diffstat (limited to 'low-can-binding/can/can-signals.cpp')
-rw-r--r-- | low-can-binding/can/can-signals.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/low-can-binding/can/can-signals.cpp b/low-can-binding/can/can-signals.cpp index 240436ff..14881e89 100644 --- a/low-can-binding/can/can-signals.cpp +++ b/low-can-binding/can/can-signals.cpp @@ -111,7 +111,7 @@ bool can_signal_t::get_send_same() const const std::string can_signal_t::get_states(uint8_t value) { - if (value < states_.size()) + if ( states_.count(value) > 0 ) return states_[value]; return std::string(); } |