main.cc: Fix the default decoder using "states" 01/21801/1 7.99.3 8.0.0 8.0.1 8.0.2 8.0.3 halibut/7.99.3 halibut/8.0.0 halibut/8.0.1 halibut/8.0.2 halibut/8.0.3 halibut_7.99.3 halibut_8.0.0 halibut_8.0.1 halibut_8.0.2 halibut_8.0.3
authorRomain Forlot <romain.forlot@iot.bzh>
Mon, 1 Jul 2019 16:20:04 +0000 (18:20 +0200)
committerRomain Forlot <romain.forlot@iot.bzh>
Mon, 1 Jul 2019 16:20:04 +0000 (18:20 +0200)
This fix the decoder to use when a signal has states.

Bug-AGL: SPEC-2582

Change-Id: I9d0ddf23cc9ab4ca6f447b62a22482f2b772a027
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
src/main.cpp

index 0608f16..7880da2 100644 (file)
@@ -159,7 +159,7 @@ std::ostream& operator<<(std::ostream& o, const generator<openxc::signal>& v)
                << v.line_prefix_ << "\t" << gen(v.v_.force_send_changed()) << ",\n"\r
                << gen(v.v_.states(), v.line_prefix_ + '\t') << ",\n"\r
                << v.line_prefix_ << '\t' << gen(v.v_.writable()) << ",\n"\r
-               << v.line_prefix_ << '\t' << (v.v_.decoder().size() ? v.v_.decoder() : "nullptr") << ",\n"\r
+               << v.line_prefix_ << '\t' << (v.v_.decoder().size() ? v.v_.decoder() : v.v_.states().size() ? "decoder_t::decode_state" : "nullptr") << ",\n"\r
                << v.line_prefix_ << '\t' << (v.v_.encoder().size() ? v.v_.encoder() : "nullptr") << ",\n"\r
                << v.line_prefix_ << '\t' << "false\n"\r
                << v.line_prefix_ << "})}";\r