Skip to content

Runtime error when reading INT Signal as an Integer - Interpreted as Double #130

Open
@linkret

Description

@linkret

My .dbc file says this:

BA_DEF_ SG_ "SignalID" INT 0 100000 ;
BA_ "SignalID" SG_  786 BMSmaxPackTemperature 237;

In code, I get the ISignal, and ask for its -> AttributeValues(), iterating over them. If I try to do std::get<0>(a.Value()) (fetch the Attribute value as an INTEGER, because the value_t the .Value() method returns is an std::variant<int64_t, double, std::string>), my program crashes. Turns out that the attribute was parsed as a FLOAT, and the program only works if I do std::get<1>(a.Value()), and try to read it as a real number.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions