From: Hiroki Koga Date: Wed, 5 Jun 2019 08:37:11 +0000 (+0900) Subject: Modify to receive signal with bigger value than the number of states X-Git-Tag: 7.99.2~16 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F66%2F21566%2F2;p=apps%2Fagl-service-can-low-level.git 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 --- 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(); }